Skip to content

Commit 4a10c31

Browse files
authored
Resolve deprecation warning when calling static method on Extensible trait (#63)
* Update GridFieldOrderableRowsExtension.php On a non versioned dataobject, gridfieldorderablerowsextension throws deprecation warning when reordering objects: [Deprecated] Calling static trait method SilverStripe\Core\Extensible::has_extension is deprecated, it should only be called on a class using the trait POST /admin/pages/edit/EditForm/34/field/ElementalArea/item/97/ItemEditForm/field/AccordionItems/reorder Line 78 in /var/www/mysite/www/vendor/silverstripe-terraformers/keys-for-cache/src/Extensions/GridFieldOrderableRowsExtension.php Changing to DataObject (has trait Extensible, all gridfield objects should extend DO) fixes this. Not sure if this was introduced from php8 upgrade or the recent security patch * Update GridFieldOrderableRowsExtension.php
1 parent eab67e2 commit 4a10c31

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Extensions/GridFieldOrderableRowsExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Terraformers\KeysForCache\Extensions;
44

5-
use SilverStripe\Core\Extensible;
65
use SilverStripe\Core\Extension;
76
use SilverStripe\ORM\ArrayList;
87
use SilverStripe\ORM\DataList;
@@ -75,7 +74,7 @@ public function onAfterReorderItems(SS_List $list, array $values, array $sortedI
7574
}
7675

7776
// We can't do anything with the Ordered DataObject if it doesn't have our CacheKeyExtension applied
78-
if (!Extensible::has_extension($class, CacheKeyExtension::class)) {
77+
if (!DataObject::has_extension($class, CacheKeyExtension::class)) {
7978
return;
8079
}
8180

0 commit comments

Comments
 (0)