When I'm at cart/checkout page, all required fields filled, and click send, I get a blank page with this message:
Fatal error: Uncaught exception 'UcAddressesInvalidFieldException' with message 'Invalid field name ' in /*/sites/all/modules/uc_addresses/class/UcAddressesSchemaAddress.class.php:244 Stack trace: #0 /*/sites/all/modules/uc_addresses/class/UcAddressesSchemaAddress.class.php(187): UcAddressesSchemaAddress::fieldMustExist(NULL) #1 /*/sites/all/modules/uc_addresses/class/UcAddressesAddress.class.php(263): UcAddressesSchemaAddress->setField(NULL, '') #2 /*/sites/all/modules/uc_extra_fields_pane/uc_extra_fields_pane.module(495): UcAddressesAddress->setField(NULL, '') #3 /*/sites/all/modules/ubercart/uc_order/uc_order.module(1474): uc_extra_fields_pane_order('load', Object(stdClass), NULL) #4 /*/sites/all/modules/ubercart/uc_order/uc_order.module(1199): uc_order_module_invoke('load', Objec in /*/sites/all/modules/uc_addresses/class/UcAddressesSchemaAddress.class.php on line 244
Thenafter when I refresh the page it's confirms the order as normal. What can possibly render this error message??
I have those modules installed:
Ubercart 6.x-2.9
Ubercart Addresses 6.x-2.x-dev (2012-05-18)
Ctools 6.x-1.8
Ubercart Extra Fields pane 6.x-2.0-beta2
Edit: It seems that adding "other addresses" (auto-created after an order was made?) than those two "default addresses" (bill and delivery) at the user/#/addresses page may cause this error? The auto-created "other addresses" conflict with the "default addresses"?
Comments
Comment #0.0
miccelito commentededit
Comment #0.1
miccelito commentededit
Comment #1
megachrizAt first glance, it seems that it's caused by a bug in Extra Fields Pane. Extra Fields Pane tries to set an empty, non existing address field, which Ubercart Addresses doesn't allow. Although I have tested Extra Fields Pane together with Ubercart Addresses heavily, I didn't encountered this bug yet.
I'll need more information about how to reproduce this bug. Can you provide the exact steps you took that resulted into this error (configuration/setup, logged in as user ...)? I'm best helped if you'd be able to reproduce the bug in a fresh installation. Valuable things to know:
Comment #2
miccelito commentedI did add (admin/store/settings/addressfields/add) three extra address fields with Extra Fields Pane, two assigned to Billing pane and one assigned to Delivery pane, all three as fieldtype Textfield, none of the three checked as required. All three listed at admin/store/settings/checkout/edit/fields page. Besides those I have not added any Custom order fields.
I did get the error both as user1 and as an authenticated user. Haven't tried as anonymous as I will not permit anonymous to send orders.
I did add only two addreses for user1 and 2 addresses for the authenticated user (test account). The fields that appear in Default billing address (where I entered text in two of the three extra fields) also appear in Default shipping address (where I entered text in one of the three extra fields)
Yes, using the values from current user's Address Book as default values.
No "field x is required" or other errors.
But meanwhile I'm writing this reply I'm thinking that maybe the mentioned error occurs cause I'm using the module Optional Checkout Review (6.x-1.x-dev) - which enables the possibility to skip the "Order review" page meaning that when clicking the "Submit Order" button the order is sent - and I see now at extra address fields edit, that the checkbox for Order review page (page where the order is reviewed by a customer before the order is submitted) was enabled at all three extra adress fields, it should be disabled I guess.
Edit: I tried to disable the Order review page checkbox, no difference, the error remains. Further, after getting the mentioned error above if I refresh the page I sometimes get the message notification: "An illegal choice has been detected. Please contact the site administrator." as well that the Adress book select fields at cart/checkout page get red marked (.error)
Edit2: Thinking further, the error may occurs when certain fields at cart/checkout page are left empty and those fields are included in ubercart/uc_order/templates/tpl.php files' lines without if/else statements?
Edit3: As you said although you have tested Extra Fields Pane together with Ubercart Addresses heavily and didn't encountered this bug yet. Til now I have also tested heavily... disabled other uc modules to find out if there are any conflict, also tried to change some lines in uc_order templates etc, finally tracked it down to think that Extra Fields Pane/UC Addresses conflict with Optional Checkout Review module (skips the Order review page).
Would be great if you would try to install/enable the UC Optional Checkout Review module/enable skip the Order review page checkbox at checkout settings, to verify if that is causing the error.
Comment #3
megachrizThanks for reporting back, I'll try to setup a site like yours as far as I know how it is setup now, but I may not have time to do that this week. I haven't tested the modules in a setup with one delivery only field and two billing only fields yet. The tests I have done was with delivery/billing fields of each type plus one delivery only and one billing only field.
When I have time to test, I shall install the Optional Checkout Review module. Meanwhile, you could test if the error is still there when you (temporary) disable that module.
Have I understand well that you get the error every time you click the button "Review order" on the checkout page when you start with a "fresh" checkout? Or does it also happen in this case:
1. Go to checkout.
2. Don't fill in a required field.
3. Click "Review order" button.
4. Receive error message about the required field.
5. Fill in a required field.
6. Click "Review order" button.
The checkbox for the Order review page is a setting you can use if you want to display the field on the order review page. It doesn't matter if the order review page is visited or not, but when it's visited, the module checks which fields it should display. The field's display settings are unlikely to be involved in the error you get.
That's interesting. I have seen this error once, early during the development of Ubercart Addresses 6.x-2.x (or was it the 7.x-1.x version?). I was not sure what caused that, but I hadn't seen it back again. It looks like you selected an address that changed between loading the checkout form and submitting the checkout form.
I don't think the invoice template (which I think you are referring to) are involved with this error, unless you do some address manipulation there. Also, the invoice is send after the order is submitted. Maybe you can verify if the order exists after you submit the checkout form and get the UcAddressesInvalidFieldException error, but don't submit the checkout form again? Choose to view all orders, the order may have the 'in_checkout' status. If it exists, one thing that could happen when you open that order, is that you receive the same error. If it keeps doing that, it may be easier to track down the issue.
I have tested the modules in combination in a fresh installation, but not much in combination with other Ubercart contributed modules (only with Ubercart Views).
Comment #4
miccelito commentedHello again, I appreciate your replies.
Regarding
Ubercart Addresses 6.x-2.0-alpha1+7-dev
Extra Fields Pane 6.x-2.0-beta2
vs
Optional Checkout Review 6.x-1.x-dev
Having the 'Skip checkout review' checkbox unchecked at Checkout settings, everything goes normal without no errors.
So I am pretty sure that the UC contributed module Optional Checkout Review (skip the Order review page) is causing the 'Uncaught exception UcAddressesInvalidFieldException' error. Since the mentioned error seems to happen only when having the 'Skip checkout review' checkbox enabled at Checkout settings. When this checkbox is unselected everything goes normal. I believe that it would be possible to solve the issue by adding some lines to either your UC Addresses module or to UC Optional Checkout Review module ('uc_optional_review_checkout.module' or/and 'uc_optional_review_checkout.js').
If I have the 'Skip checkout review' checkbox checked at Checkout settings (checkbox rendered by Optional Checkout Review module) the "Review order" button will not appear, but instead the "Submit order" button will appear in that place (since the purpose of UC Optional Checkout Review module is to get the possibility to skip the "Review order" step.
So, the error seems to happen only when click "Submit order" button at 'cart/checkout' page (when 'Skip checkout review' checkbox is enabled/checked as mentioned above). Error doesn't happen in the other cases you mention above.
Don't know if it has importance but I also have these UC contributed modules installed:
Ajax Attribute Calculations 6.x-2.x-dev
Ajax Driven Cart 6.x-2.1
Delivery Time slot 6.x-1.0-beta4
Donation Incentives 6.x-1.1
Pictured cart block 6.x-1.0-beta3
Terms and conditions 6.x-1.0
Ubercart Profile Integration 6.x-2.x-dev
Ubercart Rule Integration 6.x-1.0-rc1
Ubercart Webform Checkout Pane 6.x-3.8
Comment #5
megachrizGood news! I have been able to reproduce the problem and I have tracked down the bug.
It was a bug in Extra Fields Pane which had something to do with caching. When a value was saved for an extra field, the cached value lacked information about the fields machine name (db_name). The caching lasts one request only, so this wasn't a problem with the order review step in it, because a redirect take place, which forced a reload from the database. However, with the Optional Checkout Review module, the loading of the field's value happened right after it's saving, which resulted into loading the field's value from the cache, thus without the machine name.
This is now fixed for both Extra Fields Pane 6.x-2.x as 7.x-1.x by checking if the field value's machine name is empty when code asks for it. If it is empty, the machine name will be loaded from the field instead.
Commits:
6.x-2.x commit
7.x-1.x commit
Thanks for reporting and giving valuable information for tracking down this bug!
Comment #6
miccelito commented@MegaChriz
Mega great ;) Thanks for solving the issue so quickly. And I can confirm that it works now
Comment #7
miccelito commentedSorry to reopen this issue..
But I've just seen that the Uncaught exception 'UcAddressesInvalidFieldException' error message also appear when trying to access Order history - view, edit etc. I didn't see this before so I'm not sure if it's because I've changed anything else since then. Would be great if you get the possibility to verify if you get Uncaught exception 'UcAddressesInvalidFieldException' error message when clicking view, edit etc at Order history.
Comment #8
megachrizAre you using the latest 6.x-2.x-dev version now? The fix is not in the "stable" 6.x-2.0-beta2 release.
Does the error occur on all orders or only some of them? If some of them, what have these orders in common? For example, are they all after/before a specific date, do they have the same status, etc.?
Comment #9
miccelito commentedI'm using 6.x-2.0-beta2, as well I added the new lines according to your commit to class/UCXF_Value.class.php.
Error occuring on all orders at the moment.
Comment #10
megachrizIt probably will give the same result, but can you try again with the latest dev? I had one issue lately that took a long time to debug, and in the end it appeared a patch or a manual code change didn't completely made it.
There are no database updates in the latest dev.
Comment #11
miccelito commentedI'll try to update from 6.x-2.0-beta2 to latest dev. Will give you answer in a moment..
Edit: I've tested with latest dev now, the error is still there.
Comment #12
miccelito commentedMentioned I've tested with latest dev til now, but the error is still there. I've no clue what could possibly cause the error..
Comment #13
megachrizOk, I don't know what's the cause of the error at the moment. Can give me the complete error message, just like you did at the beginning of this issue? The stack trace can be really helpful to know where to start looking.
Other question: did viewing orders worked earlier with Extra Fields Pane 6.x-2.x and Ubercart Addresses 6.x-2.x installed, say between June 25 and now? If so, did you installed any other modules lately?
Comment #14
miccelito commentedI guess viewing orders worked earlier with Extra Fields Pane installed, since I didn't notice this error until now.. I'll take a look what new modules have been installed lately..
Comment #15
megachrizThanks for reporting back. I've been able to reproduce the bug! The bug occurs when enabling and disabling the Ubercart Addresses Example module.
This time I think it's a bug in Ubercart Addresses, but I need to take a closer look at it before I can work on a fix. A possible workaround for this issue is by uninstalling the Ubercart Addresses Example module.
Changing status to "needs work" for me.
Comment #16
miccelito commentedSome week ago I was enabling and few minutes after disabling the Ubercart Addresses Example submodule, as you say.
And I did now uninstall the Ubercart Addresses Example module, which solved the problem.
Comment #17
megachrizThe second bug is different from the first bug you reported (although they looked similar). As the first bug had been in Extra Fields Pane and the second bug is in Ubercart Addresses, I have opened a new issue in the Ubercart Addresses issue queue. Please continue there: #1678406: UcAddressesInvalidFieldException on order pages when enabling and disabling Ubercart Addresses Example module.
I'm setting this back to fixed.
Thanks for reporting!
Comment #18.0
(not verified) commentededit