Page MenuHomePhabricator

Badges not displaying on trwiki
Closed, ResolvedPublic

Description

Badges supposed to be displayed next to interwiki links on the left are not working on trwiki. Please see this featured list for an example.

Event Timeline

Hi @Superyetkin, thanks for taking the time to report this!
Can you please elaborate where exactly to see this? Which kind of badge would you expect where exactly (names of strings or screenshots, please)?

Ah, alright. I opened the web browser's developer tools, went to their "Network" tab and I see that there is a 404 error:

https://tr.wikipedia.org/w/extensions/Wikidata/extensions/WikimediaBadges/resources/images/badge-golden-star.png

This is maybe a defect on the deployment of the badges extension/Wikidata or a breakage on apache redirects. However, I have open other languages, that show the image on the browser, and all generate a 404- the image comes from a base64 encoding, not from the static image:

Styles applied to featured articles:

* list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAANCAIAAAD0YtNRAAAABnRST…NBmAlUiyaBkENoxZSDWnOtBmoAQu7TnT+3WuDOA7KBIkAGAGwiNeqjusp/AAAAAElFTkSuQmCC);
* list-style-image: url(/w/extensions/WikimediaBadges/resources/images/badge-golden-star.png?ed948)!ie;

I am inclined to think it looks like a deployment mistake, for some reasons, on tr, the applied style is, on top of the others:

url(//tr.wikipedia.org/w/extensions/Wikidata/extensions/WikimediaBadges/resources/images/badge-golden-star.png);

I am using https://en.wikipedia.org/wiki/Book_of_Kells as a base for checking (it is featured on enwiki and others).

This happened because we removed the bundle of Wikidata from the production and thus the addresses got lost. Where these addresses have used? in Vector.css of trwiki. In order to bring the badges back, you just need to delete the rules at the bottom of the page. Maybe we should do a grep to check if more cases are still being used in Wikipedia-land CC. @Lydia_Pintscher.

@Superyetkin As per Ladsgroup, it seems the CSS you added here is not correct https://tr.wikipedia.org/w/index.php?title=MediaWiki%3AVector.css&type=revision&diff=18969658&oldid=18388018 Please double check it.

@Ladsgroup Apparently, that reference is not the only one, I think it is a very common addition, but it works on others because it is overriden, see my comment above. While not necessarily our responsability, maybe we should announce it louder so people retire the invalid reference from other wikis too.

Superyetkin claimed this task.

Thanks, removing the redundant code solved the issue.

I fully agree with jcrespo in that there may be other wikis still using similar code blocks. Tech News would be the best place to make an announcement to help inform people regarding the issue.

I don't think we have anything else that is used wiki-wide in large scale. Unless my query is wrong.

ladsgroup@tin:~$ mwgrep "WikimediaBadges"
bhwiki              MediaWiki:Gadget-LiveRCSiteConfig.js
fiwiki              MediaWiki:Gadget-LiveRCSiteConfig.js
frwiki              MediaWiki:Gadget-LiveRCSiteConfig.js
frwiki              MediaWiki:Gadget-LiveRCSiteConfig.js/Dev.js
itwiki              MediaWiki:Gadget-LiveRCSiteConfig.js
kabwiki             MediaWiki:Gadget-LiveRCSiteConfig.js

(total: 6, shown: 6)
ladsgroup@tin:~$ mwgrep "WikimediaBadges" --user
dewiki              User:Dr Brains/LiveRCSiteConfig.js
enwiki              User:Ladsgroup/monobook.css
enwiki              User:Mr. Guye/sandbox.js/debug.js
fawiki              User:Alfa80/Gadget-LiveRCSiteConfig.js
frwikinews          User:Dr Brains/LiveRCSiteConfig.js
hiwiki              User:SM7/Gadget-LiveRCSiteConfig.js

(total: 6, shown: 6)
curl 'https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.cite.styles%7Cext.echo.badgeicons%7Cext.echo.styles.badge%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles%7Cwikibase.client.init&only=styles&skin=vector' \
| grep '/w/extensions/WikimediaBadges/resources/images/badge-golden-star.png'

Screenshot_20180213_205100.png (256×330 px, 18 KB)

It could me my browser, though- I do not claim to understand anything near the frontend.

One tip, add &debug=true so it doesn't minify the result and seeing results will be easier:

curl 'https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.cite.styles%7Cext.echo.badgeicons%7Cext.echo.styles.badge%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles%7Cwikibase.client.init&only=styles&skin=vector&debug=true' | grep -C 50 '/w/extensions/WikimediaBadges/resources/images/badge-golden-star.png'

The result is okay:

.badge-featuredarticle,
.badge-featuredportal,
.badge-featuredlist {
	list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAANCAIAAAD0YtNRAAAABnRSTlMA/AD+APzoM1ogAAAAWklEQVR4AWP48+8PLkR7uUdzcMvtU8EhdykHKAciEXL3pvw5FQIURaBDJkARoDhY3zEXiCgCHbNBmAlUiyaBkENoxZSDWnOtBmoAQu7TnT+3WuDOA7KBIkAGAGwiNeqjusp/AAAAAElFTkSuQmCC);
	list-style-image: url(/w/extensions/WikimediaBadges/resources/images/badge-golden-star.png?ed948)!ie;
}

This is part of WikimediaBadges extension: https://phabricator.wikimedia.org/diffusion/EWMB/browse/master/resources/skins/vector/wikimedia-badges.css
The thing is that the url is not giving out 404: https://en.wikipedia.org/w/extensions/WikimediaBadges/resources/images/badge-golden-star.png?ed948
The url that was giving out 404 for trwiki had an extra Wikidata bundle: https://en.wikipedia.org/w/extensions/Wikidata/extensions/WikimediaBadges/resources/images/badge-golden-star.png
The reason that the url is struck through in your browser is that, it's not using that url and it's using the SVG version (the above list-style-image rule) instead which is faster.
HTH