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

eZContentObjectTrashNode originalParent() method fails when called multiple times

    XMLWordPrintable

    Details

      Description

      eZContentObjectTrashNode originalParent() method fails when called multiple times


      *Steps to reproduce:*

      1. Send any object to trash, remember its object id.
      2. The following code piece shows the problem. Pay attention to the comments in code below :

      <?php
      
        // Replace with the actual trashed object id
        $contentObjectId = 100;
        // Fetch trash node
        $trashNode = eZContentObjectTrashNode::fetchByContentObjectID( $contentObjectId );
      
        // First call : works as intended, returns trash node original parent
        $originalParent = $trashNode->attribute( 'original_parent' );
        if ( $originalParent instanceof eZContentObjectTreeNode )
          echo 'First call : success';
      
        // Subsequent call : fails, returns null
        $originalParent = $trashNode->attribute( 'original_parent' );
        if ( $originalParent === null )
          echo 'Second call : failure';
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            ricardo.correia-obsolete@ez.no Ricardo Correia (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 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 - 10 minutes
                10m