I'm getting some errors.

Notice: Undefined index: phone_number_extension in addressfield_phone_handler_field_address_phone_nr->render() (line 51 of /mnt/www/html/chlaorgdev/docroot/sites/all/modules/contrib/addressfield_phone/views/handlers/addressfield_phone_handler_field_address_phone_nr.inc).
Notice: Undefined index: mobile_number in addressfield_phone_handler_field_address_phone_nr->render() (line 52 of /mnt/www/html/chlaorgdev/docroot/sites/all/modules/contrib/addressfield_phone/views/handlers/addressfield_phone_handler_field_address_phone_nr.inc).
Notice: Undefined index: phone_number_extension in addressfield_phone_handler_field_address_phone_nr->render() (line 51 of /mnt/www/html/chlaorgdev/docroot/sites/all/modules/contrib/addressfield_phone/views/handlers/addressfield_phone_handler_field_address_phone_nr.inc).
Notice: Undefined index: mobile_number in addressfield_phone_handler_field_address_phone_nr->render() (line 52 of /mnt/www/html/chlaorgdev/docroot/sites/all/modules/contrib/addressfield_phone/views/handlers/addressfield_phone_handler_field_address_phone_nr.inc).

Comments

antonnavi’s picture

Status: Needs review » Reviewed & tested by the community

Had the same issue.
Patch addressfield_phone.patch fix it and works fine for me.
Thank You Tim Bozeman!

vikramy’s picture

The above patch works great. Thank you Tim Bozeman.

jedihe’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.52 KB

I was getting some notices even after I applied the patch from Tim Bozeman. Updated it to ensure proper defaults are set in any case.

tim bozeman’s picture

jedihe’s picture

Updating patch to prevent some more notices.

jcisio’s picture

StatusFileSize
new3.58 KB

The isset() first won't work because when an option is unchecked, the array key is still there with value "0". Here is another patch. It also fixes unnecessary variable declaration in the Views handle too.

jcisio’s picture

Status: Needs review » Fixed

  • jcisio committed a93662b on 7.x-1.x
    Issue #2500725 by jedihe, Tim Bozeman, jcisio: Undefined index in...
tim bozeman’s picture

Neat + array thing! Never seen that before.

Status: Fixed » Closed (fixed)

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

rickj’s picture

There's as minor coding error in #6 which results in this error:
Notice: Undefined index: fax in addressfield_format_phone_generate()

Line 69 of the patched file is missing an isset(), should be:

    if (!$settings || isset($settings['fax'])) {
neograph734’s picture

Status: Closed (fixed) » Needs work

Reopening as per #11.

This is issue is linked from #2481897: Undefined index in addressfield_format_phone_generate() and the problem is not yet (fully) resolved.

neograph734’s picture

Status: Needs work » Needs review
StatusFileSize
new658 bytes

Patch for solution offered in #11.

neograph734’s picture

Status: Needs review » Closed (fixed)
Related issues: +#2689889: Error in line 69

Argh, this has gotten kinda scatterd... There is already a patch in #2689889: Error in line 69. Reverting this issue.