Page MenuHomePhabricator

PHP Notice: Undefined index: href in /www/w/skins/Vector.php on line 416
Closed, ResolvedPublic

Description

Regularly getting this error on TWN after this update: [siebrand] updated translatewiki.net to 7b09c86 2012-07-11 06:20:53 +0000 (27 seconds ago)

Details

Reference
bz38334

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:07 AM
bzimport set Reference to bz38334.
bzimport added a subscriber: Unknown Object (MLST).

I don't see this happening anymore. This can easily come from an extension using a SkinTemplateNavigation hook, and I don't see from where this could come from MediaWiki core.

So can this be closed now?

Nemo_bis: Could you answer the last comment please?

(In reply to comment #2)

Nemo_bis: Could you answer the last comment please?

No, I'm not able to. Maybe Niklas could, by checking the logs.

probably solved, but only Niklas (or someone with twn access) can give a definitive answer. Pushing to later tarball in any case.

twn:/www/translatewiki.net/w (deployment)$ grep 'href in' logs/error_php
[13-Sep-2012 14:38:55] PHP Notice: Undefined index: href in /www/translatewiki.net/w/skins/Vector.php on line 417
[21-Sep-2012 09:39:14] PHP Notice: Undefined index: href in /www/translatewiki.net/w/skins/Vector.php on line 417
[27-Sep-2012 01:26:43] PHP Notice: Undefined index: href in /www/translatewiki.net/w/skins/Vector.php on line 417
[30-Sep-2012 04:56:49] PHP Notice: Undefined index: href in /www/translatewiki.net/w/skins/Vector.php on line 417

Nemo_bis: Since you put this back to 1.20, are you going to provide a fix this week?

(In reply to comment #6)

Nemo_bis: Since you put this back to 1.20, are you going to provide a fix this
week?

Of course not, I'm not a coder.
The question (to Krinkle) seems rather to be: is this a regression that should be avoided in a release?

Why am I suddenly responsible for this?

(just wondering, I don't mind).

To answer the question: No, PHP errors should not be acceptable, our unit tests should've caught it in which case whatever caused this couldn't have been merged in the first place.

However I'd rather not add isset() calls in Vector.php all over the place, it should have a 'href' property at that point. So though the error comes from that line, the problem is deeper. Maybe Niklas can provide a more elaborate stack trace and dump the array in question to see what else is in it? (e.g. it it contains 'text' => 'Thread', we'd know to look in LQT).

(In reply to comment #8)

Why am I suddenly responsible for this?

I don't know why Nemo_bis thinks this had to be fixed for release, but if you're willing to take it on, go for it.

Keep in mind that 1.20 is supposed to be coming out very soon. As in, the release candidate issued this week is probably the last one -- unless a killer bug is found.

(In reply to comment #8)

Why am I suddenly responsible for this?

(just wondering, I don't mind).

To answer the question: No, PHP errors should not be acceptable, our unit tests
should've caught it in which case whatever caused this couldn't have been
merged in the first place.

However I'd rather not add isset() calls in Vector.php all over the place, it
should have a 'href' property at that point. So though the error comes from
that line, the problem is deeper. Maybe Niklas can provide a more elaborate
stack trace and dump the array in question to see what else is in it? (e.g. it
it contains 'text' => 'Thread', we'd know to look in LQT).

The standard thing to do in skins is use wfSuppressWarnings(); and then at the end use wfRestoreWarnings();

For some reason Vector does not do that.

...I wonder if we should just code that into SkinTemplate itself.

Can a TWN shell user dump data['view_urls'] ?
(eg. var_dump( $this->data['view_urls'] ) at Vector.php line 143)

I don't see how p-views could not have a url. Maybe some Special page? Would be nice to log the url where it happened.

(In reply to comment #11)

Maybe some Special page?

Or an extension.

Fastest way is if you merge some logging code into master.

I prepared some logging code in https://gerrit.wikimedia.org/r/27937 although I don't think it should be merged in master.

Got something, not sure if it is useful.

[06-Nov-2012 13:08:54 UTC] <ul>
<li>Vector.php line 417 calls wfBacktrace()</li>
<li>Vector.php line 234 calls VectorTemplate->renderNavigation()</li>
<li>SkinTemplate.php line 489 calls VectorTemplate->execute()</li>
<li>OutputPage.php line 1989 calls SkinTemplate->outputPage()</li>
<li>Wiki.php line 562 calls OutputPage->output()</li>
<li>Wiki.php line 448 calls MediaWiki->main()</li>
<li>index.php line 59 calls MediaWiki->run()</li>
</ul>
a:3:{s:2:"id";s:10:"ca-history";s:10:"attributes";s:45:" id="ca-history" class="collapsible selected"";s:3:"key";s:51:" title="本页面过去的版本 [h]" accesskey="h"";}
[06-Nov-2012 13:13:07 UTC] <ul>
<li>Vector.php line 417 calls wfBacktrace()</li>
<li>Vector.php line 234 calls VectorTemplate->renderNavigation()</li>
<li>SkinTemplate.php line 489 calls VectorTemplate->execute()</li>
<li>OutputPage.php line 1989 calls SkinTemplate->outputPage()</li>
<li>Wiki.php line 562 calls OutputPage->output()</li>
<li>Wiki.php line 448 calls MediaWiki->main()</li>
<li>index.php line 59 calls MediaWiki->run()</li>
</ul>
a:3:{s:2:"id";s:10:"ca-history";s:10:"attributes";s:45:" id="ca-history" class="collapsible selected"";s:3:"key";s:51:" title="本页面过去的版本 [h]" accesskey="h"";}

Some more info. It is related to LQT

2012-11-25 11:50:51 translatewiki.net mediawiki-bw_: [3298cbbe] /wiki/Thread:Translating_talk:StatusNet/StatusNet:F09f7996e089677db4b486d3d2dadcaf77129855-There_was_a_problem_tagging_s.&en?sort=th_timestamp&limit=50&desc=1&lqt_method=thread_history&printable=yes Exception from line 420 of /www/translatewiki.net/w/skins/Vector.php: Bug 38334
#0 /www/translatewiki.net/w/skins/Vector.php(237): VectorTemplate->renderNavigation(Array)
#1 /www/translatewiki.net/w/includes/SkinTemplate.php(489): VectorTemplate->execute()
#2 /www/translatewiki.net/w/includes/OutputPage.php(1987): SkinTemplate->outputPage()
#3 /www/translatewiki.net/w/includes/Wiki.php(562): OutputPage->output()
#4 /www/translatewiki.net/w/includes/Wiki.php(448): MediaWiki->main()
#5 /www/translatewiki.net/w/index.php(59): MediaWiki->run()
#6 {main}
[25-Nov-2012 11:50:51 UTC] <ul>
<li>Vector.php line 420 calls wfBacktrace()</li>
<li>Vector.php line 237 calls VectorTemplate->renderNavigation()</li>
<li>SkinTemplate.php line 489 calls VectorTemplate->execute()</li>
<li>OutputPage.php line 1987 calls SkinTemplate->outputPage()</li>
<li>Exception.php line 227 calls OutputPage->output()</li>
<li>Exception.php line 272 calls MWException->reportHTML()</li>
<li>Exception.php line 620 calls MWException->report()</li>
<li>Exception.php line 690 calls MWExceptionHandler::report()</li>
<li>Wiki.php line 451 calls MWExceptionHandler::handle()</li>
<li>index.php line 59 calls MediaWiki->run()</li>
</ul>

Krinkle assigned this task to Nikerabbit.
Krinkle updated the task description. (Show Details)
Krinkle removed a project: TestMe.
Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).