2

I'm faced strange thing in Magento

Every time when loading any page (e.g. catalog, product, cms page) it puts the URL of this loaded page in search field.

Template is Madison Island standard rwd package. Nothing was changed in core.

What can be the cause for this bug? Does anybody else faced such thing?

thanks!

Screenshot

  • I've set up fresh Magento 1.9.1.1 Nginx, PHP-FPM, REDIS Cache, REDIS Sessions, MYSQL, All with sample data, and it is still put URL in Search Field. I have no idea why it is happening. i.imgur.com/glegZms.png – Sharif Jul 4 '15 at 16:17
  • One more Magento set up with Ultimo theme installed. The same thing.. It puts URL in search field (( I think that it is something related to Nginx's fastcgi_param – Sharif Jul 24 '15 at 14:53
2

So finally I was able to find the cause of this problem!

There was misconfiguration on server side, in vhost config if to be exact.

I used this in vhost.conf file

location / {
    try_files $uri $uri/ /index.php?q=$uri&$args;
}

So I removed

'$uri'

and it looks this now:

location / {
            try_files $uri $uri/ /index.php?$args;
}

and now there is no url in a search field. I hope this will help someone who may encounter this issue in future.

Thanks Fabian Blechshmidt for your attention and time

  • Upvoted..I faced the same situation, thx – Rinto George Aug 29 '17 at 12:27
1

Maybe it is the form reminder of whatever browser you use. Firefox and Mozilla are saving the state of a form when you reload a page. Check the HTML code of the loaded page if the url is in the value of the <input>

If this is not the case, you can put a breakpoint on the input and break, when the input is changed.

If this is both not the case, something inside your browser happens

  • Hi Fabian, thank you for your answer. Template File shows I've digged deeper and found out that value field in standard rwd template file form.mini.phtml has this <? php echo $catalogSearchHelper->getEscapedQueryText() ?>. Some googling shown me that it could be server configuration issue. As I'm using nginx+php5-fpm stack. vhost section for this website has following: fastcgi_param QUERY_STRING $query_string; I'm not sure, but seems like $this->helper('catalogsearch'); picks that query and put in in value field. – Sharif Jun 7 '15 at 16:32
  • I think you are running in the wrong direction (but I'm no expert on this!). Query string is everything after ? in the URL, sometimes it gets rewritten via .htaccess file or something like this. To submit it from your nginx to php you have to configure it (this is what you found in the config I think). $catalogSearchHelper->getEscapedQueryText() should do nothing else, than writing the searched word again in the box. – Fabian Blechschmidt Jun 7 '15 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.