Problem/Motivation

Steps to reproduce

  1. On a fresh standard install of Drupal, enable the forum module.
  2. Post a forum topic at node/add/forum.
  3. Go to admin/content and unpublish the node.

Result

You will receive an error:

Notice: Undefined property: stdClass::$shadow in forum_node_update() (line 373 of /.../modules/forum/forum.module)

The property is being checked with if ($node->shadow), but it may not be set at all.

Proposed resolution

Use if (!empty($node->shadow)) instead of if ($node->shadow). Patch in #1 implements this change.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Original report by @kerala

" Notice: Undefined property: stdClass::$shadow in forum_node_update() (line 373 of C:\wamp\www\D-7.7\modules\forum\forum.module) "

I downloaded drupal 7.7 and installed a fresh copy on my localhost and I posted a forum topic.When i unpuplished the post going to home » Administration » content i got the above error message.(I did'nt install any contributed modules)
I am getting this error whenever i try to "publish or unpublish" a forum post from home » Administration » content section..
i got the same error message for my drupal 7.2 and 7.4 sites also..
Any idea?

Comments

agi.novanta’s picture

Version: 7.7 » 8.x-dev
StatusFileSize
new485 bytes

I think is just missing an empty() on line 374.
There is the same bug on 8.x.

popzkg’s picture

Title: Notice: Undefined property: stdClass::$shadow in forum_node_update() (line 373 of...... » Is this a serious bug?

Is this a serious bug? mine is a production site.will this bug cause anything wrong for my site?and actually i dont know how to apply the patches..

marcingy’s picture

Title: Is this a serious bug? » Notice: Undefined property: stdClass::$shadow in forum_node_update() (line 373 of C:\wamp\www\D-7.7\modules\forum\forum.module)

Reseting title

marcingy’s picture

Status: Active » Reviewed & tested by the community
Issue tags: +Needs backport to D7

Looks good - assuming it goes green.

xjm’s picture

#2 It won't affect your site's functionality, so you are safe to wait until this is in a release.

xjm’s picture

Issue summary: View changes

a small change..

xjm’s picture

Title: Notice: Undefined property: stdClass::$shadow in forum_node_update() (line 373 of C:\wamp\www\D-7.7\modules\forum\forum.module) » Notice: Undefined property: stdClass::$shadow in forum_node_update() (line 373 of /.../modules/forum/forum.module)

Added issue summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x. Thanks.

BeaPower’s picture

I am also having this problem with views bulk operations, was this fix applied to the next release of the module?

larowlan’s picture

BeaPower this has been applied to 7.x branch which will most likely see a point release at the end of August

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xjm’s picture

Issue summary: View changes

Updated issue summary.