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

Collaboration notification: last item is repeated if multiple (fix included)

    XMLWordPrintable

Details

    Description

      The cause of this issue is in eZCollaborationItemHandler::fetchList in kernel/classes/ezcollaborationitemhandler.php

      It can be fixed by changing line 589

      $list[] =& $handlerInstance;

      to

      $list[] = $handlerInstance;

      You can see what's happening looking at the code

      foreach ( $activeHandlers as $handler )
      {
         $handlerInstance = eZCollaborationItemHandler::instantiate( $handler, $repositories );
         if ( $handlerInstance !== null )
             $list[] =& $handlerInstance;
      }

      The reference to $handlerInstance is being appended to the list array. When there are multiple handlers the reference is updated with the values returned from eZCollaborationItemHandler::instantiate. "list" becomes an array of references to the last valid handler instance.

      Steps to reproduce

      Add an additional workflow that contains a collaboration handler. e.g. eZApprove2 http://projects.ez.no/ezapprove2

      Assuming the extension is activated visiting My Account -> My notification settings will show the last Collaboration notification item repeated.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: