Zen Cart Logo
Forums / General Questions / Potential additional redirect by submit empty required text field?

Potential additional redirect by submit empty required text field?

Views: 367

Results 1 to 3 of 3
16 Nov 2017, 6:13 AM
#1
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Potential additional redirect by submit empty required text field?

Considering what I'm seeing I'm doubting that I am using a correct copy of ZC 1.5.5e.

Using a demo product database, products_id=48, added a text field (Line 1) through attributes controller. Made the text field required.

Store is set to not go to the shopping cart after adding a product.

Didn't enter any text into the text box. Left the cart quantity as 1. Selected add-to-cart. Page "refreshed", error message appeared at the top, waited a little bit and then the page content redirected/reloaded to the category listing, but the url remained the same: index.php?main_page=product_info&products_id=48&number_of_uploads=0&action=add_product. Attempted any other "error" producing add-to-cart action (not changing from the display only attribute, negative quantity of product and the system responds correctly, but empty required text box doesn't seem to respond correctly. Anyone else able to confirm such a simple operation/action?

Found this when testing out some features I was adding to Dynamic Product Updater associated with text fields. I wanted to see how the price changed and/or system responded when attempting to add a product to the cart that had a required text field without information entered and came up with the above. Put a damper on my remaining testing because I am/have been using at least one of the functions that cause the error message to display and would hope that it remains sound and that it is simply something else that is causing the odd redirect behavior.

Thanks.

16 Nov 2017, 12:49 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Potential additional redirect by submit empty required text field?

Just tried on a store with the demo products loaded. Added a text box to one of the mice, went to its product_info page with quantity 1 and didn't fill in the "required" text line. Warning message displayed on the product_info page, no redirect.

Ditto when playing with the product_music_info page. Message appeared on the page without redirect.

Perhaps the redirection is happening within the DPU itself?

16 Nov 2017, 2:22 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Potential additional redirect by submit empty required text field?

lat9:

Just tried on a store with the demo products loaded. Added a text box to one of the mice, went to its product_info page with quantity 1 and didn't fill in the "required" text line. Warning message displayed on the product_info page, no redirect.

Ditto when playing with the product_music_info page. Message appeared on the page without redirect.

Perhaps the redirection is happening within the DPU itself?
Thanks for that test.

Some additional information possibly pointing towards something MY_TEMPLATE related.

Was using responsive_classic though not claiming that there is an issue directly related to it as I have used it for testing some other things. When I switched to classic there was no issue immediately visible until I began editing the text field.

A better testing product when using the demo product is either:
index.php?main_page=product_info&products_id=131
Or
index.php?main_page=product_info&products_id=134

Where the product already has required text.

Thing is that yes, DPU in generating the url to be passed for processing through ajax.php included the action parameter. While I didn't make the connection that this would be translated to a redirect/get, by omitting the action parameter when collecting the parameters, the issue was resolved.

So yes, it had to do with DPU and how it has been incorrectly modified to provide parameter information for users concerned with seeing who's online information related to ajax calls. In part I still think there should be some sort of "off-switch" for operation/data collection of where a visitor is "at" when using ajax.php, but I have concerns about doing that as well because there can be useful information collected that way.