addressfield 7.x-1.0 requires calling addressfield_default_values() with different parameters:

Warning : Missing argument 1 for addressfield_default_values(), called in XXX/commerce_paypal/modules/ec/commerce_paypal_ec.module on line 1386 and defined in addressfield_default_values() (line 375 in XXX/addressfield/addressfield.module).
Warning : Missing argument 2 for addressfield_default_values(), called in XXX/commerce_paypal/modules/ec/commerce_paypal_ec.module on line 1386 and defined in addressfield_default_values() (line 375 in XXX/addressfield/addressfield.module).
Notice : Undefined variable: field in addressfield_default_values() (line 376 in XXX/addressfield/addressfield.module).
Notice : Undefined variable: instance in addressfield_default_values() (line 376 in XXX/addressfield/addressfield.module).
Notice : Undefined variable: instance in addressfield_default_values() (line 377 in XXX/addressfield/addressfield.module).
Notice : Undefined variable: field in addressfield_default_values() (line 403 in XXX/addressfield/addressfield.module).
Notice : Undefined variable: instance in addressfield_default_values() (line 404 in XXX/addressfield/addressfield.module).

I'm marking this as related to PayPal EC but I see an equivalent bug in commerce_paypal_wps.module.

See related issues for similar problems with other modules that call this function.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mvc’s picture

Status: Active » Needs review
FileSize
1.85 KB

Patch that works for me with commerce_paypal 7.x-2.3 and addressfield 7.x-1.0, using PayPal EC. I didn't test with PayPal WPS but it will probably work for that too.

ytsurk’s picture

looks good to me (all issues use same approach) and works :D

thx

howdytom’s picture

#1 worked like a charm on
commerce_paypal_ec.module and commerce_paypal_wps.module

Thank you!

mvc’s picture

ytsurk, howdytom: if this patch seems correct & works for you please change the status to "reviewed & tested by the community" so that the maintainer knows it's ready to be commited. etiquette here on drupal.org requires that i not do this myself :)

howdytom’s picture

Status: Needs review » Reviewed & tested by the community
JustDrup’s picture

It worked for me too. I used it for PayPal EC.
thank you very much

if this patch seems correct & works for you please change the status to "reviewed & tested by the community"

I dont´t know how do it.

mvc’s picture

JustDrup: you just change the "status" field right below this comment :) but don't worry, you can see that the current status was already changed.

documentation for the issue submission/edit form is here: https://www.drupal.org/node/314328
a description of issue queue statuses is here: https://www.drupal.org/issue-queue/status

ProjetWeb’s picture

I have the same probleme, but i am not familiar with git... How can i patch directly in commerce_paypal_ec.module?

Thank you in advance for your help

mvc’s picture

@ProjetWeb : documentation for working with patches is available at https://www.drupal.org/patch and instructions for applying patches are at https://www.drupal.org/patch/apply

since this patch is small, you could also do it by hand. look at https://www.drupal.org/files/issues/commerce_paypal-addressfield-default... and remove the lines starting with - and add the lines starting with +

jantoine’s picture

@mvc,

Thanks for the patch! Confirmed this fixes the address errors for both billing and shipping with Express Checkout.

onejam’s picture

I confirm the patch fixed the issue as well, thanks.

a.milkovsky’s picture

+1 for patch #1. works for me. Is it planned to be committed?

Sam Moore’s picture

Confirmed patch in #1 works for me.

chrisolof’s picture

Patch in #1 appears to work and errors are gone.

torgosPizza’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +commerce-sprint
FileSize
1.97 KB

Patch no longer applies to -dev, so here is a re-roll.

fizk’s picture

Status: Needs review » Reviewed & tested by the community

This needs to be committed. The patch is already being used by Commerce Kickstart.

@rszrama It seems odd that the patch was included in Commerce Kickstart instead of being committed... Is there anything to that?

mglaman’s picture

fizk, I currently maintain CK2 and there was a patch to include this patch. Most often profiles do this. We'd have included that patch anways until a release was made.

fizk’s picture

@mglaman Thanks, but why not just commit this patch into commerce_paypal, since rszrama, maintainer of this project, is part of Commerce Guys and also commits to Commerce Kickstart?

torgosPizza’s picture

Yeah I don't really see a reason not to apply this to -dev. It's pretty well tested, and a minor change to bring the module into line with current requirements of Addressfield. I don't use CK - Ryan and Josh had actually advised against that after we had already started our RiffTrax D6->7 Upgrade, resulting in a restart and lots of lost time - so I would highly highly recommend committing this to 7.x-2.x-dev.

  • rszrama committed 5f12628 on 7.x-2.x authored by torgosPizza
    Issue #2458721 by mvc, torgosPizza: add missing arguments to calls to...
rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone! Sorry it took a while, but I've just committed this. It's available in -dev and will be in the next release.

Status: Fixed » Closed (fixed)

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

Stone Liu’s picture

Thanks for the patch and there is an imperfection to it:

If the order's shipping address is different to the billing address this patch simply collects the shipping address at the EC transaction page as "billing information", resulting in one has to change it back to the correct billing info manually.

Wondering someone run into this as well? This patch solve the error message well but caused additional correcting/filling work on the part of shoppers. It will be perfect if this could be fixed as well. :)

Neil C Smith’s picture

Any chance of a release with this fix in it any time soon? I don't like running dev versions on client sites whenever possible.

Anyone else think drupal.org needs an issue status that is "pending release" ?! ;-)

rollingnet’s picture

I totally agree with #25: since this patch solves the issue, it should be submitted ASAP