"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
Some code from the previous maintainer seem to not be safe from notice-level warnings. I'll get on this eventually. :o)
#2
The first one was apparently because it was checking for
$get->error, but theerrorkey is only defined if there actually is an error. Usingempty($get->error)instead of!$get->errorshould fix this. Alternatively,!isset($get->error)could be use, to avoid cases where$get->erroris0,'',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 ;)).#3
And here's another fix for something yielding "undefined" errors.
#4
Committed to HEAD and 6.x-1.x.
#5
Automatically closed -- issue fixed for two weeks with no activity.