If you are using symbiote/silverstripe-gridfieldextensions
and the GridFieldOrderableRows
component:
GridFieldOrderableRows
will have out of the box support for KFC forVersioned
DataObjects, as it already uses the ORM and thewrite()
method to save sort orders.GridFieldOrderableRows
unfortunately does not use thewrite()
method for nonVersioned
DataObjects, it instead performs raw SQL queries, which completely bypasses the triggers we have attached towrite()
.
There is an open ticket on the GridFieldExtensions module to try and get GridFieldOrderableRows to use the ORM for both Versioned and non-Versioned DataObjects: symbiote/silverstripe-gridfieldextensions#335
In the meantime though, we have provided an Extension that adds support for clearing of CacheKeys on non Versioned
DataObjects when you are using the GridFieldOrderableRows component.
GridFieldOrderableRowsExtension
This Extension is not automatically applied, because I think you should seriously consider Versioning your DataObject.
If you are adding this DataObject to (something like) an Element, which is Versioned, then (imo) it is best that all
of the related DataObjects (like its "Items") are also Versioned
. This gives a consistent author experience - where
they can have draft/live versions of things.
This Extension also doesn't have any test coverage (because of everything we mentioned above). It has only gone through manual testing. Use at your own risk and be prepared to submit tickets if you find any issues or use cases that aren't supported.
Symbiote\GridFieldExtensions\GridFieldOrderableRows:
extensions:
- Terraformers\KeysForCache\Extensions\GridFieldOrderableRowsExtension