Skip to content

Commit 99365b3

Browse files
authored
[5.3] Restored Article Version Now Properly Checked Out to Current User (joomla#45597)
1 parent 53feabd commit 99365b3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/src/Versioning/VersionableModelTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Joomla\CMS\Versioning;
1111

12+
use Joomla\CMS\Date\Date;
1213
use Joomla\CMS\Language\Text;
1314
use Joomla\CMS\Table\Table;
1415
use Joomla\Utilities\ArrayHelper;
@@ -79,6 +80,9 @@ public function loadHistory($versionId, Table $table)
7980
$table->load($rowArray[$key]);
8081
}
8182

83+
$rowArray['checked_out'] = $this->getCurrentUser()->id;
84+
$rowArray['checked_out_time'] = (new Date())->toSql();
85+
8286
// Fix null ordering when restoring history
8387
if (\array_key_exists('ordering', $rowArray) && $rowArray['ordering'] === null) {
8488
$rowArray['ordering'] = 0;

0 commit comments

Comments
 (0)