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.
After updating to addressfield-7.x-1.0, the following errors appear when calculating USPS shipping rates:
Warning: Missing argument 1 for addressfield_default_values(), called in C:\xampp\htdocs\live\sites\all\modules\commerce_usps\commerce_usps.module on line 263 and defined in addressfield_default_values() (line 375 of C:\xampp\htdocs\live\sites\all\modules\addressfield\addressfield.module).
Notice: Undefined variable: field in addressfield_default_values() (line 376 of C:\xampp\htdocs\live\sites\all\modules\addressfield\addressfield.module).
Notice: Undefined variable: instance in addressfield_default_values() (line 376 of C:\xampp\htdocs\live\sites\all\modules\addressfield\addressfield.module).
Comment | File | Size | Author |
---|---|---|---|
#3 | commerce_usps-remove_call_to_addressfield_default_values-2426597-3.patch | 1017 bytes | andyg5000 |
#1 | commerce_usps-update-addressfield-default-parameters-2426597-1.patch | 736 bytes | pnigro |
Comments
Comment #1
pnigro CreditAttribution: pnigro commentedThe addressfield_default_values function was changed in addressfield-7.x-1.0. We need to pass in $field and $instance parameters. Attached is a patch based on a solution by bojanz - https://www.drupal.org/node/2411313#comment-9537509.
Comment #2
torgosPizzaSolves the issue for me. Please consider committing this.
Comment #3
andyg5000We should really just get rid of that all together since we have a validation method and we can't request rates without and address. If you all can review this, I'll commit it :)
Comment #4
jantoine CreditAttribution: jantoine commentedPatch in #3 is makes sense and works. Markings as RTBC.
Comment #5
bpopp CreditAttribution: bpopp commentedPatch in #3 worked for me, too. Would love to see it committed :)
Comment #6
skribbz14 CreditAttribution: skribbz14 commentedPatch #3 worked for me too. Thanks!
Comment #7
doostinharrell CreditAttribution: doostinharrell commentedThanks Andy. Worked like a champ!
Comment #9
andyg5000