Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting an occasional error message:
Notice: Array to string conversion in devel_watchdog() (devel.module line 568)
Comments
Comment #1
dieuweI should clarify: This warning appears every time Drupal logs a message. PHP 5.5.3.
Comment #2
NancyDruI 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:
Comment #3
willzyx CreditAttribution: willzyx commentedMoving to 7.x branch since this issue does not occur on 8.x (devel_watchdog() no longer exists)
Comment #4
alesr CreditAttribution: alesr commentedI 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.
Comment #5
alesr CreditAttribution: alesr commentedTo 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.