Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298090

Watchdog breaks when its third parameter is a string

$
0
0

As it's documented on https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/watc... the third parameter is an array or have to be set to NULL if you want to make the message untranslatable.
Keeping the backward compatibility possible we with @alexverb propose the following change in dblog module in order to be able to handle other types too (see patch), because currently if you use e.g. a string as third parameter, watchdog writes the record to db, and it brakes the interface until you don't remove the wrong item from db. Also to make it less possible for contributed and custom solutions to do the same mistake, it would be good if even a wrong value goes to watchdog db table, it won't crash the interface just because theme_dblog_message function doesn't handle it well.

As 'N;' string is the manifestum of an empty array after serialization, it makes confusion why it has to be identically equal when it gets compared with the variables. Instead of this wizard it should be checked is it an array or not after unserializing it.

Following the documentation of watchdog, we think with this solution it's more realistic and understandable how theme_dblog_message works.


Viewing all articles
Browse latest Browse all 298090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>