Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hallo. I have used the option "Update product display based on customer selections" and every time i change an attribute option, the updated price appears. So far so good.
After the products are added to cart, we proceed to checkout. Then, if we decide to press the back button in the browser, when we try to change an attribute, an error dialog comes up stating an ajax error.
In the logging details, a message appears stating "Invalid form POST data." Any ideas?
Comments
Comment #1
TR CreditAttribution: TR commentedI'm confused - what page are you on? When you press Back from the checkout page you should go back to the cart page. You can't change attributes on the cart page ...
Comment #2
Jonesgr CreditAttribution: Jonesgr commentedSorry for not being clear in the first post. I have configured ubercart to redirect immediately to cart/checkout page after pressing add to cart. Attribute selection is realized normally in the product screen where we select the quantity and the attributes. After the first selection, we press "add to cart" button and go to checkout. After that, if we press the back button on the browser, and we return to the product screen to select the attributes again, the problem stated before occurs. Thanks.
Comment #3
longwaveThis affects all Ajax enabled forms in Drupal, including those in Views and Commerce:
#1786904: Deep link filter settings & Reload results from AJAX submit when using the browser's back button
#1621210: Add to cart form submit + redirect + user presses back button = broken ajax on cart form
Comment #4
Jonesgr CreditAttribution: Jonesgr commentedJust a simple solution I can think of, would be to auto refresh the page, when visited. This can be done by using drupal_add_http_header and the correct meta tags. I will give it a try.
Comment #5
ajlozier CreditAttribution: ajlozier commentedFor those who are using Safari and have found that no-cache headers and the onunload attribute still seem to not resolve the problem, I would encourage you to check out this blog post I just wrote:
http://www.informationarchitech.com/blog/safari-auto-complete-bug-affect...
What I eventually figured out was that Safari was "restoring" the previous form_build_id (even if the page was NOT loaded from cache) which in turn was triggering the ajax error (re-use of a "one time use" token)
Hopefully this will save others the hours of struggle I went through to figure it out!
I am also reposting this comment on a few other issue reports which seem similar.