BUGFIX Using toMap() in create_version() to avoid DataObject::__construct() failures

This commit is contained in:
Ingo Schommer 2013-01-08 13:16:03 +01:00
parent 5d3f06b69a
commit 5e6b77a0a9

View File

@ -53,7 +53,9 @@ class DMSDocument_versions extends DataObject {
$existingPath = $doc->getFullPath();
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;
$newestExistingVersion = self::get_versions($doc)->sort(array('Created'=>'DESC','ID'=>'DESC'))->limit(1);