Topic on Project:Support desk

After Upgrade to 1.30 some TOC anchor with German Umlauts or special Characters wont work

9
Mrniceguy1977 pc (talkcontribs)

Dear All

we recentyl upgraded from MediaWiki 1.23 to 1.30 and also migrated from SQL Lite to My SQL - so far everything worked except some Path Informations within an article but that could be fixed without any problem. The only Problem which still remain is that some anchor Links within the TOC wont work because they have German umlauts or some special characters in it.

Ill allready tried to delete an Article and save it new and when i take an look into the http source file ill cant see why it shouldnt work:

Source Code Example (TOC):

<li class="toclevel-2 tocsection-29"><a href="#L.C3.B6sung_2"><span class="tocnumber">8.4</span> <span class="toctext"><b>Lösung 2</b></span></a></li>

Anchor within Article:

<h2><span class="mw-headline" id="L.C3.B6sung_2"><b>Lösung 2</b></span></h2>

As i said before the Problem also occures when there is some special character in the TOC for Example:

<li class="toclevel-1 tocsection-30"><a href="#Darstellungsfehler_aller_Art_wie_falsche.2Ffehlende_Texte_und_Grafiken"><span class="tocnumber">9</span> <span class="toctext">Darstellungsfehler aller Art wie falsche/fehlende Texte und Grafiken</span></a>

Anchor: <h1><span class="mw-headline" id="Darstellungsfehler_aller_Art_wie_falsche.2Ffehlende_Texte_und_Grafiken">Darstellungsfehler aller Art wie falsche/fehlende Texte und Grafiken</span></h1>

How can i fix that issue? Thank you in advance, regards

Mrniceguy1977 pc (talkcontribs)

Additional Information: We use Windows Server 2016, IIS, MySQL and PHP 5.6 - what i found out is that on our testing enviroment ill added the Visual Editor Extension and as soon as i open an article within the new Visual Editor and go to Preview every Link work but actualy ill got the problem that it wont save the information. Maybe some can give me a clue how to manage the above mentionend issue with this additional information. Thank you in advance and have an nice day

Malyacko (talkcontribs)

What is "the issue"? You listed the actual results but not the expected results it seems?

2001:16B8:10A7:6100:2D06:C123:4B0A:AC40 (talkcontribs)

Obviously, TOC links, which have an umlaut in the link target do not work correctly in his case.

I cannot reproduce this issue; for me TOC links with umlaut are working just fine. E.g. I have a link called "Ungeklärte Fragen". The HTML code contains this here: id="Ungekl.C3.A4rte_Fragen" and for me that is working correctly as link target from inside the TOC.

Mrniceguy1977 pc (talkcontribs)

Yes when i got Umlauts or an Special Character like ( or / within the TOC the Link wont work but the curious thing is that the hardcoded Link when i just hover over the TOC seems to be right. What i also noticed is when i just open the TOC Link within an new TAB the new Tab open the article on the right position and then immediately scroll up to the Beginning of the Article and the TOC. Then i try to klick in the adressbar and press Enter to reload the Page with the TOC Anchor within the URL the Link work and the Article shows up at the right position. Maybe there is an Problem with the Script within the Mediawiki or something like this. Is there maybe an way to link to the TOC Number instead of the Text? So i can get rid of the issue, because the other way is to not use Umlauts but this wont help for the special characters. Regards

46.0.2.98 (talkcontribs)

The same thing with cyrillic header links in ToC.

Instead of #Заголовок getting #.D0.97.D0.B0.D0.B3.D0.BE.D0.BB.D0.BE.D0.B2.D0.BE.D0.BA

Meanwhile the article titles in ToC urls are displayed correctly before "#"

178.19.235.21 (talkcontribs)

This is still a problem 3 years later. We upgraded our wiki from an earlier version to 1.37 and all TOC entries with umlauts in them are broken. The only way to fix them is to edit the page, edit the header text, and save the page. Even if there are still umlauts in there, the links do now work. Is there a good way to re-generate all TOCs at once?

178.19.235.21 (talkcontribs)

Actually, the problem gets worse: Editing the TOC entries / headings makes them work again, but only for a few hours. The next day, the anchors are all broken again :(

178.19.235.21 (talkcontribs)

While i have found no fix, i did find a workaround with the User Vulpix in the mediawiki IRC chat. you can set the $wgFragmentMode to [ 'legacy', 'html5' ] and that switche the encoding of the anchors and the toc entry around. i have no idea why that works any better than the "normal" way but it helped me.

Reply to "After Upgrade to 1.30 some TOC anchor with German Umlauts or special Characters wont work"