On saving a forum topic from node/%/edit I get the following error:

notice: Undefined property: stdClass::$revision in /home/libcomwww/public_html/drupal6/modules/forum/forum.module on line 261.

Attached patch fixes it for me.

CommentFileSizeAuthor
#3 forum-edit.patch748 bytescatch
forum-edit.patch749 bytescatch

Comments

catch’s picture

Status: Active » Needs review
JirkaRybka’s picture

Status: Needs review » Needs work

I'm not familiar with that bit of code, but I would rather use empty() instead of !isset(). empty() is exactly the same as !$variable, only just avoids warnings, so it's a safer replacement.

http://cz2.php.net/manual/en/function.empty.php :

empty() is the opposite of (boolean) var, except that no warning is generated when the variable is not set.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new748 bytes

Thanks JirkaRybka.

empty() does the job just fine.

JirkaRybka’s picture

I tried to test this, but I seem unable to reproduce the problem: Fresh 6.x-dev install, enabled forum module, added one container and one forum, created a forum topic. Edited it, tried with/without previews, revisions - no warnings on screen and no warnings in watchdog. This is puzzling me...

Edit: Ah, now I see: The bug doesn't happen while testing as user 1. Now going to test again.

JirkaRybka’s picture

Status: Needs review » Reviewed & tested by the community

Ok, as a mere authenticated user with decent forum-posting permissions (no revisions allowed/offered on form), I reproduce the problem. Patch fixes it, simple one-liner.

RTBC.

catch’s picture

Status: Reviewed & tested by the community » Needs review

JirkaRybka: sorry, should've mentioned that I was testing with auth user at the time.

catch’s picture

Status: Needs review » Reviewed & tested by the community

cross posted.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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