Details
-
Bug
-
Resolution: Fixed
-
Medium
-
3.10.0, 3.10.1rc1, 3.9.4, 4.0.0, 4.0.1rc1
-
None
Description
In content/edit.php:
$obj->cleanupInternalDrafts(); $version = $obj->createNewVersionIn( $EditLanguage ); $version->setAttribute( 'status', eZContentObjectVersion::STATUS_INTERNAL_DRAFT ); $version->store(); return $Module->redirectToView( "edit", array( $ObjectID, $version->attribute( "version" ), $EditLanguage ) );
"$version = $obj->createNewVersionIn( $EditLanguage );" starts and commits a database transaction, and the 2 lines after are not in a transaction anymore.
Suggested solution: add a new parameter to eZContentObject::createNewVersionIn(), which specifies the status for the new version (by default eZContentObjectVersion::STATUS_DRAFT). Here we pass eZContentObjectVersion::STATUS_INTERNAL_DRAFT. We will also spare a SQL query with doing it this way.