Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
After I updated my addressfield module to the latest to 7.x-1.0-rc1, it gives me an error when ajax does a refresh of the shipping services pane.
Notice: Undefined index: addressfield in commerce_shipping_recalculate_services_submit() (line 264 of /Applications/MAMP/htdocs/shiyr-poets/sites/all/modules/_store/commerce_shipping/includes/commerce_shipping.checkout_pane.inc).
Comments
Comment #1
akosipax CreditAttribution: akosipax commentedComment #2
akosipax CreditAttribution: akosipax commentedComment #3
IckZ CreditAttribution: IckZ commentedworks for me! akosipax++
Comment #4
akosipax CreditAttribution: akosipax commentedBy the way, this still exists in the latest Addressfield (1.0)
Comment #5
derjochenmeyer CreditAttribution: derjochenmeyer commentedI don't know if changing the project is the right way to get an Address-Field-maintainers attention.
Adding
isset()
works, but maybe we need another fix here?Comment #6
bojanz CreditAttribution: bojanz commentedThere is no more $form_state['addressfield'] with latest addressfield, this code will need to change significantly.
Comment #7
revagomes CreditAttribution: revagomes commentedI agree we need a better solution in long term. Although the path #1 works fine for now.
I would just rename the patch to have the module's name as prefix. e.g. commerce_shipping-addressfield_undefined_index-2410911-1.patch
@see https://www.drupal.org/node/1054616#naming-conventions
Comment #8
mglamanTaking a stab at this to fix error in CK2
Comment #9
mglamanFollowing the logic in the widget form, this patch should be the fix.
Comment #10
mglamanWhoops :) last patch was missing array key for field name. This patch fixes that, and ensures Country remains so there isn't a new error.
Comment #11
googletorp CreditAttribution: googletorp commentedIt's fine to remove support for addressfield beta
The code for 1.0 only works for commerce_customer_address, it should work for any addressfield.
Comment #12
wgsimon CreditAttribution: wgsimon as a volunteer commentedI've just uploaded a new patch. This is the first patch I've submitted. I hope I've done it correctly.
Comment #13
wgsimon CreditAttribution: wgsimon as a volunteer commentedDuplicate of #2633958: AJAX error on shipping calculation when profile copy checkbox is used.
Comment #14
wgsimon CreditAttribution: wgsimon as a volunteer commentedSecond try. Needed to check the field exists.
Comment #16
googletorp CreditAttribution: googletorp commentedCommitted and pushed
Comment #18
wgsimon CreditAttribution: wgsimon as a volunteer commentedThe patch in #14 causes further errors.
When the 'Shipping information', 'Billing information' (with profile copying) and the 'Shipping service' are all on the checkout pane the following errors appear in the 'Billing information' when the 'Continue to next step' button is clicked:
Address 1 field is required.
Postal code field is required.
City field is required.
Full name field is required.
Why do we need to try and remove the cached data at all?
Comment #19
a.milkovsky@wgsimon please check the #2453499-18: When 'copying' featured is enabled, PHP notice appears which affects recalculation of shipping services for the "..field is required" errors and tell if it fixes the issue for you.
Comment #20
quantos CreditAttribution: quantos commentedFollowing. Got the same issue for the same reasons. Just found them after updating from Address Field 7.x-1.0-beta5 to Address Field 7.x-1.2. Reverting to the previous Address Field 7.x-1.0-beta5 removes the error (just in case that's not obvious to anyone just looking into this). Thanks. Q.
Comment #21
wgsimon CreditAttribution: wgsimon as a volunteer commentedThe patch in #2453499-18 fixes this issue for me as well. Thanks!
Comment #22
ludovic.agathe CreditAttribution: ludovic.agathe as a volunteer commentedFaced the same issue with:
commerce 7.x-1.3
addressfield 7.x-1.2
shipping 7.x-2.2
Ended up checking if the addressfield form variable was set in an if() statement. Not sure if this is the right approach but, so far, it fixed the issue for me.
Attached is the patch for the commerce_shipping.checkout_pane.inc file, in commerce_shipping > includes folder.
Comment #23
jasom CreditAttribution: jasom commented#22 seems working, error disappeared.
Comment #24
botrisConfirming #22 to fix the problem.
Comment #25
andyg5000Hunting this down, but at a minimum, this needs a re-roll against -dev
Comment #26
andyg5000The site I was working on had a real old address field release. Updating it resolved the issues that brought me here. @bortis & @jasom, if you're still having the issue can you open a new issue and reference this one since it's been closed out?
Comment #27
andyg5000... Also make sure you're using the -dev release of commerce_shipping! :P
Comment #29
darrenwh CreditAttribution: darrenwh as a volunteer and at Investis Digital commentedI'm still having issues with this https://www.drupal.org/node/2928534