Page MenuHomePhabricator

PHP Catchable fatal error: Argument 1 passed to RequestContext::setTitle() must be an instance of Title, null given
Closed, DeclinedPublic

Description

Related to the recent RequestContext introduction, but too lazy to dig up anymore when this was introduced. Filing a bug because of poking people in IRC hasn't had any effect on fixing this bug.


Version: unspecified
Severity: major
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=55435

Details

Reference
bz28827

Event Timeline

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

Can you paste the error line (or backtrace if available)? Haven't reproduced this yet, should be easier to find if we've got a detailed ping.

Assigning to dantman since he seems to be responsible for this area.

Right I forgot the line numbers:

PHP Catchable fatal error: Argument 1 passed to RequestContext::setTitle() must be an instance of Title, null given, called in /www/w/includes/OutputPage.php on line 795 and defined in /www/w/includes/RequestContext.php on line 47

x.x.x.x translatewiki.net - [09/May/2011:20:20:33 +0000] "POST /w/api.php HTTP/1.1" 500 37

That's a little shallow. No real information where the bad title is coming from.

It's everything I have without trying to spend all my time debugging it myself!

Yes.

[15-Jun-2011 15:08:26] PHP Catchable fatal error: Argument 1 passed to OutputPage::setTitle() must be an instance of Title, null given, called in /www/w/extensions/LiquidThreads/classes/View.php on line 381 and defined in /www/w/includes/OutputPage.php on line 812

BTW I suggest adding type hint to OutputPage::setTitle to catch these errors easier.

unassign Daniel Friesen after talking to him

Implemented my suggestion in r93404. The cause is actually in LQT -- so no quick fix to be seen.

It would be nice if that change was included by a null check and a wfDebug call... since extensions trying to set the current page title to null IS a bug.

Why? The type hint will already cause PHP to give the exact line of the caller and fail fast.

Heh, n/m sorry... I read the diff the wrong way, it looked like you were removing one of the type hints we already had so that the null would be passed through and not throw an error.

Go ahead and add a Title type hint to any setTitle method related to RequestContext code. If PHP had mixins a type hint like that would be part of the standard mixin.

Okay, the issue prevents me to post new messages in this url as anonymous user: http://translatewiki.net/wiki/User_talk:Dsvyas

  • Bug 34446 has been marked as a duplicate of this bug. ***

I got this issue earlier when trying to create a new thread on a user talk page as an anonymous user...

Showing in the error logs quite a lot at teh moment...

PHP Catchable fatal error: Argument 1 passed to OutputPage::setTitle() must be an instance of Title, null given, called in /usr/local/apache/common-local/php-1.21wmf3/extensions/LiquidThreads/classe
s/View.php on line 450 and defined in /usr/local/apache/common-local/php-1.21wmf3/includes/OutputPage.php on line 850

I tried to post a new thread on a user talk page from incognito (anonymous user) and it went well, did I do something wrong to not reproduce this error?

(In reply to comment #18)

I tried to post a new thread on a user talk page from incognito (anonymous
user) and it went well, did I do something wrong to not reproduce this error?

There are no steps to reproduce. The error is not seen any longer on twn, but that may be because unregistered users are now restricted from LQT.

Reedy, do you see this in the logs still?

Thanks to Ori:

[29-Aug-2013 15:45:50] Catchable fatal error: Argument 1 passed to EditPage::__construct() must be an instance of Article, null given, called in

/usr/local/apache/common-local/php-1.22wmf14/extensions/LiquidThreads/classes/View.php on line 734 and defined at 
/usr/local/apache/common-local/php-1.22wmf14/includes/EditPage.php on line 272

agarrett: Any chance that you could take a look at this?

Does this still happen (asking due to comment 22) or can this be closed as WORKSFORME nowadays?

Does this still happen (asking due to comment 22) or can this be closed as WORKSFORME nowadays?

(In reply to Sam Reed (reedy) from comment #22)

https://gerrit.wikimedia.org/r/#/c/88189/ might have fixed this...

Doesn't look so:

2014-01-22 19.00 -rakkaus:#mediawiki-i18n- [22-Jan-2014 18:00:47 UTC] PHP Catchable fatal error: Argument 1 passed to OutputPage::setTitle() must be an instance of Title, null given, called in /www/translatewiki.net/w/extensions/LiquidThreads/classes/View.php on line 450 and defined in /www/translatewiki.net/w/includes/OutputPage.php on line 910

Jdforrester-WMF lowered the priority of this task from High to Lowest.Aug 4 2016, 11:34 PM
Jdforrester-WMF subscribed.

LiquidThreads has been replaced by StructuredDiscussions on all Wikimedia production wikis (except one, which will be done soon). It is no longer under active development or maintenance, so I'm re-classifying all open LQT tasks as "Lowest" priority.

Nemo_bis raised the priority of this task from Lowest to High.Aug 5 2016, 7:34 AM
Krinkle subscribed.

Not seen in at least 30 days.