Skip to content

Commit 26f8877

Browse files
authored
Merge pull request #46012 from richard67/5.4-dev-upmerge-2025-08-29
[5.4] Upmerge 2025-08-29
2 parents 369756c + 642eb3f commit 26f8877

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

libraries/src/Versioning/VersionableModelTrait.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,14 @@ public function loadHistory($versionId, Table $table)
8080
$table->load($rowArray[$key]);
8181
}
8282

83-
$rowArray['checked_out'] = $this->getCurrentUser()->id;
84-
$rowArray['checked_out_time'] = (new Date())->toSql();
83+
// We set checked_out to the current user
84+
if ($table->hasField('checked_out')) {
85+
$rowArray[$table->getColumnAlias('checked_out')] = $this->getCurrentUser()->id;
86+
}
87+
88+
if ($table->hasField('checked_out_time')) {
89+
$rowArray[$table->getColumnAlias('checked_out_time')] = (new Date())->toSql();
90+
}
8591

8692
// Fix null ordering when restoring history
8793
if (\array_key_exists('ordering', $rowArray) && $rowArray['ordering'] === null) {

0 commit comments

Comments
 (0)