Hello,

thank you for this nice module. I have just built a website where I use this module extensively and it works very well!

There is only one problem:
the search button does not work anymore after a user did a search and then clicks the browsers "back" -button. It just is not clickable anymore and the page has to be reloaded.

The problem occured in all browsers I was testing so far. Going back with "Start new search" or "Modify search" -buttons instead of the browsers "back" -button works.

Any ideas how to solve this?

Lorenz

Comments

haagendazs’s picture

Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Assigned: Unassigned » haagendazs
Status: Active » Needs review

Hi Lorenz: This was actually a feature implementation. On one of our sites, we had users clicking the "Search" button many times before the search results page loaded, so I implemented a JavaScript solution that prevents users from clicking the search button more than once.

You're right though: When you click the browser back button, the search button doesn't work anymore. I implemented a fix and committed it to the dev version (http://drupal.org/node/989178). Could you test this issue with the dev version and let me know if that fixes the issue?

lorenz’s picture

Thank you for the quick reply! I will try the new version and let you know.

lorenz’s picture

A question about the best practice to update to the dev version: can I simply replace the old code base with the new one or do I have to disable the version currently installed, replace the files with the new version and enable it again? What will happen to my settings in this case? Will they be lost?

haagendazs’s picture

There aren't currently any database differences between the 6.x-1.0-beta1 and 6.x-1.x-dev version except for display differences, so you shouldn't be loosing your settings. You can just replace the old code with the new one from the dev version.

To be on the safe side, it's probably better if you do this on a local install of your site and not the production version. Alternatively, if you don't have a local environment, just backup your database on production.

If you can verify that this change works, I'll create an official release (either 6.x-1.x-beta2 or just 6.x-1.x).

lorenz’s picture

Hallo,

I replaced the old code with the new code and everything works well!

This is the site in case you want to see your module in action (German only):
http://ausbildungsatlas.gfbm.de

I commented something out in line 67, file: includes/views_search.form_view_attachment.inc

'#value' => t('Start a new '), // . $form_state['storage']['view_info']['title'],

Because of this the value of the button was not nice, something like "Start a newContentType".

Besides this small inconvenience everything works perfectly! Thanks again.

One thing you may add to your feature list:
There is currently no way to add a text when the view delivers no results, like "0 results for your search".
I could add this text in the "empty text" section of the view but it will be displayed even before somebody hits the search button which does not make sense.

Best regards.

haagendazs’s picture

Status: Needs review » Closed (fixed)

Lorenz: Thanks a lot for testing this. I'll mark this issue as fixed.

Commenting out the line to prevent the search to say "Start a new ..." works, you can alternatively use hook_form_alter to override the text from your own module. This would allow you to use the module without modifying it every time an updated version gets released.

In regards to the title: I think you're overwriting this somewhere in your site already. By default, Views Search changes the page title to display the number of search results (e.g. "23 search results"). In your site, you can see this in the page title in the browser (that displays the text I just mentioned, and it also displays "0 Treffer" for no results). Somewhere in your code, you defined the page title to always say "Ausbildungen finden - Detailsuche".

jvieille’s picture

I have a similar issue, but not related directly to the back button.
Sometimes, the search button does not react at all. One need to reload the views page to get it work.
It seems to generally work on the first try, but works randomly after hitting "edit search" from a previous search.
Any idea?
Thanks