Problem
After update to the latest dev, I can't open admin/reports/dblog page - it just shows blank Drupal page with error message. Full text of the message is as follows: "Recoverable fatal error: Argument 2 passed to t() must be an array, string given, called in /home/staratel/sites/issueranger/modules/dblog/dblog.admin.inc on line 265 and defined in t() (line 1476 of /home/staratel/sites/issueranger/includes/bootstrap.inc)."
Why it is Metatag issue
After debugging, I've understood that error caused by wrong messages put in the dblog. The reason is in these lines (see http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/watchdog/7 for more details):
// A per-iterationl message, only record if not running via Drush.
if (php_sapi_name() != 'cli') {
watchdog('metatag', t('Update 7004: !count records were updated.', array('!count' => $x)), 'info');
}
Solution
They should be:
// A per-iterationl message, only record if not running via Drush.
if (php_sapi_name() != 'cli') {
watchdog('metatag', 'Update 7004: !count records were updated.', array('!count' => $x), 'info');
}I will provide a patch soon which will include an update for this also.
Also see related issue: #1279680: watchdog() does not type its array arguments
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | metatag-1846516-3.patch | 1.59 KB | damienmckenna |
| #1 | metatag-fix_recoverable_fatal_error-1846516-1.patch | 1.9 KB | PatchRanger |
Comments
Comment #0.0
PatchRanger commentedTypos fixed
Comment #0.1
PatchRanger commentedSome formatting.
Comment #0.2
PatchRanger commentedImprovement of the code.
Comment #1
PatchRanger commentedComment #2
damienmckennaThank you for catching that. Committed!
Comment #3
damienmckennaI also got mixed up between drupal_set_message() statuses and watchdog() statuses.
Comment #4
damienmckennaCommitted.
Comment #5
PatchRanger commentedOp, sorry, it's my fault too.
Comment #6
damienmckenna@Staratel: You're not the one who committed the original faulty code, don't worry about it :-) Thanks for all your help!
Comment #7.0
(not verified) commentedAdded link to Drupal core related issue.