Unlike other exposed filters, the search filter uses an object (which extends core's searchQuery object) to process results. If the search filter is used with views bulk operations, the result is this show stoping error:
PDOException: You cannot serialize or unserialize PDO instances in DrupalDatabaseCache->set() (line 418 of /includes/cache.inc).
This small patch resolves the issue by removing the object from the filter class after it's been used.

Comments

dawehner’s picture

Status: Needs review » Needs work
+++ views/modules/search/views_handler_filter_search.incundefined
@@ -163,6 +163,8 @@ class views_handler_filter_search extends views_handler_filter {
+    // search_query object breaks Views Bulk Operations form cache

A reference to vbo is probably wrong here at that place, but general views form caching breaks as well.

+++ views/modules/search/views_handler_filter_search.incundefined
@@ -163,6 +163,8 @@ class views_handler_filter_search extends views_handler_filter {
+    $this->search_query = null;   ¶

Just for codestyle setting to NULL would be perhaps better

Nick Lewis’s picture

Status: Needs work » Needs review
StatusFileSize
new646 bytes

Sure, changed to NULL, comment updated to " Set to NULL to prevent PDO exception when views object is cached."

dawehner’s picture

Status: Needs review » Fixed

Thanks!

Committed to 7.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

myhemant’s picture

Hi,

Modify the file modules/views/modules/search/views_handler_filter_search.inc at line 93

   function exposed_validate(&$form, &$form_state) {
...
 if (!empty($form_state['values'][$key])) {
		++ if(strlen($form_state['values'][$key]) > 2){
			$this->query_parse_search_expression($form_state['values'][$key]);
			if (count($this->search_query->words()) == 0) {
				form_set_error($key, format_plural(variable_get('minimum_word_size', 3), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
			}
		++ }else{
			form_set_error($key, format_plural(variable_get('minimum_word_size', 3), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
	++	}
			
    }

This is working fine for.

Thanks
Hemant