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

eZWorkflowType::STATUS_REDIRECT sets bad object version status

    Details

      Description

      If you have a custom workflow event that returns eZWorkflowType::STATUS_REDIRECT, the status won't be correctly set and the items will disappear from admin interface because of that.

      Steps to Reproduce

      1. Create a custom workflow event according to the following code

        class myTest extends eZWorkflowEventType
        {
            const WORKFLOW_TYPE_STRING = 'mytest';
            function __construct(){
                parent::__construct(self::WORKFLOW_TYPE_STRING, 'My Test');
            }
         
            function execute( $process, $event ){
                $process->RedirectUrl = '/';
                return eZWorkflowType::STATUS_REDIRECT_REPEAT;
            }
        }
         
        eZWorkflowEventType::registerEventType( myTest::WORKFLOW_TYPE_STRING, 'myTest' );
        

      2. Create a new workflow and set it to before\publish trigger
      3. Create a new article
      4. The item won't be displayed at pending items

      Note: This was working in all versions before eZP 5.2

        Issue Links

          Activity

          Show
          Peter Keung added a comment - See also: http://share.ez.no/forums/ez-publish-5-platform/seeing-a-strange-version-info-status-in-the-symfony-stack
          Hide
          Peter Keung added a comment - - edited

          This is also related: https://github.com/mugoweb/hideuntildate/pull/3

          A quick test which is by no means a fix is to comment out these lines around line 747 in kernel/content/edit.php

                              case eZModuleOperationInfo::STATUS_REPEAT:
                              {
                                  //eZContentOperationCollection::setVersionStatus( $object->attribute( 'id' ),
                                      //$version->attribute( 'version' ), eZContentObjectVersion::STATUS_REPEAT );
                              }
          

          Show
          Peter Keung added a comment - - edited This is also related: https://github.com/mugoweb/hideuntildate/pull/3 A quick test which is by no means a fix is to comment out these lines around line 747 in kernel/content/edit.php case eZModuleOperationInfo::STATUS_REPEAT: { //eZContentOperationCollection::setVersionStatus( $object->attribute( 'id' ), //$version->attribute( 'version' ), eZContentObjectVersion::STATUS_REPEAT ); }
          Hide
          Gunnstein Lye added a comment - - edited

          The most likely regression candidate seems to be EZP-21599 which affects content/publish, and STATUS_REPEAT among other things.
          https://github.com/ezsystems/ezpublish-legacy/commit/60f7a51a7de6b46921995a8b337d7a22339d58a5

          Edit: Confirmed, reverting EZP-21599 fixes the problem. On master, EZP-22466 must be reverted first.

          Show
          Gunnstein Lye added a comment - - edited The most likely regression candidate seems to be EZP-21599 which affects content/publish, and STATUS_REPEAT among other things. https://github.com/ezsystems/ezpublish-legacy/commit/60f7a51a7de6b46921995a8b337d7a22339d58a5 Edit: Confirmed, reverting EZP-21599 fixes the problem. On master, EZP-22466 must be reverted first.
          Hide
          Bertrand Dunogier added a comment - - edited

          Peter, what is described (wrong exposed status) is partially different, and fixed in master / 5.3 / next community project: EZP-22661.

          Show
          Bertrand Dunogier added a comment - - edited Peter, what is described (wrong exposed status) is partially different, and fixed in master / 5.3 / next community project: EZP-22661 .
          Hide
          Bertrand Dunogier added a comment - - edited

          It won't fix this issue, it fixes what is described on the forums. I'm still investigating this one.

          Show
          Bertrand Dunogier added a comment - - edited It won't fix this issue, it fixes what is described on the forums. I'm still investigating this one.
          Show
          Bertrand Dunogier added a comment - PR https://github.com/ezsystems/ezpublish-legacy/pull/966
          Hide
          Bertrand Dunogier added a comment -

          Merged to master@c7b5ec8b.

          Show
          Bertrand Dunogier added a comment - Merged to master@c7b5ec8b .
          Hide
          Joao Pingo (Inactive) added a comment -

          QA Approved

          Show
          Joao Pingo (Inactive) added a comment - QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Eduardo Fernandes (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 30 minutes
                1d 1h 30m