Last modified: 2014-09-20 03:45:53 UTC
Sometimes log_params isn't serialized. If keys aren't specified, I would think this would make it harder sometimes to tell at a glance what the data represents. If keys are specified, though, then one needs to extract the data using, e.g., substr(). Three examples I notice are changing visibility of revisions and log events; merging histories; and blocking users (for more details, see [[mw:Manual:Log actions]]). When you change visibility of a revision, the raw text inserted into log_params is, e.g.: revision 7 ofield=0 nfield=4 Likewise, merging histories generates, e.g.: Bar 20140916175747 Blocking a user is the same way; something like the following gets inserted: 3 days nocreate
Is this a bug or a feature? Is it desired that sometimes log_params be easily human readable?
Its a historical thing. Once upon a time, fields for log_params were separated by a newline. Then it got changed to being json blob (And possibly there's a couple php serialized blobs in there too, not sure). However not all log types got changed to the new format. Anyone creating a new log type should use the json serialization. Old log types should be moved to use the the new json format for new entries. (And eventually when that is done, if someone is really board they could create a maintenance script to change old log entries.)
json? php serialized is the current format
(In reply to db from comment #3) > json? php serialized is the current format Whoops, my mistake. Also block log appears to use csv. Suffice it to say, log_params is a bit of a mess.
Page protection events also insert into log_params unserialized content like this: [edit=autoconfirmed] (indefinite)[move=autoconfirmed] (indefinite)
Following patches already exists: - Gerrit change #151683 - Migrate merge log to new log system - Gerrit change #151701 - Migrate import log to new log system - Gerrit change #152003 - Migrate block log to new log system - Gerrit change #152156 - Migrate protect log to new log system - Gerrit change #152161 - Use new log system when create log entry for revision delete