"Undefined" errors

Freso - June 26, 2008 - 16:21
Project:Pingback
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I just tried to trigger a Pingback against my own site, but nothing happened. So I checked the logs and noticed a lot of "Undefined property: stdClass::$error in /home/www/freso.dk/sites/all/modules/pingback/pingback.module on line 345." and a few "Undefined variable: successful in /home/www/freso.dk/sites/all/modules/pingback/pingback.module on line 438.".

#1

andreashaugstrup - July 12, 2008 - 09:46

Some code from the previous maintainer seem to not be safe from notice-level warnings. I'll get on this eventually. :o)

#2

Freso - August 13, 2008 - 18:10
Status:active» patch (code needs review)

The first one was apparently because it was checking for $get->error, but the error key is only defined if there actually is an error. Using empty($get->error) instead of !$get->error should fix this. Alternatively, !isset($get->error) could be use, to avoid cases where $get->error is 0, '', array(), '0', or other "empty" things.

The second was due to a count($successful) where the variable was actually called $succesful. I renamed the variable, as "successful" is proper English and "succesful" is not (even if it is more proper Danish ;)).

AttachmentSize
275327_fixing_undefineds-2.patch1.08 KB

#3

Freso - August 13, 2008 - 20:02

And here's another fix for something yielding "undefined" errors.

AttachmentSize
275327_fixing_undefineds-3.patch1.37 KB

#4

Freso - August 14, 2008 - 10:14
Status:patch (code needs review)» fixed

Committed to HEAD and 6.x-1.x.

#5

Anonymous (not verified) - August 28, 2008 - 10:23
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.