The following message appears on the site I'm currently developing.

Notice: Undefined property: stdClass::$uid en fb_get_object_fbu() on line 1110 of fb.module

After reviewing the code there is a logical error in the if ... elseif clauses that results with this message appearing.

I'm fairly new to drupal and am not entirely familiar with the process of reporting that takes place here.
This is my first attempt and I've given all possible info I can at the moment.
My best guess is that the code should've been submitted as a .patch instead of the .module being zipped...
Will read the documentation more when I have the time for future submissions.

Didn't see what I placed in the log on the preview so I place it here also just in case:

I have included the modified fb.module file.
What was done was:
- The elseif ($object->uid > 0) condition was removed from line 1110
- The code in the initial if :: if (isset($object->uid) && isset($cache[$object->uid])) was modified so it now looks like:
if (isset($object->uid) && isset($cache[$object->uid])) {
if ($object->uid > 0) {
// This can be expensive on pages with many comments or nodes!
$fbu = fb_get_fbu($object->uid);
} else {
$fbu = $cache[$object->uid];
}
return $fbu;
}

So basically what is done is that the elseif condition now properly applies within the initial if and the result is that the message no longer appears.

CommentFileSizeAuthor
#1 fb_get_object_fbu.diff642 bytesDave Cohen
fb.zip16.38 KBjucedogi

Comments

Dave Cohen’s picture

StatusFileSize
new642 bytes

It helps to have patches in the issue queue. Much more so than modified files. A quick search on drupal.org will tell you how to make them and apply them.

Here's one you can test and review for me whether it solves the problem. Thanks.

jucedogi’s picture

Assigned: jucedogi » Unassigned
Status: Needs review » Closed (won't fix)