Hutchy68 / pivot

A MediaWiki mobile skin which "Pivots" seamlessly to any size display.
https://pivot.wikiproject.net
BSD 2-Clause "Simplified" License
37 stars 18 forks source link

Icons not supported in MW 1.35 #103

Closed s0rin closed 3 years ago

s0rin commented 3 years ago

Setup

Issue

Although the page MediaWiki:Pivot.js exists, the icons won't load after upgrade to MW 1.35.

The Chrome console shows the following error:

Uncaught TypeError: Cannot set property 'innerHTML' of null
    at :1:272
    at :1:350
    at domEval (load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot:11)
    at runScript (load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot:13)
    at execute (load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot:14)
    at doPropagation (load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot:7)

while the Firefox console:

Uncaught TypeError: myElement is null
     index.php/Hauptseite line 11 > injectedScript:1
     index.php/Hauptseite line 11 > injectedScript:1
    domEval load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot:11
    runScript load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot:13
    execute load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot:14
    doPropagation load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot:7
Hutchy68 commented 3 years ago

Did you purge the page to recreate it? MediaWiki.Pivot.js loading script is created by MW not Pivot. The error indicates the js is trying to execute before the page is finished loading. Is document.ready being used to trigger the js. Use &debug=true to see if something else is happening. Extension js block/error.

s0rin commented 3 years ago

After page purge the issue is consistent. But I found in MediaWiki:Common.js file some code lines which probably intefered with MediaWiki:Pivot.js loading page. After removing these lines, the icons were shown as expected. In conclusion this was not related to the newest MW version.