silvercommerce/versionhistoryfield

Field that hows a simple version history of a versioned DataObject.

Maintainers

👁 DFT

Package info

github.com/silvercommerce/versionhistoryfield

Type:silverstripe-vendormodule

pkg:composer/silvercommerce/versionhistoryfield

Statistics

Installs: 5 064

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.1 2025-01-27 16:28 UTC

Requires

Requires (Dev)

None

Suggests

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause d433997869d9c48733cc7445d4d1742564d9525e

Formssilverstripeformfieldversioned

This package is auto-updated.

Last update: 2026-06-15 13:54:30 UTC


README

👁 Scrutinizer Code Quality

Simple field that lists changes made to an associated "Versioned" DataObject

Designed to be used with SilverCommerce Estimates, Invoices and contacts, but should work equally well with any other DataObject

Installing

Install via composer:

composer require silvercommerce/versionhistoryfield

Then flush

Usage

You can add this field to any form that represents a DataObject that uses Versioned. It will output a simple list of changes. For example, to add to YourObject::getCMSFields() use:

class YourDataObject extends DataObject
{
 ...

 public function getCMSFields()
 {
 $fields = parent::getCMSFields();

 $fields->addFieldToTab(
 "Root.History",
 VersionHistoryField::create(
 "History",
 _t("SilverCommerce\VersionHistoryField.History", "History"),
 $this
 )->addExtraClass("stacked") // make the field full width
 );

 return $fields;
 }

 ...
}