I have a searchable view created that returns the following error when I click to "reset" the search query. It only occurs when resetting a search from the search terms field.

An AJAX HTTP error occurred. HTTP Result Code: 500.

The logs show the following:

PDOException: You cannot serialize or unserialize PDO instances in DrupalDatabaseCache->set() (line 455 of /code/includes/cache.inc).

This error occurs in the preview, not on the live page.

  • Perhaps this will help: drupal.org/node/1372376#comment-8459391 Mar 29, 2016 at 15:18
  • Thanks @j-reynolds but, unfortunately, that didn't do the trick. The error still occurs.
    – RarelyRed
    Mar 29, 2016 at 16:10
  • View on its own does not do this so it must be a contrib module that is to fault. If you find the offending module like @Clive suggests then post a bug report. Mar 30, 2016 at 4:24

1 Answer 1


Something is trying to serialise a PDO object, which you can't do in PHP (unless you're running < 5.3 and are happy with nasty workarounds).

Drupal core doesn't do this; The Views module itself doesn't do this; so you'll need to disable custom/contributed modules you have installed one by one until you find the culprit. If/when you do, either fix the module if custom, or report the bug to the module's issue queue on Drupal.org for review.

If you're making use of the PHP filter in that View, remove the PHP code temporarily to see if that's the problem. If it is, consider re-implementing that logic in a more stable manner, i.e. using the hooks from the Views module.

  • Thanks again @clive but, unfortunately, none of your suggestions fixed the issue. I'll keep hunting.
    – RarelyRed
    Mar 29, 2016 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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