Commons:Village pump/Technical/Archive/2024/04

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Table of contents

Can someone figure out why {{CategoryTOC}} doesn't work on this page: Category:EC-Audiovisual_Center_review_needed, and fix it. Thank you! // sikander { talk } 🦖 17:57, 1 April 2024 (UTC)

@Sikander: As far as I can tell, the horizontal Category TOC on that page is working fine. I tried several different browsers as well as both logged in and logged out. I suspect the issue is at your end, perhaps try emptying your browser cache. —RP88 (talk) 18:03, 1 April 2024 (UTC)
It looks for subcategories, but you want files: try Template:FileCategoryTOC. Enhancing999 (talk) 18:04, 1 April 2024 (UTC)
Actually, no. It's just that they are all sorted under "0-9". Enhancing999 (talk) 18:08, 1 April 2024 (UTC)
Sort through Template:LicenseReview/layout-reviewme is by pageid. Enhancing999 (talk) 18:15, 1 April 2024 (UTC)
Ah, seeing Enhancing999's replies led me to think what you might have meant by "doesn't work". In my reply I was saying that I saw {{CategoryTOC}} correctly displaying and working exactly as intended (but apparently not how you probably expected). As Enhancing999 implied, the template {{EC-Audiovisual Center}} invokes {{LicenseReview}}, which (while in the needs review state) uses Template:LicenseReview/layout-reviewme, which sets [[Category:EC-Audiovisual Center review needed|< PAGEID >]]. So the files in this particular category are sorted by their page id, like all other license review needed categories. —RP88 (talk) 18:43, 1 April 2024 (UTC)
@RP88 and Enhancing999: Ah, sorry for creating some confusion here. My intention is to navigate the contents of Category:EC-Audiovisual_Center_review_needed category by file name and thought {{CategoryTOC}} would work. {{FileCategoryTOC}} is also not doing what I thought it would. Any other suggestions? Thank you. // sikander { talk } 🦖 19:30, 1 April 2024 (UTC)
Hmm... depending on what exactly you want to do, you might be able to use Special:Search with incategory:"EC-Audiovisual Center review needed" and then adjust the advanced search fields. This won't get you an alphabetically ordered list, but it would let you search the contents of the category. —RP88 (talk) 20:13, 1 April 2024 (UTC)
Template:LRCategoryTOC has some logic for this type of category. Enhancing999 (talk) 21:13, 1 April 2024 (UTC)

Tech News: 2024-14

MediaWiki message delivery 03:33, 2 April 2024 (UTC)

why does the time scale end in the 49th century BC?

compare for example Romania in the 35th century BC to Romania in the 54th century BC. I couldn'd find out the lack. anro (talk) 21:18, 2 April 2024 (UTC)

On an immediate level, that's because the {{Subject by century}} template (which is used to implement templates like {{Centuries BC in Romania}}) only runs from the 50th century BC to the 25th century CE. It will not display categories which lie outside those bounds.
Realistically, the use of year-based categories for time periods well outside recorded history like "49th century BC" may not be appropriate, as the margin of error on dates that far back is often wider than a century. (Nor am I convinced that it's correct to describe subjects like the Turdaș culture as being "in Romania" over five thousand years before any such country existed.) Omphalographer (talk) 00:02, 4 April 2024 (UTC)

Viewer to highlight topic on annotated files in category (sample: mountain panoramas)

Category:Plattenhörner (Vereina) has several photos with the two summits "Plattenhörner" annotated. I think it could be interesting to have a viewer that allows to view that annotated on all files at once, ideally with larger versions of the photos. @Kuhni74 fyi. Enhancing999 (talk) 09:15, 7 April 2024 (UTC)

Tech News: 2024-15

MediaWiki message delivery 23:34, 8 April 2024 (UTC)

How do I flag my bot’s edits as coming from a bot?

I'm the operator of the bot User:FlickypediaBackfillrBot. I've been through the bot approval process and it was approved by User:Krd in March. The user appears in the list of bots on Special:ListUsers.

I'm using the wbeditentity API and setting the bot=1 query parameter like it suggests, but the edits aren't being flagged as bot edits. This means that when I run the bot, the edits can overwhelm people’s watch lists (see feedback here: User talk:FlickypediaBackfillrBot#BOT flag).

I notice the wbeditentity API says This URL flag will only be respected if the user belongs to the group "Bots" – but this user is part of the "Bots" user group, isn't it?

I've extracted a minimal version of the code here, and you can see me setting the bot=1 parameter on L28: https://gist.github.com/alexwlchan/0acdb92d2e94a1c47d54fcef5b3e1fe9 I got this by looking at the equivalent code in mwclient.

Is this a bug in my code, or is there some other step in the bot approval procedure that I’ve missed? Alexwlchan (talk) 11:54, 10 April 2024 (UTC)

@Alexwlchan, i tried to replicate the problem and by using pywikibot your post parameters are looking good. Maybe one thing what you could try is to check if the bot flag is working when you are doing edits through pywikibot? (to see if there is some problem with the user rights. Though afaik bot flag should be working.)
My example code
Running the code‎
:python3 -m venv ./venv
:source venv/bin/activate
:pip install pywikibot
:echo "usernames['commons']['commons'] = 'YourBotUserName'" > user-config.py
:python editcaption.py
:‎
-- Zache (talk) 12:48, 11 April 2024 (UTC)
Also, you can use Quarry to check if the edits are bot flagged (example: https://quarry.wmcloud.org/query/81935 ) -- Zache (talk) 12:49, 11 April 2024 (UTC)
Thanks User:Zache!
If I run your code, I do see my edits showing up with the bot flag, so it must be a bug on my side. I'll have a look through the pywikibot code to understand what I’m doing differently and find my mistake. Alexwlchan (talk) 13:30, 11 April 2024 (UTC)
Right, the issue seems to be how I'm authenticating – I'm using a Personal API token whereas the Pywikibot code is using some login cookies to make its request. I think I need to take a closer look at my auth code. :) Alexwlchan (talk) 15:20, 11 April 2024 (UTC)
For the sake of future readers: one of the key steps in debugging was observing the HTTP requests made by pywikibot. I've written about how I did that here: https://alexwlchan.net/til/2024/how-to-see-pywikibot-http-requests/ Alexwlchan (talk) 15:34, 12 April 2024 (UTC)
Thank you for the debugging example! --Zache (talk) 17:40, 12 April 2024 (UTC)

Is there any way to get a list of users who uploaded images which appear in a Commons category?

Hi all

I'm working on some documentation around organising photography events and competitions and would really like to find a way to do this e.g I want to get a list of all the user names of uploaders for all the images in the category and all subcategories for Category:Potatoes. It would be a way to understand who is interested in the topic. I have a feeling this info might also be really useful for people who run the Wiki Loves photo competitions as well e.g 'this many people took part this year' although they may have other ways to do this.

Any suggestions would be really appreciated.

Thanks very much

John Cummings (talk) 09:16, 8 April 2024 (UTC)

@John Cummings: It’s possible using the API: query+imageinfo can be used to get uploaders from a given category (but not subcategories), and query+categorymembers can be used to get the direct subcategories of a category. I don’t know about any ready-to-use user-friendly solutions. —Tacsipacsi (talk) 19:33, 14 April 2024 (UTC)

Tech News: 2024-16

MediaWiki message delivery 23:26, 15 April 2024 (UTC)

Module:Autotranslate was altered today to use more efficient test for presence of a language subtemplate. The new version was tested extensively, but please be on a lookout for any issues with templates using it. Please ping me if any issues are found or suspected. Jarekt (talk) 13:34, 18 April 2024 (UTC)

Tech News: 2024-17

MediaWiki message delivery 20:25, 22 April 2024 (UTC)

Mobile versions of user talk pages are useless

Though I'm not active on Commons, I got bored and used my mobile device to look through some deletion requests, then at at a user's talk page. I knew that user had several deletion requests, but saw only one on their talk page. The talk page's history showed that old sections were archived, which was fine, but the page seemed to have no links to those archives.

I couldn't find the 'Read as wiki page' (or whatever it is) option, so out of desperation, I switched to the desktop version of the page. I was shocked at what I found there: not only the archive links, but also a notice that the user had been blocked indefinitely. (Before that, I hadn't seen any reference to a block.)

In summary, the mobile versions of user talk pages (and perhaps talk pages in general) are so crippled as to be useless. Brianjd (talk) 08:22, 4 April 2024 (UTC)

Yes, the mobile experience has always been really bad and as someone who basically exclusively edits with a mobile device it's not a fun experience. The worst part is that in most of the developing world the vast majority of people who surf the web do so using a mobile device. Not too long ago the experience of talk pages on mobile devices wasn't this bad, but they basically made it worse during an update a few months ago. After many, many years of neglecting the mobile experience I sincerely doubt that the developers are planning on fixing it anytime soon. --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 10:47, 9 April 2024 (UTC)
should mobile view on Commons be deactivated? Enhancing999 (talk) 15:18, 17 April 2024 (UTC)
That might go to far, to be honest, the best solution would be to make the mobile version identical to the desktop version but tailored for smaller screens, though the Wikimedia Foundation (WMF) have confirmed multiple times that they will not do that. I have no idea why they insist on delivering an inferior and often infuriating experience to us mobile users, but there doesn't seem to be much we can do about it. De-activating it would break more than it would fix. --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 15:44, 17 April 2024 (UTC)
I wonder what there is to break. Consider file description pages: mobile version lacks have of the content (categories).
I think the skin running on each WMF site is determined by the communities. Accordingly, e.g. dewiki doesn't use the same as enwiki, as they consider it not suitable. Enhancing999 (talk) 15:49, 17 April 2024 (UTC)
@Enhancing999 If you login in mobile view, select settings from top right menu and then toggle Advanced mode to be enabled then the categories are visible. --Zache (talk) 17:37, 17 April 2024 (UTC)
I don't think it's available without login. We could keep the default mobile view from logged in users who require it (e.g. WMF staff for testing purposes). Enhancing999 (talk) 18:14, 17 April 2024 (UTC)
Yes, this "solution" only works if you have a Wikimedia SUL account and happen to know where to find the button to enable it. Imagine you're a re-user looking for similar images (or other files) from a certain category and can't figure out how to do that. Most people surf the web on mobile devices these days, this is especially true for people from developing countries. When I was in the rural Philippines a few weeks ago I met several people who have never worked with or used a laptop or desktop computer in their lives but all use smartphones, even homeless people have smartphones, these are the most affordable internet-connected devices for most people in the world. Yet, for whatever reason "the mobile experience" of Wikimedia websites is beyond bad. If possible we should put it to a vote to show the MediaWiki developers that we don't want to suppress vital information for a major part of the audience. Files are for re-users and if they can't find the files then there's something seriously wrong with the system. --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 18:34, 17 April 2024 (UTC)
I have been impression that "advanced mode" is for things in beta testing, not ready for primetime, for whatever reason. We could though ask what are plans to primetime it. --Zache (talk) 18:40, 17 April 2024 (UTC)
In mobile view parent categories aren't even visible. How useful can that be? Enhancing999 (talk) 19:34, 17 April 2024 (UTC)
@Donald Trung, Please, provide the link here to any question "put to a vote." Thanks, -- Ooligan (talk) 17:49, 23 April 2024 (UTC)

Deletions on "structured tab"

Anybody know if the feature is still being maintained? I reported a problem a while back about the impossibly to remove wrong statements, but it's still broken. Enhancing999 (talk) 07:44, 20 April 2024 (UTC)

Just to confirming. Your are referring to the coordinate deletion problem described in phab:T313638 or is there some other bug? -- Zache (talk) 16:08, 20 April 2024 (UTC)
It's the problem noted here in January 2023 (more than a year ago): Commons:Village_pump/Technical/Archive/2023/01#Delete_wrong_coordinates_not_working. Any idea why nothing happened? Enhancing999 (talk) 14:40, 23 April 2024 (UTC)