Page MenuHomePhabricator

After editing second section with identical name on a page, URL anchor in browser address bar points to first section
Closed, DuplicatePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Add the below code
  • Edit the second section
  • Click on the "Save changes" button
==Test==
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll

==Test==
The returned link to the browser (in the location bar) is [[#Test]] not [[#Test_2]] after I've edited this section.

==Test==
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll

==Test==
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll
* Scroll

What happens?:
When you hit the "Save changes" button the #Test link is loaded by the browser (see the location bar: example: https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox#Test).

What should have happened instead?:
The second Test section will be listed as Test (notice the extra "_2" in the URL) in the TOC automatically added by MediaWiki. However, #Test_2 is not loaded by the browser bar when you hit the "Save changes" button, for example: https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox#Test_2

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.: 1.39.0-wmf.10 (6139f98) (https://en.wikipedia.org/wiki/Special:Version)

Event Timeline

Aklapper changed the task status from Open to Stalled.May 17 2022, 9:08 PM

Hi, I'm afraid I either don't understand or cannot reproduce. I tried in https://www.mediawiki.org/w/index.php?title=User%3AAKlapper_%28WMF%29%2FSandbox&type=revision&diff=5217084&oldid=5217083 . The link in the TOC still works as expected. This needs clearer steps that allow someone else to reproduce. Also, does this also happen when using safemode ( https://www.mediawiki.org/wiki/Help:Locating_broken_scripts )?

Hi, I'm afraid I either don't understand or cannot reproduce. I tried in https://www.mediawiki.org/w/index.php?title=User%3AAKlapper_%28WMF%29%2FSandbox&type=revision&diff=5217084&oldid=5217083 . The link in the TOC still works as expected. This needs clearer steps that allow someone else to reproduce. Also, does this also happen when using safemode ( https://www.mediawiki.org/wiki/Help:Locating_broken_scripts )?

Thanks for your evaluation. I updated the issue, please re-evaluate it: The browser doesn't load #Test_2 in the location bar, it is not a TOC issue.

Hi, I'm afraid I either don't understand.

Feel free to improve the text of the issue.

David_Hedlund renamed this task from Numbered anchor is not included in the URL for sections with identical names to "Save changes" does not return section number in the location bar when section 2, section 3, etc, are edited for sections with identical names.May 18 2022, 4:38 AM
Aklapper renamed this task from "Save changes" does not return section number in the location bar when section 2, section 3, etc, are edited for sections with identical names to After editing second section with identical name on a page, URL anchor in browser address bar points to first section.May 18 2022, 6:10 AM
Aklapper changed the task status from Stalled to Open.
Aklapper triaged this task as Low priority.