Posted by mikl on May 18, 2011 at 5:50pm
2 followers
| Project: | Addresses |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Issue Summary
I was encountering a lot of PHP notices when using addresses. Here's a patch for that.
| Attachment | Size |
|---|---|
| 0001-PHP-notice-fixes.patch | 2.97 KB |
Comments
#1
Ah, disregard the previous patch. I didn't understand some of the logic right and introduced a bug…
This one should work as advertised :)
#2
Hi mikl,
I applied your patch, except for the following:
<?phpforeach (array_keys($ftypes) as $ftype) {
- $fields[$ftype] = $field[$ftype];
+ $fields[$ftype] = (isset($field[$ftype])) ? $field[$ftype] : NULL;
}
?>
It seems to me that if $field[$ftype] is not set, then there is no point in created an entry in $fields[]. Therefore, I would think that this would be more appropriate:
<?phpif(isset($field[$ftype])) {
$fields[$ftype] = $field[$ftype];
}
?>
Would you mind testing and seeing whether that causes any problem in your environment?
Thank you.
Alexis