I'm getting an occasional error message:

Notice: Array to string conversion in devel_watchdog() (devel.module line 568)

Comments

dieuwe’s picture

I should clarify: This warning appears every time Drupal logs a message. PHP 5.5.3.

NancyDru’s picture

I get this in 7.x as well with PHP 5.3.17.

In function devel_watchdog(), $log_entry['variables'] is used without checking if there are any given.

Here's what I did:

  if (!isset($log_entry['variables'])) {
    $log_entry['variables'] = array();
  }
willzyx’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Issue summary: View changes

Moving to 7.x branch since this issue does not occur on 8.x (devel_watchdog() no longer exists)

alesr’s picture

I got this error too on a mini panel page with missing field in pane.

This is the problematic line in devel.module

'message' => $function(strtr($log_entry['message'], (array) $log_entry['variables']))

$log_entry['variables'] is an array that can hold arrays inside and strstr() can't chew it.

Maybe it would be good to have another check on what this input is of $log_entry['variables'] or even rewrite this part to be more bulletproof.

alesr’s picture

Status: Active » Fixed

To give an update on this issue if you experience the same problem..

Make sure all the fields in panel page exists. The message is not perfect but in the watchdog (Recent log messages on /admin/reports/dblog) you will see which field is missing.
If you then remove this field from the panel, you won't get this notice message any more.

Status: Fixed » Closed (fixed)

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