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

PHP notice in Author datatype

    XMLWordPrintable

Details

    Description

      A PHP notice is generated in :

      Notice: PHP: E_NOTICE 	Aug 23 2011 15:43:14
      Undefined offset:  -1 in kernel/classes/datatypes/ezauthor/ezauthor.php on line 62
      

      The code:

       59     function addAuthor( $id, $name, $email )
       60     {
       61         if ( $id == -1 )
       62             $id = $this->Authors[$this->AuthorCount - 1]['id'] + 1;
      
      Steps to reproduce

      1. log in as admin in admin interface
      2. Click "Content structure"
      3. Click "Create new" button
      4. Select a class which has the Author datatype in the drop down
      5. When editing the object, current logged in user will be proposed as Author
      6. Click the check box next to the proposed user and click "Remove selected"
      7. Click "Send for Publishing"
      8. Validation of the object will fail because of missing author, you are back at the editing page
      9. Click "Add author"
      10. The page will reload with the mentioned PHP notice

      Attachments

        Activity

          People

            andre1 andre1
            vl vl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: