Skip to content

Commit a151b2b

Browse files
committed
ENH Use new DataList caching
Replaces deprecated `DataObject::get_one()` and `DataObject::get_by_id()` in favour of the new DataList query caching.
1 parent 6001836 commit a151b2b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"require": {
2222
"php": "^8.3",
23-
"silverstripe/framework": "^6",
23+
"silverstripe/framework": "^6.1",
2424
"silverstripe/versioned": "^3"
2525
},
2626
"require-dev": {

tests/TagFieldTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public function testItIgnoresNewTagsIfCannotCreate()
358358
/**
359359
* @var TagFieldTestBlogPost $record
360360
*/
361-
$record = DataObject::get_by_id(TagFieldTestBlogPost::class, $record->ID);
361+
$record = TagFieldTestBlogPost::get()->byID($record->ID);
362362

363363
$this->compareExpectedAndActualTags(
364364
['Tag1'],

0 commit comments

Comments
 (0)