Template talk:Portal

Page contents not supported in other languages.
From hodl

Template:Talkheader Template:Permprot Template:Central Template:WikiProject Portals User:MiszaBot/configUser:HBC Archive Indexerbot/OptIn

Purge images from deleted portals?

Have a look at Template:Portal/doc/all. The vast majority of the images here are for non-existent portals. Would there be any objections if I did a mass purge of these? --Trialpears (talk) 03:39, 3 March 2023 (UTC)

Support removal: it would make the Portal module more efficient, with no loss of functionality.hike395 (talk) 05:41, 3 March 2023 (UTC)
Support but please beware that some redlinks correspond to actual portals, e.g. South africa portal refers to Portal:South Africa. In theory, the best way to do this might be a Lua change to have _displayAll check for portal names in various captialisations, but that would require more than 500 expensive function calls. Could we be more radical and fix the case once in Module:Portal/images/a etc., then have the module lowercase the text if necessary? As an aside, so few portals survived the 2019 cull that we might be able to consolidate them into one module rather than about 26. Certes (talk) 11:12, 3 March 2023 (UTC)
Whoops, Certes is correct -- we need to clean up Template:Portal/doc/all to show the correct set of portals, otherwise we will be removing images from existing portals. Template:Ping Can you hold off for a while while we figure out how to clean this up? — hike395 (talk) 12:23, 3 March 2023 (UTC)
Template:Suggestion --- there may be an easier way to do a one-time cleanup without changing code in Module:Portal. Someone (Trialpears?) could download Wikiget, generate a list of all non-redirect pages in the Portal namespace, then write a little bit of code that filters the lines in all of the Module:Portal/images files, keeping only those that case-insensitively match something in the list.
I'm very busy IRL, so I wouldn't be able to get to this for a while. But it should be relatively easy to do. As an extra bonus, if we did want to fix TEmplate:Portal/doc/all, we could use this cleanup to put case-sensitive portal names into Module:Portal/images. But the cut-over to that could cause user-visible disruption. — hike395 (talk) 13:12, 3 March 2023 (UTC)
My plan was to use some regex and {{#ifexist:}} parser functions to remove all the bad rows. It's more complicated though in light of Moxy's comment. --Trialpears (talk) 16:18, 3 March 2023 (UTC)
Opposed Would this blank other templates usage??? If i am correct these images are used for more then just portals like Template:WPbox and Template:WPBannerMeta and Template:WikiProject task force box and Template:Regional notice board box.Moxy- 14:55, 3 March 2023 (UTC)
Based on this and this search it's used through portal related templates it's only used on a limited amount of portal templates, {{yytab}}, {{yyp}}, {{yywp}}, {{yynb}}, {{User WP/switch}}, {{Regional notice board box/1}}, {{WPbox/1}}, {{WPBannerMeta/templatepage}}, {{WikiProject work group box}}, {{WikiProject task force box}}. That's quite a few templates and straight up removal of all deleted portals isn't an option. I'll have a think about how to handle this. I think I may have some clever ideas to check that it's unused as well, but if that doesn't work I won't do it. --Trialpears (talk) 16:15, 3 March 2023 (UTC)
I've implemented a tracking category in the sandbox. It's a bit unconventional to not break the image, but it works as can be seen at User:Trialpears/sandbox/1. I plan to implement the category when I have time to monitor it properly. --Trialpears (talk) 12:58, 4 March 2023 (UTC)
Template:Ping I don't think the tracking as written in the sandbox will accomplish your goal:
  • A large fraction of the deleted portals have been removed from namespace. Those will never get picked up by tracking, because you cannot add categories to template invocations that don't happen. Module:Portal already tracks redlinks invocations (see line 155) in Category:Portal templates with redlinked portals, which is mostly populated by bugs in templates less-experienced editors guessing at names of portals.
  • Conversely, this tracking isn't limited to main space, so it could pick up junk from files list Template:Portal/doc/all, which have links to lower case portals. Per Certes, those are not deleted: they never existed in the first place.
You're going to need to create the set of (All portal images) \ (Portal images that are used). The only way I know how to do that is externally to Wikipedia, using software. — hike395 (talk) 15:24, 4 March 2023 (UTC)
@Hike395 I think we're looking for different sets here. The set the tracking category is generating is the set of all pages using a portal image corresponding to a deleted portal. This set is hopefully small enough to fairly manually get the set of all unused portal images corresponding to a deleted portal which is the set that I believe should be removed. --Trialpears (talk) 20:23, 4 March 2023 (UTC)
Support removal. This is a complete joke that most of this template is deleted portals. Gonnym (talk) 16:28, 3 March 2023 (UTC)
I've made a quick and nasty hack of a report at User:Certes/Reports/Portals. It only shows the first 500 portals. Certes (talk) 18:40, 3 March 2023 (UTC)

Automated filtering

I got a first cut at automated filtering working, by parsing a database dump of all files in the Portal namespace, and using that to filter lines Module:Portal/images/a The output of the filter is Module:Portal/images/a/sandbox. Can editors check to see whether this is correct? — hike395 (talk) 21:45, 4 March 2023 (UTC)

I ran the automated script and generated all of the Module:Portal/images/*/sandbox files, PTAL. I'm going to look at the existing test cases for anything anomalous. If everything looks ok, I will promote a/sandbox to a and create a new tracking category to check for problems. — hike395 (talk) 22:33, 4 March 2023 (UTC)
You're only looking in portal space and hence missing a bunch of uses outside that namespace. Take for example the links from Albanian Regional noice board boxes. I'm generally more for finding issues before they come up than fixing afterwards, especially when working with a template used 6 million times. Do you have any issues with my tracking category or could I implement it so we can see how common usage of files associated with deleted portals is? --Trialpears (talk) 01:53, 5 March 2023 (UTC)
Template:Ping You can go ahead and implement your tracking category. Both Module:Portal-inline and Module:Portal bar call the image() function in Module:Portal, so please check that Template:Portal-inline/testcases and Template:Portal bar/testcases continue to work.
Given that line 155 in checkPortals() is called from all three of Module:Portal, Module:Portal-inline, and Module:Portal bar, and given that function suppressed redlinks (line 164) by default in all three modules, I think you're going to find very few deleted Portals via image(), unless they are coming from {{WPbox}} or {{NBbox}} or similar.
My plan was to try to my filtering on a small fraction of Portals (like those starting with "a", or we can pick an even less common letter). I'm not tracking non-existent portals, I'm tracking the use of failure to find a portal image. When my modified lists go live and if there are a small number of extra failures, I would go and understand and fix them. If there's a large number, I would revert.
You're right that my filtering was based on a database dump of Portal space. I can also add a list of WikiProjects and Notice Boards to the "allow" list and regenerate the filtered a-z lists, and add lookup failure tracking to the image() function, too.
But there is some risk that I've screwed up and would have to revert. The downside would be some amount of time where there are extra puzzle piece portal icons when there shouldn't be. I've spot-checked my lists and they seem to be ok. (Although, as you point out, Albania got filtered out, so that's wrong).
hike395 (talk) 07:13, 5 March 2023 (UTC)
Alright, Category:Usage of portal image for non-existent portal is live and working. Looks like we're not missing anything major and if we don't remove countries and a few other random items it will be fine. We will have to wait a while for it to populate completely though. --Trialpears (talk) 14:18, 5 March 2023 (UTC)
Template:Ping Your clever hack at line 289 of Module:Portal made me realize a much safer way of filtering the portal images. Instead of removing them of Module:Portal/images/*, we can just add |category=[[Category:Pages with deprecated portal image]] to the lines we want to remove. If those show up anywhere in WP, then we remove the category tag from the corresponding line. When that category is empty, it's safe to remove all of the marked lines, with zero user disruption.
To clarify: were you thinking that the entries corresponding to the items in Category:Usage of portal image for non-existent portal should be added to the "allow" list? — hike395 (talk) 18:36, 5 March 2023 (UTC)
I had the same thought when implementing it, but that sadly won't work because of the border parameter at line 285 would strip it. I was indeed thinking that Category:Usage of portal image for non-existent portal could be used to form an allow list or possibly split those out to form a new WikiProject image list. --Trialpears (talk) 18:43, 5 March 2023 (UTC)
Template:Ping Line 285 is overly strict -- it should just be filtering "border", not all other arguments. I can fix to allow categorization of stored images. btw, is your use of |category= arbitrary? I don't think the image syntax looks for "category" specifically, this is just an unused parameter? Or is there something magical going on? — hike395 (talk) 15:58, 7 March 2023 (UTC)
Logically that is correct, but I'm worried that this is a scenario where the current behavior is relied upon (relevant xkcd). Ignoring |category= only wouldn't risk destroying --Trialpears (talk) 03:21, 8 March 2023 (UTC)
Fair point. I added a parser for "category=" in the sandbox at line 288, tests pass (including new tests at Template:Portal image/testcases, see "xtestx"). PTAL: if it's ok, I can make it go live. — hike395 (talk) 11:36, 8 March 2023 (UTC)
I've updated Module:Portal/images/*/sandbox to add |category=[[Category:Pages using deprecated portal images]], instead of deleting those lines directly. I added images from Category:Usage of portal image for non-existent portal to the "allow" list. Everything is ready to go live to identify any deprecated images that shouldn't be deprecated. — hike395 (talk) 11:34, 9 March 2023 (UTC)
Sorry, a lot going on and didn't have the time to check it out promptly. Looked fine but complicated. I saw you added and removed it quite quickly. Are you sure it was completly populated when removed? Category:Usage of portal image for non-existent portal took about a day to populate fully. --Trialpears (talk) 07:34, 10 March 2023 (UTC)

Template:Od It looked like your tracking category was mostly populated. I used to to expand the allow list, so it's done its job. Even if it missed a few, I'm going through manually and removing the deprecated flag. So if the category wasn't fully populated, it will just cause me a little more work. Now I'm gradually moving the sandboxes to main, searching in pages for an alt flag that contains "category=" in the HTML source to find images to rescue. It's slow, but we'll get there eventually. — hike395 (talk) 09:52, 10 March 2023 (UTC)

Ready for removal

Using the idea from Template:U, I added Category:Pages using deprecated portal image to images in Module:Portal/image/[a-z] that were unlikely to be used by any template. I then went through and found pages that appeared in that category and undeprecated the corresponding image. I did null edits on pages likely to have portal images (e.g., those in Category:WikiProject userbox galleries and Category:Location userbox galleries). I also waited a couple of weeks for the job queue to clear.

Category:Pages using deprecated portal image is now stable and small: it contains residual pages that have deprecated images. Those pages are either user sandboxes or discussions about this template itself. In the image sandboxes (e.g., Module:Portal/images/a/sandbox) I have prepared versions of the code that have the unused/deprecated images removed. You can inspect the removals by diff (e.g., [1]). If no one finds any problems and if no one objects, I'll start to gradually move these sandbox versions to the live versions over a number of days. In the end, the list of portal image icons will be cleaned up and be about half the size of the existing lists.

Please take a look and let me know! Thanks! — hike395 (talk) 20:59, 16 April 2023 (UTC)

Template:Status I've removed deprecated images for j-z and have not yet encountered any problems. — hike395 (talk) 18:39, 29 April 2023 (UTC)
Template:Status Finished removing deprecated images for a-z — hike395 (talk) 05:25, 5 May 2023 (UTC)
Thanks for that and for your work on the aliases. For completeness, there are a few redundant images in Module:Portal/images/other, after some but not all of the decade portals were deleted. Certes (talk) 09:30, 5 May 2023 (UTC)
Template:Done I already checked --- All of the entries in Module:Portal/images/other are used at least once in WP via the _image() function outside of a sandbox, so there was no need to mark them as deprecated or remove them. You can verify by looking at the top of Template:Portal/doc/all and {{User from Åland}}.
I intend to do some further cleanup on the aliases and duplicate images, but that isn't very urgent. — hike395 (talk) 13:29, 5 May 2023 (UTC)

Template-protected edit request on 28 April 2023

Template:Edit template-protected Rename:

  • Flag of Omaha, Nebraska.jpgFlag of Omaha, Nebraska.svg Rkt2312 (talk) 23:22, 28 April 2023 (UTC)
Template:Question I just removed unused images from the file, and that flag was removed --- Template:Ping do you see File:Flag of Omaha, Nebraska.jpg being used in a Portal box, WikiProject box, or userbox anywhere? — hike395 (talk) 05:39, 29 April 2023 (UTC)
yes, I looked on wikimedia commons. Rkt2312 (talk) 12:17, 29 April 2023 (UTC)
File:Flag of Omaha, Nebraska.jpg says it is only used in two places:
  1. User:Buaidh/sandbox, used in a test userbox that does not need to be supported.
  2. User:Kyjama, not used in a userbox
Per above, the row for File:Flag of Omaha, Nebraska.jpg is deprecated and can be safely removed from Module:Portal/images/o. There's no need to re-add it to Module:Portal/images/o or convert it to SVG. — hike395 (talk) 13:52, 29 April 2023 (UTC)
Thank you very much. Rkt2312 (talk) 18:25, 29 April 2023 (UTC)

Template-protected edit request on 10 July 2023

Template:Edit template-protected Change the image for arthropods (line 112), from Cercophonius squama.jpg to Butterfly icon (Noun Project).svg. The former may be a featured picture, but at these resolutions it's an unrecognizable blob. The latter is a clean, recognizable icon.
Template:Right arrow
Edward-Woodrow :) [talk] 19:46, 10 July 2023 (UTC)

 Not done for now: please establish a consensus for this alteration before using the {{Edit template-protected}} template. The scorpion image looks fine to me. – Jonesey95 (talk) 12:57, 11 July 2023 (UTC)
The suggested butterfly image seems much clearer to me at the low resolution available. Certes (talk) 14:07, 11 July 2023 (UTC)

Conservatism portal change

The image for the Conservatism portal has been changed seemingly without consensus. Under Module:Portal/images/c the accompanying image was changed from File:DodgerBlue flag waving.svg to File:Red flag waving.svg. This seems inappropriate as the red flag is symbolic of socialism not conservatism. Can someone who has editing privileges (I don't) please undo this edit? Kiwichris (talk) 03:32, 4 August 2023 (UTC)

Template:Reverted. Template:Ping would you like to discuss why you want to make the change? — hike395 (talk) 04:13, 4 August 2023 (UTC)
The {{conservatism sidebar}} uses a blue flag. The colour is generally associated with the right wing. The U.S. is exceptional, with the more conservative main party using red and their opposition blue. Certes (talk) 09:10, 4 August 2023 (UTC)
I concur.  Buaidh  talk e-mail 20:33, 4 August 2023 (UTC)

Template-protected edit request on 23 August 2023

Template:Edit template-protected Add the image for Portal:Eurovision Song Contest. This is the main symbol of the contest and logo for the Portal. Ktkvtsh (talk) 09:55, 23 August 2023 (UTC)

Template:Complete2. P.I. Ellsworth , ed. put'er there 02:43, 24 August 2023 (UTC)

Template-protected edit request on 4 September 2023

Template:Edit template-protected Rename:

  • Pittsburgh city coat of arms.svgCoat of arms of Pittsburgh, Pennsylvania.svg Rkt2312 (talk) 21:16, 4 September 2023 (UTC)
Template:Done * Pppery * it has begun... 14:16, 5 September 2023 (UTC)