Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using addressfield in conjunction with Drupal Commerce and experienced:
Notice: Undefined offset: 0 in _addressfield_render_address() (line 212 of ... addressfield.module).
Comment | File | Size | Author |
---|---|---|---|
addressfield-undefined-offset.patch | 912 bytes | FluxSauce |
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedI can't reproduce your issue, but judging by the error message and line affected, all I can figured is that somehow your site was calling addressfield_render_address() with an invalid $format array. There's no reason 0 should have been a child key that I can see. However, in order to prevent this error in the future, I've simply changed the in_array() check at the top of _addressfield_render_address() to use strict comparison mode. In that mode, 0 will never evaluate to TRUE for the given condition statement whereas it would match any of the strings otherwise.
Commit: http://drupalcode.org/project/addressfield.git/commitdiff/5fff558