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

Bug in eZJSCore's ezjscajaxcontent.php - Attribute 'creator_id' does not exist

    XMLWordPrintable

Details

    Description

      Even if it's a bad practice deleting users from a site we can sometimes delete some user by mistake... And if this happens, and we don't have a way to bring it back (for instance) we will start having an error in the logs every time we navigate in our content tree:

      [ Nov 07 2012 12:19:49 ] [127.0.0.1] eZContentObject::attribute:
      Attribute 'creator_id' does not exist
      

      This error is shown because the "creator_id" attribute is being fetched in the wrong way.
      The bug seems to be on line 263 in extension/ezjscore/classes/ezjscajaxcontent.php

                      $ret['creator'] = array( 'id'   => $contentObject->attribute( 'creator_id' ),
                                               'name' => null );// user has been deleted
      

      The correct fetch to the 'creator_id' attribute should be something like this:

                      $ret['creator'] = array( 'id'   => $contentObject->attribute( 'current' )->attribute('creator_id'),
                                               'name' => null );// user has been deleted
      

      Steps to Reproduce:

      • Create an editor user.
      • With the new editor user create a folder under /Home
      • delete the editor user
      • visit the root node on site_admin
      • in the logs there will be an error message like:
        [ Nov 07 2012 12:19:49 ] [127.0.0.1] eZContentObject::attribute:
        Attribute 'creator_id' does not exist

      With the proposed solution the error isn't shown anymore.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ricardo.correia-obsolete@ez.no Ricardo Correia (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 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, 2 hours, 18 minutes
                1d 2h 18m