Skip to content

Commit

Permalink
Merge pull request #1903 from creative-commoners/pulls/3.0/bulk-archive
Browse files Browse the repository at this point in the history
FIX Ensure record exists before trying to update TreeTitle
  • Loading branch information
GuySartorelli authored Feb 19, 2025
2 parents 8cebbf0 + 70c30e6 commit eda7cc9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code/CMSBatchAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ public function batchaction(SS_List $objs, $helperMethod, $successMessage, $argu

// Now make sure the tree title is appropriately updated
$publishedRecord = DataObject::get_by_id($this->managedClass, $id);
if ($publishedRecord instanceof SiteTree) {
$treeTitle = CMSMain::singleton()->getRecordTreeMarkup($publishedRecord);
} else {
$treeTitle = $publishedRecord->TreeTitle;
}
if ($publishedRecord) {
if ($publishedRecord instanceof SiteTree) {
$treeTitle = CMSMain::singleton()->getRecordTreeMarkup($publishedRecord);
} else {
$treeTitle = $publishedRecord->TreeTitle;
}
$status['modified'][$id] = [
'TreeTitle' => $treeTitle,
];
Expand Down

0 comments on commit eda7cc9

Please sign in to comment.