Page MenuHomePhabricator

revision display on Schema:NoSuchPage triggers message parsing warning
Closed, ResolvedPublic

Description

If you set your wiki to display warnings, visiting a non-existent schema page (on the machine that holds the schemas for event logging) triggers

Warning: Invalid message parameter: a:1:{s:3:"raw";N;} in .../includes/Message.php on line 625

This is coming from the onBeforePageDisplay code in JsonSchemaHooks.php to show the subtitle "Revision nnnn":

$out->addSubtitle( $out->msg( 'eventlogging-revision-id' )
    // We use 'rawParams' rather than 'numParams' to make it
    // easy to copy/paste the value into code.
    ->rawParams( $out->getRevisionId() )

The Schema page ends up displaying "Revision [INVALID]", which is fine, but the message parsing code is unhappy when the getRevisionId() is NULL (bug?!)

The stack in Message.php is

extractParam()
replaceParameters()
toString()
escaped()

The simplest fix is to cast the revision ID to an integer in JsonSchemaHooks.php line 106:

->rawParams( (integer) $out->getRevisionId() )

which results in displaying "Revision 0" on a new schema page.


Version: unspecified
Severity: minor

Details

Reference
bz43752

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:29 AM
bzimport set Reference to bz43752.

Thanks for the report! Change 42920 in Gerrit.

[moving from MediaWiki extensions to Analytics product - see bug 61946]