Page MenuHomePhabricator

auto edit summary for talk page sections whose heading starts with # is incorrect
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to a talk page
  • Click the "new section" tab
  • Type #Test for the heading
  • Fill in some random text for the message
  • Save the edit
  • Go to the history tab

What happens?:

  • Edit summary is →‎#Test: new section
  • Clicking on that does not jump you to the right section. Jumps you to the non-existent "Test" section instead of #Test section.

What should have happened instead?:

  • Edit summary should be →‎##Test: new section
  • Clicking on that should jump you to the #Test section.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • Was not able to reproduce with # in the middle of the section title. So this bug only occurs at the beginning.
  • One might think there is no use case for starting a talk page heading with #. But it does happen sometimes in the wild. For example, https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)##Anchors_in_links_appear_to_be_broken_on_all_wikis,_all_skins and https://en.wikipedia.org/w/index.php?title=Wikipedia:Administrators%27_noticeboard&oldid=1106281408##WPWP_photo_contest_again

Event Timeline

It is better to link to a diff, where the auto summary is to understand that better: https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&diff=prev&oldid=1105166531

Could be a regression from https://gerrit.wikimedia.org/r/c/mediawiki/core/+/702699 - change for T285951

CommentParser is using LinkTarget::createFragmentTarget, which itself use Title::makeTitle and that strips the # after the above patch, while the Parser generating the h2 does not strip #

Novem_Linguae updated the task description. (Show Details)
Novem_Linguae updated the task description. (Show Details)

Change #1264622 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] Title: Allow leading '#' in fragments again

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

Change #1264622 merged by jenkins-bot:

[mediawiki/core@master] Title: Allow leading '#' in fragments again

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

Change #1266487 had a related patch set uploaded (by Novem Linguae; author: Novem Linguae):

[mediawiki/core@master] tests: add regression test for Title->normalizeFragment()

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

Change #1266487 merged by jenkins-bot:

[mediawiki/core@master] tests: add regression test for Title->normalizeFragment()

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