Page MenuHomePhabricator

First heading is missing when page title is "0"
Closed, ResolvedPublic

Description

In

https://en.wikipedia.org/wiki/0
https://meta.wikimedia.org/wiki/0
https://test.wikipedia.org/wiki/0

the element '<h1 id="firstHeading" class="firstHeading" lang="en">' with its content (page title) is missing where it's supposed to be.

Event Timeline

whym created this task.Jun 19 2015, 10:57 AM
whym raised the priority of this task from to Needs Triage.
whym updated the task description. (Show Details)
whym added a subscriber: whym.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 19 2015, 10:57 AM
Aklapper triaged this task as Low priority.Jun 24 2015, 1:51 PM
Ciencia_Al_Poder added a subscriber: Ciencia_Al_Poder.

This looks like somewhere in code we're checking if Title is false, which in PHP an empty string, 0 or the string "0" are also considered false :S

So I looked around to see where this is happening, and it's not a core issue, it's a skin issue. You can confirm this by visiting https://www.mediawiki.org/wiki/0 and https://www.mediawiki.org/wiki/0?useskin=cologneblue.

Adding monobook as well, then :)

Legoktm claimed this task.Jun 24 2015, 5:11 PM

Change 220501 had a related patch set uploaded (by Legoktm):
Display the page title on pages named '0'

https://gerrit.wikimedia.org/r/220501

Change 220502 had a related patch set uploaded (by Legoktm):
Display the page title on pages named '0'

https://gerrit.wikimedia.org/r/220502

Change 220502 merged by jenkins-bot:
Display the page title on pages named '0'

https://gerrit.wikimedia.org/r/220502

Change 220501 merged by jenkins-bot:
Display the page title on pages named '0'

https://gerrit.wikimedia.org/r/220501

Legoktm closed this task as Resolved.Jun 24 2015, 5:29 PM

This regresses T97891. The code shouldn't display the title for zero-length strings.

if ( isset( $this->data['title'] ) && strlen( trim( $this->data['title'] ) ) ) would maybe work better then?

Change 220745 had a related patch set uploaded (by Bartosz Dziewoński):
Don't output an empty h1 element (one more, with feeling)

https://gerrit.wikimedia.org/r/220745

Change 220746 had a related patch set uploaded (by Bartosz Dziewoński):
Don't output an empty h1 element (one more, with feeling)

https://gerrit.wikimedia.org/r/220746

matmarex reopened this task as Open.Jun 25 2015, 11:53 AM

Change 220746 merged by jenkins-bot:
Don't output an empty h1 element (once more, with feeling)

https://gerrit.wikimedia.org/r/220746

Change 220745 merged by jenkins-bot:
Don't output an empty h1 element (once more, with feeling)

https://gerrit.wikimedia.org/r/220745

matmarex closed this task as Resolved.Jun 26 2015, 1:00 PM