A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://phabricator.wikimedia.org/T181669 below:

⚓ T181669 ErrorException from line 118 in DisplayTitleHooks.php: PHP Warning: get_class() expects parameter 1 to be object, integer given

Setup

Issue
--> observed here

2017-11-29 19:37:06 phalaris 0210020150926-02100_: [580b136b2f65706e49f698a8] /w/index.php?hide_thanks_log=0&printable=yes&title=Sp%C3%A9cial:Journal/Oetterer   ErrorException from line 118 of /../w/extensions/DisplayTitle/includes/DisplayTitleHooks.php: PHP Warning: get_class() expects parameter 1 to be object, integer given
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /../w/extensions/DisplayTitle/includes/DisplayTitleHooks.php(118): get_class(integer)
#2 /../w/extensions/DisplayTitle/includes/DisplayTitleHooks.php(78): DisplayTitleHooks::handleLink(Title, integer)
#3 [internal function]: DisplayTitleHooks::onHtmlPageLinkRendererBegin(MediaWiki\Linker\LinkRenderer, Title, integer, array, array, NULL)
#4 /../w/includes/Hooks.php(177): call_user_func_array(string, array)
#5 /../w/includes/Hooks.php(205): Hooks::callHook(string, string, array, NULL)
#6 /../w/includes/linker/LinkRenderer.php(181): Hooks::run(string, array)
#7 /../w/includes/linker/LinkRenderer.php(252): MediaWiki\Linker\LinkRenderer->runBeginHook(Title, integer, array, array, boolean)
#8 /../w/includes/linker/LinkRenderer.php(300): MediaWiki\Linker\LinkRenderer->makePreloadedLink(Title, integer, string, array, array)
#9 /../w/includes/linker/LinkRenderer.php(150): MediaWiki\Linker\LinkRenderer->makeKnownLink(Title, integer, array, array)
#10 /../w/includes/logging/PatrolLogFormatter.php(59): MediaWiki\Linker\LinkRenderer->makeLink(Title, integer, array, array)
#11 /../w/includes/logging/PatrolLogFormatter.php(34): PatrolLogFormatter->getMessageParameters()
#12 /../w/includes/logging/LogFormatter.php(464): PatrolLogFormatter->getMessageKey()
#13 /../w/includes/logging/LogFormatter.php(440): LogFormatter->getActionMessage()
#14 /../w/includes/logging/LogEventsList.php(388): LogFormatter->getActionText()
#15 /../w/includes/logging/LogPager.php(376): LogEventsList->logLine(stdClass)
#16 /../w/includes/pager/IndexPager.php(445): LogPager->formatRow(stdClass)
#17 /../w/includes/specials/SpecialLog.php(207): IndexPager->getBody()
#18 /../w/includes/specials/SpecialLog.php(109): SpecialLog->show(FormOptions, array)
#19 /../w/includes/specialpage/SpecialPage.php(522): SpecialLog->execute(string)
#20 /../w/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(string)
#21 /../w/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#22 /../w/includes/MediaWiki.php(851): MediaWiki->performRequest()
#23 /../w/includes/MediaWiki.php(523): MediaWiki->main()
#24 /../w/index.php(43): MediaWiki->run()
#25 {main}

followed by

2017-11-29 19:37:06 phalaris 0210020150926-02100_: [580b136b2f65706e49f698a8] /w/index.php?hide_thanks_log=0&printable=yes&title=Sp%C3%A9cial:Journal/Oetterer   ErrorException from line 46 of /../w/includes/WebResponse.php: PHP Warning: Cannot modify header information - headers already sent by (output started at /../w/extensions/DisplayTitle/includes/DisplayTitleHooks.php:118)
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /../w/includes/WebResponse.php(46): header(string, boolean)
#2 /../w/includes/OutputPage.php(2411): WebResponse->header(string)
#3 /../w/includes/MediaWiki.php(858): OutputPage->output(boolean)
#4 /../w/includes/MediaWiki.php(870): MediaWiki->{closure}()
#5 /../w/includes/MediaWiki.php(523): MediaWiki->main()
#6 /../w/index.php(43): MediaWiki->run()
#7 {main}
Event Timeline Kghbln

renamed this task from

ErrorException from line 118 DisplayTitleHooks.php: PHP Warning: get_class() expects parameter 1 to be object, integer given

to

ErrorException from line 118 in DisplayTitleHooks.php: PHP Warning: get_class() expects parameter 1 to be object, integer given

.

Nov 29 2017, 7:54 PM2017-11-29 19:54:59 (UTC+0) Comment Actions

@CCicalese_WMF I have moved in patch-set 3 on sandbox.smw.o and things seem to be fine. This was really an issue flooding the error log. I looked back into the logs for MW 1.29 and did not get this error at all so this must have been some MW 1.30 thing. Currently I do not have any wiki using 1.29 at hand so I cannot test on this version.

Comment Actions

Thank you, @Kghbln. Could you please +1 the patch from the perspective of MW 1.30RC0? I have somebody else confirming that it still works for MW 1.29. Thanks!

Comment Actions

I left another comment at the patch set since you are specifically focusing on MW 1.29 and MW 1.30 here.

Comment Actions

The patch works for me, but I do wonder if actually there's a fix to be made to LinkRenderer::runBeginHook() as well, because it shouldn't be passing a non-string parameter like that (or its documentation should be updated). The actual problem seems like it might be Language::formatNum() which shouldn't be returning an integer. However, that's out of scope! :)

Comment Actions

I merged this since it's good hardening, but whatever is passing in integers as link text should probably be fixed to pass in strings.

Comment Actions

Thanks for fixing! We still need the tag but closing as resolved should be fine now. :)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4