Wikipedia:Village pump (technical)
Policy | Technical | Proposals | Idea lab | WMF | Miscellaneous |
If you want to report a JavaScript error, please follow this guideline. Questions about MediaWiki in general should be posted at the MediaWiki support desk. Discussions are automatically archived after remaining inactive for five days.
![]() |
showFrequently asked questions (FAQ) (see also: Wikipedia:FAQ/Technical) |
---|
Possible Thursday weirdness[edit]
On a number of different browsers I'm experiencing difficulty aiming the mouse cursor when editing pages. It seems to be made worse by the length of the page being edited, and/or by increasing the zoom level in the browsers. Anybody else having this issue? Abductive (reasoning) 21:44, 31 March 2022 (UTC)
- Yup, I'm having this issue too. It seems like when I click, the cursor is placed several lines higher. As soon as I type something (I've started to just do space, backspace), it's not a problem anymore for that editing session. rchard2scout (talk) 13:48, 1 April 2022 (UTC)
- I've been seeing this for quite a while using MonoBook on a Chromebook. In particularly long edit windows the visible cursor may be several lines above the actual edit point. - Donald Albury 15:46, 1 April 2022 (UTC)
- Maybe what I am seeing is different. The horizontal cursor position is always correct. The further down I am in long chunks of text, the higher the cursor sits relative to the edit point. If I am editing far down in a block of text, the cursor may be three or four lines above the actual edit point, but as long as I allow for that, editing proceeds normally. - Donald Albury 16:54, 1 April 2022 (UTC)
- It just started a day or two ago for me. The edit window doesn't seem to interpret the location of the mouse-click properly. I have to use arrow keys to get the cursor positioned properly. It's also occurring when I try to click-drag to select text; on the first click (like at the start of a ref), it immediately highlights several lines of text above the click. It's happening frequently, but not consistently. Schazjmd (talk) 15:57, 1 April 2022 (UTC)
- I've been experiencing this, too. (Courtesy ping @ElijahPepe) {{u|Sdkb}} talk 23:47, 1 April 2022 (UTC)
- Just had it—scrolling the edit window to the bottom with the mouse wheel was what made it go away this time—but I've encountered it sporadically for around a year now on Commons. —wqnvlz (talk · contribs); 11:05, 3 April 2022 (UTC)
- Do you have the colorful syntax highlighter turned on? Whatamidoing (WMF) (talk) 22:03, 6 April 2022 (UTC)
- This has been reported by a number of editors at Wikipedia:Help_desk#Chrome_editing_problems. The suggestion was to report it here.--Gronk Oz (talk) 14:11, 8 April 2022 (UTC)
- I just started experiencing this too, a few days ago. It is very annoying. --Srleffler (talk) 18:04, 10 April 2022 (UTC)
- @Srleffler, is your editing window showing wikitext in plain black-and-white text, or is it giving you colors to show the syntax? This appears to be caused by syntax highlighting, which you can turn off if you need to (look for a 'highlighter marker' near the bold/italic/ref/etc. items in the toolbar.) Whatamidoing (WMF) (talk) 18:16, 11 April 2022 (UTC)
- Am also experiencing this problem, can confirm that I have syntax highlighting on. — Mcguy15 (talk, contribs) 01:14, 13 April 2022 (UTC)
- I've also been having this problem and have syntax turned on. Curbon7 (talk) 01:21, 13 April 2022 (UTC)
- With highlighting on in Safari, just jumping in because I see people said specifically Chrome. Happy Editing--IAmChaos 01:03, 14 April 2022 (UTC)
- @Srleffler, is your editing window showing wikitext in plain black-and-white text, or is it giving you colors to show the syntax? This appears to be caused by syntax highlighting, which you can turn off if you need to (look for a 'highlighter marker' near the bold/italic/ref/etc. items in the toolbar.) Whatamidoing (WMF) (talk) 18:16, 11 April 2022 (UTC)
- I just started experiencing this too, a few days ago. It is very annoying. --Srleffler (talk) 18:04, 10 April 2022 (UTC)
- This has been reported by a number of editors at Wikipedia:Help_desk#Chrome_editing_problems. The suggestion was to report it here.--Gronk Oz (talk) 14:11, 8 April 2022 (UTC)
- Do you have the colorful syntax highlighter turned on? Whatamidoing (WMF) (talk) 22:03, 6 April 2022 (UTC)
Create a new <nodarkmode> tag?[edit]
Is it possible to create and store a new <nodarkmode> tag in sitewide css page, such that anything within this tag should get ignored by the dark mode gadget when used. Basically, I created User:CX Zoom/Pale Blue Dot and Dark mode gadget blackens the white text, and the text becomes unreadable. I'd be glad if I had a tag that asks the gadget to ignore the text. I don't know the technical details of it, but a module-based template that can achieve the same task would also work for me. Thanks! —CX Zoom[he/him] (let's talk • C • L) 08:05, 9 April 2022 (UTC)
- Apply
mw-no-invert
class on the div element. – SD0001 (talk) 09:14, 9 April 2022 (UTC)- Thanks a lot, it did exactly what I wanted. —CX Zoom[he/him] (let's talk • C • L) 13:09, 9 April 2022 (UTC)
- Out of curiousity, why doesn't this page fall under WP:U5? @CX Zoom casualdejekyll 19:08, 11 April 2022 (UTC)
- It's probably of sufficient length to qualify for WP:G12.... CX Zoom, you should probably remove it. Izno (talk) 19:19, 11 April 2022 (UTC)
- I wished to replace the top of my current contents of userpage with it, as it happens to be one of my favorites. I'm not sure about G12 tho, it's copied right from the article Pale Blue Dot and is one of the good articles. —CX Zoom[he/him] (let's talk • C • L) 19:28, 11 April 2022 (UTC)
- CX Zoom, just because an article is a GA doesn't mean that everything in it is policy compliant. In particular, the article passed GA looking like this, which is a significantly smaller quotation. Please remove the text from your user space. Izno (talk) 00:30, 12 April 2022 (UTC)
- Sure. Thanks for notifying me. —CX Zoom[he/him] (let's talk • C • L) 05:53, 12 April 2022 (UTC)
- CX Zoom, just because an article is a GA doesn't mean that everything in it is policy compliant. In particular, the article passed GA looking like this, which is a significantly smaller quotation. Please remove the text from your user space. Izno (talk) 00:30, 12 April 2022 (UTC)
- I wished to replace the top of my current contents of userpage with it, as it happens to be one of my favorites. I'm not sure about G12 tho, it's copied right from the article Pale Blue Dot and is one of the good articles. —CX Zoom[he/him] (let's talk • C • L) 19:28, 11 April 2022 (UTC)
- It's probably of sufficient length to qualify for WP:G12.... CX Zoom, you should probably remove it. Izno (talk) 19:19, 11 April 2022 (UTC)
April 10[edit]
Hello! Wikipedia says that it is April 10, but my computer says it is April 9. What time zone is Wikipedia on? Thanks! Helloheart (talk) 03:43, 10 April 2022 (UTC)
- It's on UTC. Graham87 06:08, 10 April 2022 (UTC)
- @Helloheart See the "Time Offset" section at Special:Preferences#mw-prefsection-rendering. --Ahecht (TALK
PAGE) 20:02, 11 April 2022 (UTC)
Convert a special page name to a language-specific page name[edit]
Hi, is there a Mediawiki function to convert a special page name to a language-specific page name in javascript? For instance, I want to get 'Special:用户贡献' from 'Special:Contributions' on zhwiki. Any help would be appreciated.--153.144.223.221 (talk) 17:54, 11 April 2022 (UTC)
- Why do you want to do that? Whatamidoing (WMF) (talk) 18:13, 11 April 2022 (UTC)
- @Whatamidoing (WMF): Because I want to collect all <a> tags with those specific texts on the DOM and change their CSS using jQuery.—153.144.223.221 (talk) 18:25, 11 April 2022 (UTC)
- I mean, that would help the coding of global.js.—153.144.223.221 (talk) 18:27, 11 April 2022 (UTC)
- You can make an API call with
action=query
,titles=Special:Contributions
, andformatversion=2
, and the language-specific name will be returned inquery.normalized[0].from
andquery.pages[0].title
. --Ahecht (TALK
PAGE) 20:15, 11 April 2022 (UTC) - Here is an example:
- --Ahecht (TALK
var canonical_title = 'Special:Contributions' var result = JSON.parse($.ajax({ url: mw.util.wikiScript('api'), async:false, data: { action: 'query', format: 'json', titles: canonical_title, formatversion: '2' } }).responseText) var normalized_title = result.query.pages[0].title
PAGE) 20:21, 11 April 2022 (UTC)- @Ahecht: Thank you! It can just be achieved by an API query eh. I was actually aware that page titles in the URL are automatically translated into the local language so I was wondering what part of the API was doing this, but this seems like it! For a faster code, it might be a good idea for WMF developers to add a mw.config function or something for this, though.—153.144.223.221 (talk) 03:17, 12 April 2022 (UTC)
- mw.config functions are generally static, so the amount of information they can provide about pages other than the one you are currently on is very limited. They do work the other direction -- when you're on Special:用户贡献 you can call
mw.config.get('wgCanonicalSpecialPageName')
and it will return 'Contributions'. --Ahecht (TALK
PAGE) 04:31, 12 April 2022 (UTC)
- mw.config functions are generally static, so the amount of information they can provide about pages other than the one you are currently on is very limited. They do work the other direction -- when you're on Special:用户贡献 you can call
- @Ahecht: Thank you! It can just be achieved by an API query eh. I was actually aware that page titles in the URL are automatically translated into the local language so I was wondering what part of the API was doing this, but this seems like it! For a faster code, it might be a good idea for WMF developers to add a mw.config function or something for this, though.—153.144.223.221 (talk) 03:17, 12 April 2022 (UTC)
Tech News: 2022-15[edit]
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- There is a new public status page at www.wikimediastatus.net. This site shows five automated high-level metrics where you can see the overall health and performance of our wikis' technical environment. It also contains manually-written updates for widespread incidents, which are written as quickly as the engineers are able to do so while also fixing the actual problem. The site is separated from our production infrastructure and hosted by an external service, so that it can be accessed even if the wikis are briefly unavailable. You can read more about this project.
- On Wiktionary wikis, the software to play videos and audio files on pages has now changed. The old player has been removed. Some audio players will become wider after this change. The new player has been a beta feature for over four years. [1][2]
Changes later this week
The new version of MediaWiki will be on test wikis and MediaWiki.org from 12 April. It will be on non-Wikipedia wikis and some Wikipedias from 13 April. It will be on all wikis from 14 April (calendar).
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
19:43, 11 April 2022 (UTC)
London Wall[edit]
- has short URL: "https://w.wiki/32vG"
- fails: "https://url-converter.toolforge.org/index.pl?url=https://w.wiki/32vG"
what is this? .... 0mtwb9gd5wx (talk) 20:17, 11 April 2022 (UTC)
- It's from the Wikidata:SPARQL query service, probably via the bottom icon in the left sidebar at Wikidata Query Service. Certes (talk) 20:54, 11 April 2022 (UTC)
- @0mtwb9gd5wx that external ask you to report bugs to: meta:User_talk:Lustiger_seth, it is not part of the English Wikipedia. — xaosflux Talk 22:00, 11 April 2022 (UTC)
- I don't know the tool at https://url-converter.toolforge.org but it says: "supported redirect types: google, achive.today" (achive.today must be a typo for archive.today). Do you have evidence it's supposed to support https://w.wiki? It doesn't appear to be a general tool for redirects. PrimeHunter (talk) 22:27, 11 April 2022 (UTC)
Vector 2022[edit]
I actually like this new style, but I'm just wondering there's a way to give it a fluid width. It seems to have a fixed width, so when viewing episode tables, for example, everything is more squished compared to the legacy Vector style. Amaury • 22:49, 11 April 2022 (UTC)
- @Amaury: here is a quick-and-dirty hack you could try, it is safe, but it may cause odd display issues (don't come blaming me if it does). You can put this in your Special:MyPage/vector-2022.css file. :
/*Override max-widths */
.mw-page-container {
max-width: unset !important;
}
.mw-workspace-container {
max-width: inherit !important;
}
.mw-content-container, .mw-article-toolbar-container {
max-width: inherit !important;
padding-left: 11em !important;
}
- Someone who has spent more time with that annoyance may come by here and give a better set of rules. — xaosflux Talk 00:47, 12 April 2022 (UTC)
- I've got some slighly different CSS rules, mainly to make it fill out the width:
.mw-workspace-container {
max-width: 100%;
}
.mw-article-toolbar-container,.mw-content-container {
max-width: calc(100% - 11em); /* 11em is the width of #mw-panel */
margin-right: 0;
}
.mw-footer-container {
padding-top: 0;
padding-bottom: 0;
}
- I put those in back in October, when I first turned on New Vector. They still work fine for me, but no guarantees of course. --rchard2scout (talk) 09:22, 12 April 2022 (UTC)
- @Rchard2scout noticed you didn't touch .mw-page-container , are you keeping that one narrower? — xaosflux Talk 10:05, 12 April 2022 (UTC)
- I was keeping it narrower (but I don't remember if I did that on purpose). I just added
.mw-page-container,.vector-sticky-header
to the.mw-workspace-container
line. I'm a bit worried about line lengths now on my 24" monitor, but I'll try it out for a few days. rchard2scout (talk) 11:26, 12 April 2022 (UTC)
- I was keeping it narrower (but I don't remember if I did that on purpose). I just added
- I'm surprised no one turned this into a gadget yet... —TheDJ (talk • contribs) 09:52, 12 April 2022 (UTC)
External links and https[edit]
By default, Special:LinkSearch searches only http:. Checking https: requires a second search. Although that's clear after reading the documentation, the casual user might go away without finding an https: link. Now that https: is the norm, would it make sense to ask for it to be included by default, along with http:? Certes (talk) 10:06, 12 April 2022 (UTC)
- @Certes: see phab:T14810 from at least 2008. This would need to be worked on upstream. — xaosflux Talk 10:19, 12 April 2022 (UTC)
How to implement a unanimously approved proposal on naming convention of Indian constituency[edit]
Wikipedia talk:WikiProject Indian politics#Proposal : Wikipedia:Naming conventions Indian constituencies was proposed 3 weeks ago after discussion over a few months. The proposal was duly notified on WP:INDIA and state WP pages along with WP:Naming conventions and other relevant wikiprojects. There is a unanimous support for the proposal. The implementation involves rename of a few hundred pages (Some of them would need to be moved over a redirect). How to get it done? Venkat TL (talk) 11:36, 12 April 2022 (UTC)
- @Venkat TL: *If* there is unanimous consensus, you can use WP:RMTR, with appropriate reasoning. Someone with proper rights, willing to move the pages would do it. —CX Zoom[he/him] (let's talk • C • L) 13:59, 12 April 2022 (UTC)
- @Venkat TLFor the pages you can move yourself, move them. Some moves over redirects can be done by any user (depending on the edit history of the redirect), but for the ones that can't, submit them to WP:RM/TR. --Ahecht (TALK
PAGE) 14:00, 12 April 2022 (UTC)- @Ahecht @CX Zoom Thank you. I was looking for some batch script or tool. Just found that Wikipedia:AutoWikiBrowser/User_manual#Start has option to move, but needs admin rights. Looks like WP:RM/TR would be the right place to find such an admin, willing to do it. --Venkat TL (talk) 14:47, 12 April 2022 (UTC)
- @Venkat TL: I use User:Ahecht/Scripts/massmove, by Ahecht themself, when in need. —CX Zoom[he/him] (let's talk • C • L) 14:58, 12 April 2022 (UTC)
- @Ahecht @CX Zoom Thank you. I was looking for some batch script or tool. Just found that Wikipedia:AutoWikiBrowser/User_manual#Start has option to move, but needs admin rights. Looks like WP:RM/TR would be the right place to find such an admin, willing to do it. --Venkat TL (talk) 14:47, 12 April 2022 (UTC)
the transfer of images from the Persian wiki to Wikipedia: Wikimedia Commons[edit]
There are several articles with a link to an original version with the image on wiki-farsi that are missing the image in the English version. These images are often easy to recognize for Iranians and they are published so often that most people take it for granted to reuse them. In other words, for many these are images that are allowed to be used in a wiki article by common sense. Yet in practice, not many people master the details of the order. When I asked for help from some veterans of the Persian wiki, it turned out that there are more than me who are struggling with the same problem. Is it possible to find a simpler solution to this; and possibly transfer multiple images in one run using someone who already masters the rules and practicality of the mechanism? Thank you for your attention Arbabi second (talk) 15:02, 12 April 2022 (UTC)
- @اربابی دوم: I'm not sure if I understand you correctly. You are saying that fawiki have some articles with images that their English versions don't; those images are considered to be freely licensed by most Iranians and you want to transfer them to Commons en masse? NguoiDungKhongDinhDanh 15:53, 12 April 2022 (UTC)
- @NguoiDungKhongDinhDanh:Yes, that is what I mean and I think many Iranians agree with me. These images are sometimes used under the fair use rule, for example Mahmoud Etemadzadeh (File: Behazin.jpg) can not be transferred directly. There are many such cases. If you upload the image on English-wlki, you get notice and some instructions that so far it has not been possible for me to fully understand, to the extent that I can make use of it.That English is not a language I master does not make things easier! Arbabi second (talk) 16:21, 12 April 2022 (UTC)
- @اربابی دوم: Here's a short answer: If the images are fair used, then they cannot be imported to Commons. See c:COM:FU. The fact that many people agree with you is simply not enough to override copyright rules. Wikipedia, and Wikimedia in a whole, is meant to be sharing free knowledge and resources, not piracy. NguoiDungKhongDinhDanh 16:40, 12 April 2022 (UTC)
- @NguoiDungKhongDinhDanh: I received your response, and I agree with you and the wiki strategy. It does not help much but thanks for that anyway. Arbabi second (talk) 16:54, 12 April 2022 (UTC)
- @اربابی دوم: Here's a short answer: If the images are fair used, then they cannot be imported to Commons. See c:COM:FU. The fact that many people agree with you is simply not enough to override copyright rules. Wikipedia, and Wikimedia in a whole, is meant to be sharing free knowledge and resources, not piracy. NguoiDungKhongDinhDanh 16:40, 12 April 2022 (UTC)
- @NguoiDungKhongDinhDanh:Yes, that is what I mean and I think many Iranians agree with me. These images are sometimes used under the fair use rule, for example Mahmoud Etemadzadeh (File: Behazin.jpg) can not be transferred directly. There are many such cases. If you upload the image on English-wlki, you get notice and some instructions that so far it has not been possible for me to fully understand, to the extent that I can make use of it.That English is not a language I master does not make things easier! Arbabi second (talk) 16:21, 12 April 2022 (UTC)
Turkmen Wikipedia[edit]
Hello, I did uploaded the template Infobox person to Turkmen Wikipedia (tk:Şablon:Şahsyýet, tk:Şablon:Şahsyýet/Wikidata). But there is a problem and I can not understand it, can someone help me to fix it? --TayfunEt. (talk) 09:44, 13 April 2022 (UTC)
- @TayfunEt.: Well, we can't really help you if you don't specify what problem it is. From what I can see, you removed the function name for some reason; may be that's the cause? NguoiDungKhongDinhDanh 10:58, 13 April 2022 (UTC)
@NguoiDungKhongDinhDanh: I removed because there saying The function does not exist, but I put back now. The template tk:Şablon:Şahsyýet, when I try to use it, there is saying the Module:ListOfProfessions not found, but I did put the tk:Module:ListOfProfessions to the Turkmen Wikipedia. TayfunEt. (talk) 12:39, 13 April 2022 (UTC)
- @TayfunEt.: The
ucfirst
is supposed to be defined in tk:Module:String2. Please see its counterpart here on English Wikipedia and update the module accordingly. NguoiDungKhongDinhDanh 14:09, 13 April 2022 (UTC)- Importing templates is complicated, but if you're going to do it, I suggest that all smaller Wikipedias consider looking at the Spanish and Russian-language infoboxes. They are more integrated with Wikidata, and very few smaller Wikipedias have enough people to do frequent updates on city populations or other basic information. Whatamidoing (WMF) (talk) 19:27, 13 April 2022 (UTC)
- Look at w:es:Jimmy Wales and w:ru:Jimmy Wales for an idea of how Wikidata can reduce the amount of work needed in each individual article. Whatamidoing (WMF) (talk) 19:30, 13 April 2022 (UTC)
- Importing templates is complicated, but if you're going to do it, I suggest that all smaller Wikipedias consider looking at the Spanish and Russian-language infoboxes. They are more integrated with Wikidata, and very few smaller Wikipedias have enough people to do frequent updates on city populations or other basic information. Whatamidoing (WMF) (talk) 19:27, 13 April 2022 (UTC)
- For Şablon:Şahsyýet/Wikidata there are a few more templates missing: if then show, infobox person/height, infobox person/weight, editonwikidata. Snævar (talk) 20:24, 13 April 2022 (UTC)
Question about user scripts[edit]
So, I am going to install AutoEd, but I need to know first since I usually edit on Safari mobile: do user scripts work on the mobile web version of Wikipedia, or at least AutoEd? And another question, how do you bypass your cache on mobile? Ididntknowausername(talk • contribs) 23:12, 13 April 2022 (UTC)
- @Ididntknowausername:, how to bypass your cache depends on your browser. I have used a few different mobile browsers over time, and currently ise safari, for which there is no easy way t do it quickly. As for only loading on desktop, you can set scripts to run in certain skins using Special:MyPage/skin.js. To load a scrip on all Skins, you use Special:MyPage/common.js. Happy Editing--IAmChaos 01:09, 14 April 2022 (UTC)
Random numbers in Module[edit]
Hello there, I am trying to create Module to generate random text when a page loads. I ran into a problem, the random numbers that generate the text don't change, so the text is the same each time. Is there any way to generate random numbers when the page loads? Your admirer AngryBiceps 09:19, 14 April 2022 (UTC)
- @AngryBiceps: See a working example here (on viwiki). Declare another table using the shuffle function, then assign
shuffled[n]
tooutputn
. NguoiDungKhongDinhDanh 10:04, 14 April 2022 (UTC)- @NguoiDungKhongDinhDanh it worked!!! Much thanks :) AngryBiceps (talk) 10:13, 14 April 2022 (UTC)
Can you echo yourself using JS/API?[edit]
mw:Notifications/Developer guide doesn't mention it. Is it even possible? https://en.wikipedia.org/w/api.php tells about "echomarkread", "echomarkseen" and "echomute" but nothing about how to echo yourself. I'm starting to think it can't be done, am I right? — Alexis Jazz (talk or ping me) 17:01, 14 April 2022 (UTC)
- The only workaround I can think of is the thank function, but you'd need to do it from an alt account. Certes (talk) 17:54, 14 April 2022 (UTC)
- Not to my knowledge. Would be convenient. See also T58362, which I believe may be blocked on the Echo refactor (merge into core), but don't quote me on that. Enterprisey (talk!) 20:37, 14 April 2022 (UTC)
Preventing wrapping with references[edit]
From the short discussion here. It seems references can wrap in a somewhat unsightly way at line breaks. (Try resizing the window on User:Ovinus/sandbox, and I can provide screenshots if that would be helpful.) I'm on macOS and it occurs in Firefox, but not in Chrome. Is there any way to prevent this without {{nowrap}} and the like? Ovinus (talk) 01:43, 15 April 2022 (UTC)
- @Ovinus: No, and see Wikipedia talk:Manual of Style#Footnotes and line wrapping issue.
{{nowrap}}
should not be used for this. --Redrose64 🌹 (talk) 22:22, 15 April 2022 (UTC)
Can we control images shown by Wikipedia app when searching?[edit]
I found an iOS Wikipedia app to test a report at Talk:Anal sex#Safe search options. Sure enough, a good way to find Anaesthesia is to type "ana" in the Search Wikipedia box. Doing that shows a list of matches and the second item is Anal sex, helpfully illustrated with the lead image. That is, typing "ana" causes the app to show File:Wiki-analsex.png. Is there a way to mark an image as not suitable for display during a search? Has this been discussed before? I found August 2015. Johnuniq (talk) 01:45, 15 April 2022 (UTC)
- It boggles the mind that MediaWiki:Bad image list isn't supported here. —Cryptic 02:05, 15 April 2022 (UTC)
- Johnuniq, this only work on Minerva I think? The majority of thumbnails seems to be useless anyway due to high compression. Another example WMF developers implementing stuff without giving it second thought. (sadly I've seen this way too often) Do you think "Search ignores MediaWiki:Bad image list, showing NSFW to children looking for Anaheim, California" is a catchy name for a Phabricator task? I thought it was. — Alexis Jazz (talk or ping me) 11:45, 15 April 2022 (UTC)
Recent software upgrade[edit]

In regard to this recent software upgrade, I've opened an inquiry at mw:Talk:MediaWiki 1.39/wmf.7#Template stopped working on enwiki, because at least one template has stopped working: {{If mobile}} no longer renders text in mobile view. This should be fixed and I have no idea how. Makes me wonder what else has been broken? P.I. Ellsworth - ed. put'r there 02:46, 15 April 2022 (UTC)
- This week's deployment made a change to how we remove some things from content HTML on mobile. Specifically, as it affected this template, we now only outright-remove things with the nomobile class in content namespaces. If_mobile/styles.css used a selector to control the visibility of the mobile-only text that relied on that complete-removal (it basically said "if I'm the second element here, hide me"). I went in and edited the template's CSS so that it does something less fragile, though because of TemplateStyles' restrictions it's not going to be 100% equivalent as there's no perfect proxy available for "the MobileFrontend transforms ran". DLynch (WMF) (talk) 16:25, 16 April 2022 (UTC)
Janie Fricke[edit]
Can someone help me with the {{infobox person}} on Janie Fricke? For some reason, the {{infobox musical artist}} content isn't displaying inside of it and I can't figure out for the life of me what's going on. Ten Pound Hammer • (What did I screw up now?) 04:32, 15 April 2022 (UTC)
Fixed The problem was that the {{ubl}} listing her marriages was never properly closed and swallowed the rest of the infobox. * Pppery * it has begun... 04:35, 15 April 2022 (UTC)
Speedy deletion category counts[edit]
Hey, Village Pump Technical folks,
I wish I knew of a better place to request this. But the CSD category counts are off again, at least on 7 or 8 of the categories that indicate that they contain pages but that are actually empty. I'm not sure what to do when this happens, is there a "clear" or "reset" code you can run that would make them accurate again? This has been going on for weeks but now it's happening to more than one category so that has prompted this request for help. Thanks for any tech help you can supply! Liz Read! Talk! 05:10, 15 April 2022 (UTC)
- As of mid-February, purging them is supposed to force a recount. That hasn't fixed any of Category:Candidates for speedy deletion as blatant NOTWEBHOST violations, Category:Candidates for speedy deletion as copyright violations, or Category:Candidates for speedy deletion as vandalism (as displayed on {{CSD-categories}}) for me. —Cryptic 06:19, 15 April 2022 (UTC)
- All three of those had rows in categorylinks without corresponding rows in page (quarry:query/63804). I was able to figure out which page was the problem for CAT:U5 from cl_sortkey_prefix, and restoring and redeleting User:Dronar (Composer)/sandbox fixed it. For the others, well, the only way I know how to get a page title of a deleted page from its old page_id is slow. Working on it. —Cryptic 06:46, 15 April 2022 (UTC)
- It worked for the first three pages I tried. No luck with Draft:The economic state of the PIGS after the financial crisis, previously known as page_id 70437379 - unlike the other three, restoring it gave it a new id. No idea why. I'm not going to try for the seven in Category:Candidates for speedy deletion as spam, lest I break things further. —Cryptic 07:10, 15 April 2022 (UTC)
- Keeping maintainance categories up to date is possible, but the issue is that the developers have thought the issue is about every single category on the wiki. You would have to be an Wikipedian to read between the lines to see that is not the expectation. There is (obviously) more effort to keep every single category updated with an small delay compared to only the maintainance ones. I clarified this in phab:T221795.--Snævar (talk) 07:41, 15 April 2022 (UTC)
Bad UX at Special:Upload: it allows you to upload badly-licensed files and tags them for speedy, instead of blocking the upload[edit]
(I don’t know if that’s the right place to ask, tell me if you have a better idea.)
One uses Special:Upload to upload image and other media files to en-wp without putting them on Commons. This is used mostly for non-free files that comply with WP:NFCC, which have no free license compatible with Commons.
In that interface, there is a long dropdown list of licensing information. Some of the options are "I do not know the license", "The copyright holder gave me permission to use this work only on Wikipedia articles", etc. Those options have the effect of adding a big red template and (I suppose) listing the file for speedy deletion. Here’s an example upload. We had a question recently at the Teahouse of a new user who uploaded a file under one of those bad licensing options, then their file got speedy-deleted (no surprise here).
To me, that seems like bad user experience for the newbies, and more workload for the deleting admins. A license valid "only for Wikipedia articles" is a non-fixable problem so there is little point in posting the image, the probability of deletion after that is 100%. ("I do not know the license" is different, those might be salvageable.) Why not reject the upload with a an information page / popup / whatever telling that the file cannot be uploaded? (The warning template does get previewed in the upload page, but no newbie reads templates anyway.) TigraanClick here for my talk page ("private" contact) 09:54, 15 April 2022 (UTC)
- The problem is that the audience just doesn't understand copyright and we can't explain it to them any further then we already do on that page. But ppl are 'completionists'. They have a goal (I want to use this image) and want to fulfil that goal, irrespective of rules (esp rules that most other platforms do not have). So by giving them an honest answer to fill in, we avoid them lying and simply choosing something that is going to lead to license washing. This makes it easier on admins, as they don't get a ton more images which are incorrectly licensed but harder to filter out from the properly licensed material. The interface for Special:Upload is currently 'dumb', so while preventing the upload is possible, someone would have to write JS to intercept the form submission and explain it to the user (after which the user is still likely to try again and lie btw). —TheDJ (talk • contribs) 10:24, 15 April 2022 (UTC)
- Even "The copyright holder gave me permission to use this work only on Wikipedia articles" might be salvageable. An owner might release a work with a WP-compatible free licence, an editor might ask the owner (through either politeness or ignorance) "is it OK if I use that on Wikipedia?" and select that option, when wider permission already existed. Certes (talk) 11:03, 15 April 2022 (UTC)
Category:Pages which use score[edit]
This seems to be an automated maintenance category about the score extension, which should be bluelinked and turned into a hidden category? Or the software should be changed to give it a better name? Posting here because I lack the technical background knowledge to write a proper category description page. —Kusma (talk) 15:47, 15 April 2022 (UTC)
Load variable in global.js[edit]
Hi, I've come across a strange behavioral difference between common.js on the local wiki and global.js on meta. Let's say I have in my common.js on enwp the following code:
mw.loader.load('http://127.0.0.1:5500/wikipediatest.js'); // Web server
var testConfig = 'a';
Then, if the script on the web server has the following code
console.log(typeof testConfig === 'undefined');
it returns false. This means the variable is loaded from common.js.
But, if the code is in global.js on meta, it returns true. Any idea why this happens and how to successfully load variables from global.js, just like from the local common.js? Any help would be appreciated.--Dragoniez (talk) 19:34, 15 April 2022 (UTC)
- @Dragoniez: You had the variable declared in both your common and global.js at the same time, not? NguoiDungKhongDinhDanh 20:13, 15 April 2022 (UTC)
- It appears it's because global.js is run in its own scope while common.js is run in the global scope. Try
window.testConfig
instead. Nardog (talk) 22:40, 15 April 2022 (UTC)- Thank you so much for your comments, both of you two. @Nardog: that was it! I was completely stuck, so you saved me a lot of my time. Much obliged. @NguoiDungKhongDinhDanh: I also appreciate your help. Now my script works, and I know you're a global rollbacker, so you might want to check out my new script for rollback (m:User:Dragoniez/Selective Rollback). --Dragoniez (talk) 03:07, 16 April 2022 (UTC)
- @Dragoniez: I haven't try it yet, but I'm pretty sure that
isInGlobalGroup('Global_rollback')
will always returnfalse
since the group, among others, was renamed in 2014. NguoiDungKhongDinhDanh 03:16, 16 April 2022 (UTC) - Also, why
isInArray()
? The built-in methodArray.prototype.includes
exists for that purpose. NguoiDungKhongDinhDanh 03:21, 16 April 2022 (UTC)- @NguoiDungKhongDinhDanh: I actually didn't (and in fact couldn't) test that because I don't have the flag but "Global_rollback" seems to be working in m:User:Hoo man/smart rollback.js. I'd have to wait for a feedback from someone. As for Array.prototype.includes, it's just for the sake of browser compatibility (because the method is a ES7 feature). I could also just use $.inArray, but I don't think this is something that must be criticized. --Dragoniez (talk) 03:30, 16 April 2022 (UTC)
- @Dragoniez: I haven't try it yet, but I'm pretty sure that
- Thank you so much for your comments, both of you two. @Nardog: that was it! I was completely stuck, so you saved me a lot of my time. Much obliged. @NguoiDungKhongDinhDanh: I also appreciate your help. Now my script works, and I know you're a global rollbacker, so you might want to check out my new script for rollback (m:User:Dragoniez/Selective Rollback). --Dragoniez (talk) 03:07, 16 April 2022 (UTC)
@Dragoniez: That script was mostly written in 2010–2013 and has become outdated. It is still useful, but I'd suggest a complete rewrite. NguoiDungKhongDinhDanh 04:05, 16 April 2022 (UTC)
A toolforge tool doesn't open for me[edit]
Hi all, I have some serious issues trying to open [wikinav.toolforge.org]. It simply shows me a blank white screen with nothing to look at. It's been happening ever since I first came across this site about 3–4 weeks ago. So far, this is the only toolforge site that acts as such. As several editors have pointed out to clickstream data from this site during the course of RMs, I think it'll be very helpful to me to have access to it. Any help to get it opened would be appreciated. Thanks! —CX Zoom[he/him] (let's talk • C • L) 11:16, 16 April 2022 (UTC)
- I get the screen but "An error occurred while fetching data for the current title. Try another one.". Trying another one doesn't help. Shame, it's been a very useful tool for me too. Certes (talk) 12:06, 16 April 2022 (UTC)
- Just turn off your adblocker for toolforge.org domain. – SD0001 (talk) 16:11, 16 April 2022 (UTC)
- Thanks but that didn't seem to help, and nor does using wget to avoid browsers completely. Certes (talk) 16:40, 16 April 2022 (UTC)
- I never keep ad blocker on. Also, other toolforge tools seem to be working for me. —CX Zoom[he/him] (let's talk • C • L) 17:05, 16 April 2022 (UTC)
- It works on most pages for me. I'm having problems with https://wikinav.toolforge.org/?language=en&title=Nazir_Ali but this may because the page was moved during the month currently reported (March 2022). https://wikinav.toolforge.org/?language=en&title=Nazir_Afzal and https://wikinav.toolforge.org/?language=en&title=Mercury work correctly for me, so I'm representing the space properly and it's not a problem specific to dabs. (Turning on my adblocker can break either of those, depending how I configure it.) Certes (talk) 17:17, 16 April 2022 (UTC)
- My issues are with the whole tool. All of the above-mentioned links (and each one I come across in RM discussions) are just a white sheet of paper for me. —CX Zoom[he/him] (let's talk • C • L) 17:20, 16 April 2022 (UTC)
- It works on most pages for me. I'm having problems with https://wikinav.toolforge.org/?language=en&title=Nazir_Ali but this may because the page was moved during the month currently reported (March 2022). https://wikinav.toolforge.org/?language=en&title=Nazir_Afzal and https://wikinav.toolforge.org/?language=en&title=Mercury work correctly for me, so I'm representing the space properly and it's not a problem specific to dabs. (Turning on my adblocker can break either of those, depending how I configure it.) Certes (talk) 17:17, 16 April 2022 (UTC)
- Just turn off your adblocker for toolforge.org domain. – SD0001 (talk) 16:11, 16 April 2022 (UTC)
- What is your browser and operating system? Izno (talk) 21:31, 16 April 2022 (UTC)
Issues with efn template and external links[edit]
Hello,
I am having an issue with the efn template. The following code renders text:
- {{efn|Also on the [https://digi.kansalliskirjasto.fi/sanomalehti/binding/573741 30 April 1892 program] were, among others, compositions by [[Armas Järnefelt]] (''Lyrical Overture'', 1892), [[Robert Kajanus]] (''Finnish Rhapsody No. 1'', 1881), [[Fredrick Pacius]] (''[[Maamme|Vårt land]]'', 1848), and [[Martin Wegelius]] (''Daniel Hjort Overture'', 1872).}}
The following code, which is preferred because it would take the reader to the proper page of the PDF, does not render text (difference is highlighted):
- {{efn|Also on the [https://digi.kansalliskirjasto.fi/sanomalehti/binding/573741?term=Sibelius&term=Kullervo&page=2 30 April 1892 program] were, among others, compositions by [[Armas Järnefelt]] (''Lyrical Overture'', 1892), [[Robert Kajanus]] (''Finnish Rhapsody No. 1'', 1881), [[Fredrick Pacius]] (''[[Maamme|Vårt land]]'', 1848), and [[Martin Wegelius]] (''Daniel Hjort Overture'', 1872).}}
Any ideas on what I am doing incorrectly? Thanks, ~ Silence of Järvenpää (talk) 18:56, 16 April 2022 (UTC)
- The one that doesn't render has an
=
sign which makes everything ahead of it a parameter name. Try{{efn|1=Also on the [https://digi.kansalliskirjasto.fi/sanomalehti/binding/573741?term=Sibelius&term=Kullervo&page=2 30 April 1892 program] were, among others, compositions by [[Armas Järnefelt]] (''Lyrical Overture'', 1892), [[Robert Kajanus]] (''Finnish Rhapsody No. 1'', 1881), [[Fredrick Pacius]] (''[[Maamme|Vårt land]]'', 1848), and [[Martin Wegelius]] (''Daniel Hjort Overture'', 1872).}}
- —Trappist the monk (talk) 19:05, 16 April 2022 (UTC)
- @Silence of Järvenpää: Since the url contains
=
, you need to give the first parameter a name, like this:{{efn|1=etc.}}
. NguoiDungKhongDinhDanh 19:10, 16 April 2022 (UTC)- Trappist the monk, NguoiDungKhongDinhDanh ... that solution works. Thanks! ~ Silence of Järvenpää (talk) 19:16, 16 April 2022 (UTC)
Match Infobox parameter[edit]
I want to do something like
{{#invoke:string|match|s={{:David Brearley}}|pattern={{!}} *successor *= *([^%n]*)}}
but that gives String Module Error: Match not found ({{#invoke:string|match}} seems to substitute all templates recursively). ― Qwerfjkltalk 21:08, 16 April 2022 (UTC)
- When a module meets some transcluded content inside itself, that content is expanded first and then the module finishes running. I would suspect your error is looking for
{{!}}
instead of its character representation. Izno (talk) 21:33, 16 April 2022 (UTC){{#invoke:string|match|s={{:David Brearley}}|pattern=successor *= *([^%n]*)}}
also throws an error. Qwerfjkl's right: All templates are expanded recursively before matching. See ExpandTemplates result for{{#invoke:string|match|s={{:David Brearley}}|pattern=<table class="[%w ]+"}}
. NguoiDungKhongDinhDanh 21:40, 16 April 2022 (UTC)- NguoiDungKhongDinhDanh: substituting it, however, works, which is fine for my purposes. Qwerfjkltalk 21:52, 16 April 2022 (UTC)
- @Qwerfjkl: Not really. It gives
[[Robert Morris (judge)|Robert Morris]]\n| pro
. NguoiDungKhongDinhDanh 21:57, 16 April 2022 (UTC)
- @Qwerfjkl: Not really. It gives
- NguoiDungKhongDinhDanh: substituting it, however, works, which is fine for my purposes. Qwerfjkltalk 21:52, 16 April 2022 (UTC)
- Also, %n in Lua
means the nth match, and you have no previous matchesisn't special and just matches "n", but (for the reasons Izno just stated) it doesn't work with \n either. An alternative way to do this is with{{Template parameter value|David Brearley|Infobox officeholder|1|successor}}
= Robert Morris. Certes (talk) 21:41, 16 April 2022 (UTC)