Add support for GridfieldOrderableRows

GridfieldExtensions' GridfieldOrderableRows is functionally quite similar (if not identical) to GridFieldSortableRows, and not all developers may want to support both modules.  This commit adds fallback support for sorting Document Sets using GridfieldOrderableRows if it is installed, and GridFieldSortableRows is not.

To test:
1. Uninstall GridFieldSortableRows (or start with an install without it)
2. Install GridFieldExtensions
3. Create/Open a Document Set
4. Make sure there are multiple files within.
5.  Drag/drop reorder without errors
This commit is contained in:
Ian Walls 2018-06-18 15:14:08 -04:00 committed by GitHub
parent 4f5dddc17d
commit dfbddb49a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,6 +112,8 @@ class DMSDocumentSet extends DataObject
if (class_exists('GridFieldSortableRows')) { if (class_exists('GridFieldSortableRows')) {
$gridFieldConfig->addComponent(new GridFieldSortableRows('DocumentSort')); $gridFieldConfig->addComponent(new GridFieldSortableRows('DocumentSort'));
} elseif (class_exists('GridFieldOrderableRows')) {
$gridFieldConfig->addComponent(new GridFieldOrderableRows('DocumentSort'));
} }
// Don't show which page this is if we're already editing within a page context // Don't show which page this is if we're already editing within a page context