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

fatal error in ezjscore when encoding an object without a node

    Details

      Description

      The error msg says it all:

      Fatal error: Call to a member function attribute() on a non-object in D:\htdocs\ezp\installs\ezpublish-4.6.0-ent\extension\ezjscore\classes\ezjscajaxcontent.php on line 243
      Fatal error: eZ Publish did not finish its request

      It happens e.g. when someone tries to put in a rich text field a link to an object that has got no node yet - most likely via bad import scripts

        Issue Links

          Activity

          Hide
          Carlos Revillo added a comment -

          hi again Gaetano. Is that line (243) the same as it's in master branch of extension?

          $ret['class_id']                	= (int) $contentObject->attribute( 'contentclass_id' );
          

          it sounds strange to me... if $contentObject is not an object, it should crash before, in one of the other calls to $contentObject->attribute

          Cheers

          Show
          Carlos Revillo added a comment - hi again Gaetano. Is that line (243) the same as it's in master branch of extension? $ret['class_id'] = (int) $contentObject->attribute( 'contentclass_id' ); it sounds strange to me... if $contentObject is not an object, it should crash before, in one of the other calls to $contentObject->attribute Cheers
          Hide
          Gaetano Giunta added a comment -

          It is actually this line:

          $ret['path_identification_string'] = $node->attribute( 'path_identification_string' );

          and there are 2 code paths that instantiate $node but do not check if it is there - no other calls to $node->somemethod before this one

          Show
          Gaetano Giunta added a comment - It is actually this line: $ret ['path_identification_string'] = $node->attribute( 'path_identification_string' ); and there are 2 code paths that instantiate $node but do not check if it is there - no other calls to $node->somemethod before this one
          Show
          Bertrand Dunogier added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/777 .
          Show
          Bertrand Dunogier added a comment - Merged to master: https://github.com/ezsystems/ezpublish-legacy/commit/94c0323 .
          Hide
          Filipe Dobreira (Inactive) added a comment -

          QA Approved.

          Show
          Filipe Dobreira (Inactive) added a comment - QA Approved.

            People

            • Assignee:
              Unassigned
              Reporter:
              Gaetano Giunta
            • Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 2 hours
                2h