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).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pnigro’s picture

Status: Active » Needs review
FileSize
736 bytes

The 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.

torgosPizza’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Solves the issue for me. Please consider committing this.

andyg5000’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1017 bytes

We 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 :)

jantoine’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #3 is makes sense and works. Markings as RTBC.

bpopp’s picture

Patch in #3 worked for me, too. Would love to see it committed :)

skribbz14’s picture

Patch #3 worked for me too. Thanks!

doostinharrell’s picture

Thanks Andy. Worked like a champ!

  • andyg5000 committed fc908b6 on 7.x-2.x
    Issue #2426597 by pnigro, andyg5000: Add required parameters to...
andyg5000’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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