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

Wrong VersionNo emit by signalDispatcher

    XMLWordPrintable

Details

    • [2.2] Sprint 1

    Description

      There is wrong VersionNo emit in method createContentDraft (eZ\Publish\Core\SignalSlot\ContentService class in line 320).

      When you create new content draft you got new versionNo for this draft but in SignalSlot you have lastest content published versionNo.

      I think should be added something like this to parameter array:
      'newVersionNo' => $returnValue->getVersionInfo()->versionNo

      Proposed solution:

          public function createContentDraft(ContentInfo $contentInfo, VersionInfo $versionInfo = null, User $user = null)
          {
              $returnValue = $this->service->createContentDraft($contentInfo, $versionInfo, $user);
              $this->signalDispatcher->emit(
                  new CreateContentDraftSignal(
                      array(
                          'contentId' => $contentInfo->id,
                          'versionNo' => ($versionInfo !== null ? $versionInfo->versionNo : null),
                          'newVersionNo' => $returnValue->getVersionInfo()->versionNo,
                          'userId' => ($user !== null ? $user->id : null),
                      )
                  )
              );
      
              return $returnValue;
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            wargas wargas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: