Page MenuHomePhabricator

[issue with gadget] Class missing for p-namespaces portletlinks on Japanese Wikipedia
Closed, ResolvedPublicBUG REPORT


Probably the same as T320691. With the vector-2022 skin, li elements added to p-namespaces are missing the class vector-tab-noicon and misaligned because CSS isn't applied to the selectors.

Misaligned.png (267×327 px, 10 KB)

Misaligned - class.png (338×760 px, 41 KB)

Event Timeline

Jdlrobson added a subscriber: Jdlrobson.

This looks like an issue with a gadget?

If this is there's some problems with that code.

It doesn't look like it works as expected in Minerva and L21 should be

pos = document.getElementById( 'p-associated-pages' ) ? 'p-associated-pages' : 'p-namespaces';

rather than

pos = 'p-namespaces';
Jdlrobson renamed this task from Class missing for p-namespaces portletlinks to [issue with gadget] Class missing for p-namespaces portletlinks.Mon, Mar 20, 10:59 PM

That script isn't quite a gadget actually. It's just an experimental script made only for demo purposes for a discussion in village pump.
The following code replicates the misalignment issue, so I believe this is an issue of the vector-2022 skin.

mw.loader.using('mediawiki.util', function() {
    mw.util.addPortletLink('p-namespaces', '#', 'MISALIGNED');
Aklapper renamed this task from [issue with gadget] Class missing for p-namespaces portletlinks to [issue with gadget] Class missing for p-namespaces portletlinks on Japanese Wikipedia.Tue, Mar 21, 10:02 AM

This is triggering a warning message: "Please update call to mw.util.addPortletLink with ID p-namespaces. Use p-associatedPages instead." indicating the issue here (There does appear to be a typo in this message however)

You can fix this by changing the code to:

mw.util.addPortletLink('p-associated-pages', '#', 'MISALIGNED');

We could perhaps update that code, but in future it will stop working and break altogether so it's probably a good thing that it brought you to Phabricator.

Weird. When I tried to identify the cause of the issue illustrated by the first picture in Op, I didn't see any error message in console but now I get one for the deprecated p-namespaces, and also it's now impossible to reproduce the misaligned portlet link as in the image and in fact no portlet link is added to the position if I use p-namespaces (although this behaviour is normal because it just means p-namespaces is missing. Maybe there was p-namespaces when I initially filed this task but now there isn't? I don't know.) This task can be closed now, it would be a waste of time to try to "fix a bug" for the deprecated feature. I appreciate your help.

Jdlrobson claimed this task.

Glad it's fixed. You can see T316908 for details on the change we made. We tried to make it backwards compatibility but clearly your bug report indicated we didn't fully succeed with that :-)