mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
BUGFIX Using toMap() in create_version() to avoid DataObject::__construct() failures
This commit is contained in:
parent
5d3f06b69a
commit
5e6b77a0a9
@ -53,7 +53,9 @@ class DMSDocument_versions extends DataObject {
|
|||||||
|
|
||||||
$existingPath = $doc->getFullPath();
|
$existingPath = $doc->getFullPath();
|
||||||
if (is_file($existingPath)) {
|
if (is_file($existingPath)) {
|
||||||
$version = new DMSDocument_versions($doc); //create a copy of the current DMSDocument as a version
|
$docData = $doc->toMap();
|
||||||
|
unset($docData['ID']);
|
||||||
|
$version = new DMSDocument_versions($docData); //create a copy of the current DMSDocument as a version
|
||||||
|
|
||||||
$previousVersionCounter = 0;
|
$previousVersionCounter = 0;
|
||||||
$newestExistingVersion = self::get_versions($doc)->sort(array('Created'=>'DESC','ID'=>'DESC'))->limit(1);
|
$newestExistingVersion = self::get_versions($doc)->sort(array('Created'=>'DESC','ID'=>'DESC'))->limit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user