when I'm logged in and search for anything I get "Validation error, please try again. If this error persists, please contact the site administrator." error

When I log out the search works like a dream... any thoughts?

Comments

cghobbs’s picture

rdsmith’s picture

PHP is integration with all!!
javascript, JAP, ASP, etc. etc.!!

Rasmus Cymini Sectores. Nunc Lento Sonitu Dicunt, Morieris

Mine is a custom template job on Drupal 5.1 so I'm not sure if this may aid in your efforts but here is my story..

Everytime I submit a search through my themes search forms I get..

"Validation error, please try again. If this error persists, please contact the site administrator."

I had previously hard coded this search field and obviously something changed in the search that effects my custom search form.
This is when I'm logged in as a user, When I log out, the search is fine.

Here is my old search code :

 <div id="searchmodule">		  
<form id="search" name="search" action="http://www.urbanministry.org/content/search/node" method="post" id="search-block-form">
<!-- <img src="http://www.urbanministry.org/imgs/searchbar_label.gif" alt="search" width="43" height="11" /> --><br />
	<input type="text" maxlength="128" name="search_block_form_keys" id="edit-search-block-form-keys"  size="15" value="" title="Enter the terms you wish to search for." class="form-text" />	<input type="hidden" name="user" value="techmi5"><input type="hidden" name="basehref" value="http://urbanministry.org">
	<input type="submit" name="op" id="edit-submit" value="Search"  class="form-submit" />
<!-- <input type="hidden" name="form_token" id="edit-search-block-form-form-token" value="4ed4429dc5b595bf691afad2d5bb7a8c"  /> original -->
<input type="hidden" name="form_token" id="edit-search-block-form-form-token" value=""  /> 
<input type="hidden" name="form_id" id="edit-search-block-form" value="search_block_form"  />
</form>		
</div>

I changed the reference from...

<input type="hidden" name="form_token" id="edit-search-block-form-form-token" value="" />

to

<input type="hidden" name="form_token" id="edit-search-block-form-form-token" value="<?php print drupal_get_token('search_theme_form'); ?>" />

Then the search started to work when both logged in and not logged in..

The cause of your problem might be that token is being created in your system but not validated by your drupal system.

RDS

Christopher Herberte’s picture

Probably unrelated.
I got this after upgrading the views module and not running update.php
http://www.xweb.com.au

mlncn’s picture

With a form_alter function to unset the token in a custom module; worked for us.

http://agaricdesign.com/note/validation-error-search-form-contact-site-a...

benjamin, Agaric Design Collective

benjamin, Agaric