I have an error on a Drupal 7 site that I cannot solve.

Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2168 of ...

I cannot use dpm, can't find a way to debug, and can't see what is the data that causes the problem.

Anyone would know how I could debug this? really appreciated


Webchick's Quick-and-dirty debugging is so useful in this type of situation that I've sometimes had a projects with it as a ready to apply patch.

Find drupal_set_message()

function drupal_set_message($message = NULL, $type = 'status') {

in bootstrap.inc, and add

// DEBUG: Go track down that stinkin' error...
if ($type == 'error') {
  $message .= '<pre>'. print_r(debug_backtrace(), 1) .'</pre>';

at the very top. This will give you a backtrace on the error, helping you to trace down it's source. It could be good to know that there are instances where this runs PHP out of memory, if you have a lot of errors, so you may need to add extra conditionals in there at times.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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