Bug #23040 Bug Fixed

Revision Enabled Channels Throw Error upon Entry Creation.

Version: 3.5.4 Reporter: MajesticIX

If you enable revisions on a channel–upon first saving a new entry, you get an error:

Trying to get property of non-object ee-EllisLab/ExpressionEngine/Model/Channel/ChannelEntry.php, line 447

It still saves the entry, and subsequent edits to that entry don’t throw an error. Disable revisions fixes the issue. I have tested this on a clean install of EE with no plugins so it should be easy to replicate.

  • Yup - I was just about post this issue. I’m seeing this too.

    Paul Bell
    30th March, 2017 at 8:41am
  • Can you export your Channel Set and link to a download of it? I’m not replicating with a vanilla channel on a fresh install. And this is on 3.5.4? Lastly if you could cut and paste the full error along with the stack trace if provided that would be great. Thanks!

    Derek Jones
    30th March, 2017 at 11:42am
  • I enabled error reporting in the admin.php file, though it isn’t showing my more details. Here is a screenshot of all I can get out of it (I looked up the function and that’s how I came to the assumption of the revisions…and then disabled it and fixed it).

    Here is a link to the ChannelSet export: https://www.dropbox.com/s/tj8dtoupzf55i86/ChannelSet.zip?dl=0

    Here is a link to the screenshot of the error: https://www.dropbox.com/s/9zt45f2vv8jonfv/screenshot.png?dl=0

    And to confirm, yes this is version 3.5.4. Clean install (I used this to diagnose another bug last week).

    MajesticIX
    30th March, 2017 at 12:10pm
  • Perfect thanks for the extra details MajesticIX!

    Derek Jones
    30th March, 2017 at 12:16pm
  • No problem–if you need anything else or even access to this test instance, just let me know !

    -Geoff

    MajesticIX
    30th March, 2017 at 12:20pm
  • Spotted, on that line change:

    if ($data == $last_version->version_data)

    to:

    if ( ! empty($last_version) && $data == $last_version->version_data)
    Derek Jones
    30th March, 2017 at 12:39pm
  • I can confirm this fixes the issue. Nice job and thank you!

    MajesticIX
    30th March, 2017 at 12:43pm
  • Thanks for reporting!

    Derek Jones
    30th March, 2017 at 12:45pm

You must be signed in to comment on a bug report.

  • In system/ee/EllisLab/ExpressionEngine/Model/Channel/ChannelEntry.php change line 447 from:

    if ($data == $last_version->version_data)

    to:

    if ( ! empty($last_version) && $data == $last_version->version_data)

ExpressionEngine News

#eecms, #events, #releases