Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Possible Bug: All searches fail the first time


osc_man

Recommended Posts

I seem to have found a bug in my OSC installation and I was hoping for some help. It's MS2, running with php4 on red hat enterprise linux.

 

When I first open my browser, browse to my website, and enter a search, I am taken to advanced_search.php with the error

 

"At least one of the fields in the search form must be entered."

 

This happens if I try my first search at index.php or at advanced_search.php

 

If I try and search again, from either page, my search works fine. My searches will continue to work fine until I close my browser. When I open my browser again, I get the same error.

 

I made some modifications so I could watch the GET array being passed

 

print_r($HTTP_GET_VARS);
die();

 

and have verified I have an empty array being sent on a freshly opened browser, but a properly filled array on my second search.

 

To help isolate the problem I have saved two html pages on my desktop. One of them is from a freshly opened browser, and the search fails first time when I load that html file into my browser. The second one was of the same page but after the first search failed. When I open the second html page, the first search works every time.

 

Running diff on the two files I see that the only change is that the osCsid is included in the form

 

<input type="hidden" name="osCsid" value="d5d67e147949d7c2a79d6ae445bd6105">

 

There's actually two of them. One of them is added by tep_href_link in includes/functions/html_output.php and the other is part of the infobox (and I haven't found where yet).

 

If I take those out, the search works. Any explaination why the GET array is empty if the hidden form data is in there? Any idea how I can fix this?

Link to comment
Share on other sites

Anybody? Anyone seen this before? Anyone know why this would happen?

sounds like the quick search form does not send the session on submit. It may work the 2nd time because the cookie maintains the session.

Link to comment
Share on other sites

sounds like the quick search form does not send the session on submit. It may work the 2nd time because the cookie maintains the session.

 

It appears that nothing is passed through GET, and this problem appears both on the quick search and on the advanced search.

 

Well, the site is http://www.artsmart-online.com if you're interested, and I'll gladly give $25 off any poster order to anyone who finds a solution to this bug.

 

You can see the content of http_get_vars by using http://www.artsmart-online.com/shopping/ind.php and doing a search there.

Link to comment
Share on other sites

What about some sort of instant refresh?

 

I just tried it with a JS, worked fine on the index page but went into a manic loop on the category page.

 

Or you could use a splash page.

Link to comment
Share on other sites

I do not see a problem. Results are returned normally. Try deleting existing cookies from your browser and the clear its cache

Link to comment
Share on other sites

I do not see a problem. Results are returned normally. Try deleting existing cookies from your browser and the clear its cache

 

After reading that I also tried your search. Worked perfect first time for me too.

Link to comment
Share on other sites

Thanks for your feedback!

 

I don't want an instant refresh, I want to figure out why the basic design of OSC seems to fail. This shouldn't be something unique to my website (although it may be some weird configuration combination that causes it).

 

Deleting the cookies demonstrates another interesting facet of this problem that I've seen before (but have never been able to stimulate directly). If I delete the cookies, I can get the search to work the first time, but only once.

 

open fresh browser

go to website and search -> fails

go to website again and search -> succeeds

close browser

Open fresh browser

clear cookies

close browser

open fresh browser

go to website and search -> succeeds

close browser

open fresh browser

go to website and search -> fails

go to website again and search -> succeeds

close browser

open fresh browser

go to website and search -> fails

go to website again and search -> succeeds

 

I did a video capture from a virtual machine that I've been using for testing. I demonstrated the above procedure. You can view the video here (3.4 mb). Please ignore my inability to type the word "anything" correctly. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...