PDA

View Full Version : Search form does not respect the last data by GET method



Sam.K
September 8, 2018, 08:46 PM
The bug exists also on the demo site.

How to reproduce the bug:

1- Go to Admin Panel > Listing Types > Edit Type "Classifieds" (https://classifieds.demoflynax.com/admin/index.php?controller=listing_types&action=edit&key=listings)
There make sure that you chose "GET" method for: Search Settings > Submit method

2- Now try to seach something via the search form here: https://classifieds.demoflynax.com/classifieds.html
for example: choose category "Books"

3- You will see the result and the search form next to it with no pre-selected category "Books"!
Here also if you seach again for category "Books", the result page shows the search form without pre-selecting the category you have chosen before.


Simply the Search Form cannot handle the default form data with method GET. (with method POST, it works)


Could you please let me know how to solve it? It is a serious bug for us.

Thank you so much for your support.

Rudi
September 11, 2018, 08:08 AM
Hello,

I've created a task regarding your post
we'll implement a solution in the next updates

Thank you

Viktor
September 11, 2018, 09:10 AM
Hello Sam,

If you want to solve it now on your site you can do it yourself.
Open file: ftp://templates>>your_template>>tpl>>blocks>>fields_search_box.tpl

find code:


{if $listing_type.Submit_method == 'post'}
{assign var='fVal' value=$smarty.post}
{else}
{assign var='fVal' value=$smarty.get}
{/if}



and replace to:


{if $listing_type.Submit_method == 'post'}
{assign var='fVal' value=$smarty.post}
{else}
{assign var='fVal' value=$smarty.get.f}
{/if}


save and check again.

Sam.K
September 11, 2018, 09:28 AM
Hello Sam,

If you want to solve it now on your site you can do it yourself.
Open file: ftp://templates>>your_template>>tpl>>blocks>>fields_search_box.tpl

find code:


{if $listing_type.Submit_method == 'post'}
{assign var='fVal' value=$smarty.post}
{else}
{assign var='fVal' value=$smarty.get}
{/if}



and replace to:


{if $listing_type.Submit_method == 'post'}
{assign var='fVal' value=$smarty.post}
{else}
{assign var='fVal' value=$smarty.get.f}
{/if}


save and check again.

Hi Viktor

That has solved the issue. Thank you for your quick solution.

By the way, I do not know why the Search Box on homepage is always set to POST. Could it be something related to this issue?

Viktor
September 12, 2018, 05:15 AM
Hi Sam,

You absolutely right, we created a task with the problem too. It will be solved in the next version. https://prnt.sc/kte4qc

Sam.K
September 12, 2018, 08:41 AM
Hi Sam,

You absolutely right, we created a task with the problem too. It will be solved in the next version. https://prnt.sc/kte4qc

If I want a quick fix, is it okay if I just change the method to GET in "home_content.tpl"? From my side, t seems it is working. But I am not sure about more consequences.


<form accesskey="{pageUrl key='search'}#keyword_tab" method="get" action="{if $cdt_count == 0}{pageUrl key='search'}{else}{$rlBase}{if $config.mod_rewrite}{$spage_path}/{$search_results_url}.html{else}?page={$spage_path }&{$search_results_url}{/if}{/if}">

Wei Hong
September 12, 2018, 09:18 AM
What is the benefit of using GET instead of POST?

Sam.K
September 13, 2018, 07:36 AM
What is the benefit of using GET instead of POST?

For example, with GET you can make some specifically useful links for users to navigate faster. As an example you can make such links "Bikes in Washington", "Apartments with 2 bed rooms", etc.

Wei Hong
September 13, 2018, 07:46 AM
For example, with GET you can make some specifically useful links for users to navigate faster. As an example you can make such links "Bikes in Washington", "Apartments with 2 bed rooms", etc.

I see, thank you for your explanation.

Bahram Soltanirad
November 6, 2018, 05:59 AM
Hi Sam,

You absolutely right, we created a task with the problem too. It will be solved in the next version. https://prnt.sc/kte4qc

Hello Viktor, why does the problem still exist in new version?!

Viktor
November 6, 2018, 09:13 AM
Hello Bahram,

I have found the task and it is still there. Our dev team did not have time to do it. I have moved up the priority of the task.

Bahram Soltanirad
November 6, 2018, 10:55 AM
Thank you Viktor.