Closed (fixed)
Project:
Ubercart Addresses
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
30 Nov 2012 at 09:41 UTC
Updated:
4 Jan 2014 at 02:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
megachrizI tried to reproduce the error. At first, nothing seem to be wrong and I nearly decided to ask you more about your setup. But then, after playing with the settings, and knowing from issue #1843562: Support checkbox "My billing information is the same as my delivery information." checked by default you probably have the "Use the same address" checkout setting enabled, I got the error too when I disabled an extra field that would only appear in the delivery pane.
I followed these steps:
In my case I only got the error once, and only for the disabled extra field. You say you got the error for every extra field. Are the steps you took in your setup similar to mine?
Comment #2
Neo13 commentedYes my setup is similar but I use extra fields just in billing pane and this pane is hidden by default with setting "Use the same address for billing and delivery by default." All fields are enabled.
Comment #3
megachrizI have found the bug. There are actually two bugs. And they are both in Ubercart Addresses. It has nothing to do with if the field is enabled or disabled.
When "My billing information is the same" is checked, Ubercart Addresses copies over values from the delivery pane to the billing pane. It's doing this by looping through all billing fields.
Bug 1: When determining the name of the delivery field, it just replaces "billing" with "delivery", so if your field is called
ucxf_billing_only- which will becomebilling_ucxf_billing_onlyat checkout - it tries to copy values over from a field calleddelivery_ucxf_delivery_only. This should have been delivery_ucxf_billing_only, it should not replace the second "billing" word with "delivery".Bug 2: It doesn't check if the field exists in the delivery pane and this results into the notice you get. Ubercart Addresses doesn't have a feature/setting to put fields in one pane only, but Extra Fields Pane has.
I'm working on a fix and move this over to the Ubercart Addresses issue queue.
Comment #4
megachrizI think this fixes the bug, but to prevent from the bug to reappear, it could use an automated test.
Comment #5
Neo13 commentedI tested provided patch and it seems to solve the problem. I did not notice any side effects. Thank you!
Comment #6
megachrizI see I made a mistake in this line:
+ $source_fieldname = 'delivery_' . $fieldname;'delivery' is hard-coded there, but if the billing pane comes first, then this won't work. Setting the status to "needs work" for me.Anyway, thanks for testing so far.
Comment #7
megachrizPhoe! I had to change a lot of code in order to write a test for this bug fix.
I finally made three commits:
Comment #8
Neo13 commentedGreat work MegaChriz!