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.

AttachmentSize
0001-PHP-notice-fixes.patch2.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 :)

AttachmentSize
0001-PHP-notice-fixes.patch 2.79 KB

#2

Status:needs review» postponed (maintainer needs more info)

Hi mikl,

I applied your patch, except for the following:

<?php
  
foreach (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:

<?php
 
if(isset($field[$ftype])) {
   
$fields[$ftype] = $field[$ftype];
  }
?>

Would you mind testing and seeing whether that causes any problem in your environment?

Thank you.
Alexis

nobody click here