Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-13411

Setting status of a new version is outside of the database transaction

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            cyberwolf cyberwolf
            cyberwolf cyberwolf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: