Skip to content

Commit a5453f3

Browse files
BettinaMaria98Bettina Bröthaler
andauthored
CMS 5 Compatibility (#74)
* Updated for cms 5 compatibility * Update AutoPublishSortExtension.php Fixed getter on Version - changed first() to record() call --------- Co-authored-by: Bettina Bröthaler <[email protected]>
1 parent 043f0ee commit a5453f3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
}
2727
],
2828
"require": {
29-
"silverstripe/cms": "^4.0",
30-
"symbiote/silverstripe-gridfieldextensions": "^3.2"
29+
"silverstripe/cms": "^5.0.0",
30+
"symbiote/silverstripe-gridfieldextensions": "^4.0.0"
3131
},
3232
"autoload": {
3333
"psr-4": {

src/Extensions/AutoPublishSortExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function onAfterReorderItems(SS_List &$list, array $values, array $sorted
3737
foreach ($sortedIDs as $sortValue => $itemID) {
3838
DB::prepared_query('UPDATE "' . $tableName . '_Live" SET "' . $sortField . '"=? WHERE "ID"=?', [$sortValue, $itemID]);
3939
$version = DB::prepared_query('SELECT Version FROM "' . $tableName . '_Versions" WHERE "RecordID"=? ORDER BY "ID" DESC', [$itemID]);
40-
DB::prepared_query('UPDATE "' . $tableName . '_Live" SET "Version"=? WHERE "ID"=?', [$version->first()['Version'], $itemID]);
40+
DB::prepared_query('UPDATE "' . $tableName . '_Live" SET "Version"=? WHERE "ID"=?', [$version->record()['Version'], $itemID]);
4141
}
4242
}
4343
}

src/Extensions/CategoryPageHierarchyExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CategoryPageHierarchyExtension extends DataExtension
2020
* @param \SilverStripe\ORM\DataList $stageChildren
2121
* @param $context
2222
*/
23-
public function augmentAllChildrenIncludingDeleted(&$stageChildren, &$context)
23+
public function augmentAllChildrenIncludingDeleted(&$stageChildren)
2424
{
2525
if ($this->shouldFilter() && $this->owner->hasExtension(HidePageChildrenExtension::class)) {
2626
$stageChildren = $stageChildren->exclude('ClassName', $this->getExcludedSiteTreeClassNames());

0 commit comments

Comments
 (0)