Page MenuHomePhabricator

Special:AllMessages throws "Object of class Title to string conversion"
Closed, DeclinedPublic

Description

When I hit Special:AllMessages, this note appears in the http logs:

Notice: Object of class Title to string conversion in /var/www/html/w/includes/Html.php on line 399


Version: 1.16.x
Severity: minor
OS: Linux

Details

Reference
bz27665

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:31 PM
bzimport set Reference to bz27665.
bzimport added a subscriber: Unknown Object (MLST).

Do you have any extensions installed?

When I remove all extensions, the error remains.

Bryan.TongMinh wrote:

Which version of PHP are you using?

PHP 5.1.6, standard with CentOS 5.

In the line that throws the error:

$ret .= " $key=$quote" . strtr( $value, $map ) . $quote;

here is the value of $value:

hiddenTitle Object
(

[mTextform] => AllMessages
[mUrlform] => AllMessages
[mDbkeyform] => AllMessages
[mUserCaseDBKey] => 
[mNamespace] => -1
[mInterwiki] => 
[mFragment] => 
[mArticleID] => 0
[mLatestID] => 
[mRestrictions] => Array
    (
    )

[mOldRestrictions] => 
[mCascadeRestriction] => 
[mRestrictionsExpiry] => Array
    (
    )

[mHasCascadingRestrictions] => 
[mCascadeSources] => 
[mRestrictionsLoaded] => 
[mPrefixedText] => 
[mDefaultNamespace] => 0
[mWatched] => 
[mLength] => -1
[mRedirect] => 
[mNotificationTimestamp] => Array
    (
    )

[mBacklinkCache] =>

)

Bryan.TongMinh wrote:

PHP 5.1 does not fully support automatic string conversion I believe. I just looked up our installation requirements, and 5.1 is still listed as supported, so this should be fixed.

The fix would be to pass $title->getPrefixedText() instead of $title to one of the Html functions.

Marking as WFM, since this works just fine in 5.2+ and the minimum supported version is 5.2.3