Module talk:Political party/Archive 1

Archive 1Archive 2Archive 3Archive 4

Broad strokes of setup

  1. Create module subtemplates   Done
    1. Get a list of all /shortname, /color, and /abbrev pages   Done
      1. Get a list of all /shading pages   Done
    2. Get the content of the templates in #1.   Done
    3. Split by alphabet group   Done
    4. Convert each name/shortname/color/abbrev group into a Lua-fied grouping (see Module:Political party/L)   Done
    5. Add in duplicate names   Done
      1. Duplicate entries in the non-redirect list   Done
      2. Redirects   Done
    6. Remove completely unused templates/parties
      1. Redirects   Done
      2. Primary templates   Semi-done
    7. Add testcases/visual display of colours (on /doc, per places like Module:Sports color)   Done
  2. Convert template usage
    1. Set up primary template ({{Political party}} maybe?)
    2. Find templates that are designed to call /shortname, /color, and /abbrev pages
    3. Cvt #2.2 to use module, either by direct invocation or replacement with #2.1
  3. Research into none values - "", "N/A", "None of the above", "Other parties" and see if valid uses or should be replaced with no value or a global default value.

Discussion

Just starting this here to detail the progress of the setup and creation of this template. Steps will be expanded or struck as necessary. Primefac (talk) 15:53, 6 September 2021 (UTC)

  • Happy to start compiling a list of templates/modules and other situations where this will have to be used – for example colour templates are often used by themselves in wikitables, so we'll need to thing about how that works going forwards. Also, a query over the colour output – in many cases the # is needed (I noticed in the TfD discussion, the output was minus the hash). Cheers, Number 57 16:37, 6 September 2021 (UTC)
    I think it would be reasonable for parties that only have a colour value to simply return shortname = fullname (just on the off chance that someone calls it) so that it doesn't give an error. Primefac (talk) 17:13, 6 September 2021 (UTC)
    I've started a list of uses here. Number 57 17:54, 6 September 2021 (UTC)
  • Plus there are also some templates that currently do not use the meta templates, but would be improved by doing so – for instance, {{Infobox political party}} currently requires the colour of the party to be entered in the |colorcode parameter. It would make life easier for people if the infobox could use the colour associated with the article name by default (if it exists) and then overridden by anything added manually. Number 57 16:43, 6 September 2021 (UTC)
    Yeah, definitely a lot of room to almost re-evaluate how these meta templates are used. The # is an issue but from other instances I've seen such as Module:Sports color they just give the value without it, letting the template add in the # as necessary. Primefac (talk) 17:10, 6 September 2021 (UTC)
    I've added support for the # sign. I've used the html value so it the wiki doesn't translate # into a list. Gonnym (talk) 09:00, 7 September 2021 (UTC)
    The only issue there is for the "simple" colours listed, such as red or green. I'm sure we can figure it out, though. Primefac (talk) 10:46, 7 September 2021 (UTC)
    I guess the answer may be to replace the simple colours with their respective hex codes? Number 57 10:50, 7 September 2021 (UTC)
    I've adjusted the code. The database should now include the regular (non-html) hash sign, and the module searches for it and converts to html. That way, green or red should work. Gonnym (talk) 10:55, 7 September 2021 (UTC)
    Excellent. Figured there would be an easy fix. Primefac (talk) 10:58, 7 September 2021 (UTC)
  • Also, re 1.1, be aware that many meta templates are not categorised, so using the categories of a way of finding them is not going to give the full list. Is there a way of automatically creating a list of everything in template space ending with "/meta/color" and "/meta/shortname"? Number 57 16:45, 6 September 2021 (UTC)
    I got Martin Urbanec to run a PAWS query (thanks again!) and get all of the values for all templates ending in /meta/XYZ, so right now I'm working on getting them in a usable format. Primefac (talk) 17:10, 6 September 2021 (UTC)
  • Step #1.3 is done, everything is at this Sheet. I'm a little hesitant to just open it up to editing by anyone, so if someone wants to get edit access just ask via the usual methods. I have to run but I'll try to get everything loosely formatted for importing into the various submodules in the next day or two. Primefac (talk) 19:26, 6 September 2021 (UTC)
    Do you think it's worth having a stab about rationalising the list before transferring it into the module? There are multiple duplicates (e.g. {{Young People's Party (UK)/meta/color}} and {{Young People's Party UK/meta/color}}) and also many that aren't used (e.g. {{Zac Goldsmith Team/meta/color}}). Can a query be done to work out which ones aren't used?
    Also, what about redirects? There are quite a few as a result of parties that were renamed and the meta template moved to match the new name (e.g. {{HOMELAND (Slovakia)/meta/color}}). Cheers, Number 57 20:11, 6 September 2021 (UTC)
    The short answers are:
    • it will probably be a bit of both, in that I'll notice duplicates before copying things over, but will also likely not notice some duplicates until after they have been copied
    • I have no doubt a check of some variety (probably quarry) can be made to see if any of these templates are unused
    • Yes, redirects were not included in this list, and will likely be pulled/added after the main list is populated
    My main concern right now is getting the bulk of the lists sorted, in particular just getting everything moved over to the modules so that we can get a better idea of what we're dealing with for Stage 2. I've added in a few more points to Stage 1 on the thoughts here, though (#1.5-6). Primefac (talk) 00:31, 7 September 2021 (UTC)
Another issue I saw from the list is that not all entries start with a letter. I've added a fix to that so if the index isn't a letter, the index will be "1", and will search at "Module:Political party/1". The "1" isn't really important and can be any thing else. If those entries won't be included then those lines of code can be removed. Gonnym (talk) 11:57, 7 September 2021 (UTC)
Thanks, I kept forgetting to look into that. Primefac (talk) 12:37, 7 September 2021 (UTC)

Duplicates

finished duplicates

There are a very small number of straight-up duplicate names in the data, but also similar-named entries which would of course necessitate an alternate name entry. However, almost all of them are using different values. For example:

     ["All India Majlis-E-Ittehadul Muslimeen"] = {abbrev = "", color = "#009F3C", shortname = "AIMIM",},
     ["All India Majlis-e-Ittehadul Muslimeen"] = {abbrev = "", color = "#1A7920", shortname = "AIMIM",},
     ["Young People's Party (UK)"] = {abbrev = "", color = "#DDDDDD", shortname = "Young People's",},
     ["Young People's Party UK"] = {abbrev = "", color = "#FFF643", shortname = "Young People's",},

What's the best way to deal with this disparity? I'm half-tempted to just pick one of the values and let someone make an edit request if they're that worried about it (i.e. let the gnomes handle it). Primefac (talk) 11:37, 7 September 2021 (UTC)

Out of the 3 of here here, Number 57 has probably the best idea for this, so you could just make the list and they'll edit out the wrong options. Either that or you idea and someone eventually will request a fix. Gonnym (talk) 11:40, 7 September 2021 (UTC)
(e/c) I would check which one is used in the infobox of the party in question, or if neither (which is the case in the second), what is there or matches the logo. For Young People's Party, the correct colour seems to be yellow (or the second one listed). For the first one listed, neither seem to fit. I'd suggest #136b4b based on the background colour of their logo. If it is a short list, I'm happy to go through and pick? Cheers, Number 57 11:44, 7 September 2021 (UTC)
["Bangladesh Muslim League (BML)"] = {abbrev = "", color = "#D0F7F7", shortname = "",},
["Bangladesh Muslim League"] = {abbrev = "", color = "#7DE8E8", shortname = "BML",},

These are actually two separate parties. The Bangladesh Muslim League had a split, with one of the splinter factions called "Bangladesh Muslim League-BML" (this is a bit of an oddity in Bangladeshi politics and there are a few parties with names like this). The Bangladesh Muslim League (BML) one should be adjusted to Bangladesh Muslim League-BML, which would then be picked up by the results table in 2018 Bangladeshi general election. I've renamed the meta template and fixed its uses to match the "Bangladesh Muslim League-BML" name. Cheers, Number 57 15:29, 7 September 2021 (UTC)

Thanks. Done. Primefac (talk) 15:34, 7 September 2021 (UTC)

Last one (I think)

["Scottish People's Alliance"] = {abbrev = "", color = "#87cefa", shortname = "Scottish People's",},
["Scottish Peoples Alliance"] = {abbrev = "", color = "white", shortname = "Scottish Peoples Alliance",},

This one has disparity both with the colour and shortname. I'm inclined to go with the shorter version (since that's the point of a shortname) but I haven't dug into the colour yet. Primefac (talk) 18:00, 7 September 2021 (UTC)

I'd be tempted to go with the light blue one – that seems to be the original template. I can't find a party logo and the BBC just use dark gray for them, which I suspect is because they were a minor party. Number 57 19:56, 7 September 2021 (UTC)

Shading

Split from the main discussion

Another party/meta type exists - shading (see Template:People's Action Party/meta/shading). Not sure what it's used for but noticed these weren't in the sheet. Gonnym (talk) 11:00, 7 September 2021 (UTC)

If I had to guess, it's just another way of saying /meta/color. I'll see about getting their values and adding them to the list. Primefac (talk) 11:06, 7 September 2021 (UTC)
It's not the same as the meta colours - it's for background shading in tables – see e.g. the party columns in List of Malaysian State Assembly Representatives (1964–1969)#Perlis. I am not sure these are a good idea as some of the colour contrasts are very poor – perhaps they should be scrapped? Number 57 11:14, 7 September 2021 (UTC)
Well, I've seen /color values used in that way as well, but I don't necessarily disagree with you that it's not good practice (i.e. they should probably not be used in this manner). Primefac (talk) 11:20, 7 September 2021 (UTC)

Just to swing back to this, do we want /shading as its own field for return, or merge it in with the /color options? Primefac (talk) 12:36, 7 September 2021 (UTC)

Personally I'd be tempted to send them for deletion – if they are incorrectly used instead of meta/color, they should be replaced with the colour one, but I don't think use for colouring cells in tables is appropriate. Cheers, Number 57 14:03, 7 September 2021 (UTC)
Naive question: Are the Party shading templates also part of this consolidation? It looks like there are about 800 pages with that prefix, of which at least 60 have no transclusions. – Jonesey95 (talk) 07:05, 1 November 2021 (UTC)
Not at the moment. I didn't realise they existed when I put in the original TFD, and N57 makes a good point above that there might be some ACCESS/contrast issues, which is why I haven't pursued it further. Primefac (talk) 07:16, 1 November 2021 (UTC)
Sorry I'm a bit late, but one prominent use of the shading templates is as part of the Template:NZ parlbox, which is used to denote where particular New Zealand MPs served and when. See examples such as on Peter Dunne and Catherine Tizard. Deleting the shading templates would require the template, which is used on more than 1500 articles, to be redesigned. YttriumShrew (talk) 07:34, 17 November 2021 (UTC)

NA

Are the NA entries in Module:Political party/N needed?

Over 300 transclusions of the current templates, so I would say so. Primefac (talk) 17:26, 7 September 2021 (UTC)
Yes, it appears to be used for write-ins in American elections. See e.g. Maryland's_1st_congressional_district#2000s. Number 57 17:48, 7 September 2021 (UTC)
Those uses should probably be looked at during cleanup. The usage of "N/A" at {{Election box candidate with party link}} for example is pointless as it has "N/A" under the column of "Party" and links to N/A. The first is just incorrect. It is not "not available", it's just not relevant for that row (cast tables for example use {{CEmpty}} for an empty cell) and the link itself is pointless in this context. If a default color value is needed which isn't white (another question, why?) then the module can just handle that instead of returning an error at line 37. Gonnym (talk) 17:53, 7 September 2021 (UTC)
Perhaps an election box template should be created specifically for write-in lines in tables? Number 57 20:11, 7 September 2021 (UTC)
I actually think there are way too many duplicate templates that can easily be merged. See for example {{Election box candidate/sandbox}} (rough merge) which combines {{Election box candidate}}, {{Election box candidate minor party}}, {{Election box candidate no party link no change}}, {{Election box candidate with party link}}, and {{Election box candidate with party link no change}}. The styling between these is different but there is no apparent reason for why and no indication in the /doc as well, so it would seem to be just code that went out of sync. Then we can also add support to it for a no party value. Gonnym (talk) 20:51, 7 September 2021 (UTC)

Alternate names

I've come across a few alternate names that are in a different section of the alphabet (of course, I didn't write any of them down, and now can't find any) but they usually are due to translations of the original name. I suspect we'll find more when the redirect list is populated. I see two options for this:

  1. Add in the translated value into the letter (for example, if "ADF" was short for "Francophone Defense Agency" or something, we'd put the latter entry in the "/A" page even though it starts with F)
  2. Add in a secondary check into the main module (using the example in #1, the "alternate value" would now start with F, so we re-gather the information from the /F subtemplate instead of /A)

Primefac (talk) 18:32, 7 September 2021 (UTC)

I've made a testcase work for "A test" which is an alt for "Ba'ath Party".
  • {{Mlx|Political party|fetch|A test|color}} -> {{#invoke:Political party|fetch|A test|color}} (edit: removed test entry from list)
It works (and while getting it to work I found an actual bug which I fixed) but I don't know how much of a resource drain it is (not my specialty). Gonnym (talk) 19:18, 7 September 2021 (UTC)
@Primefac so it seems that using the require method in the list causes a loop. I've modified the code in the /sandbox to your second option and it seems to work:
{{#invoke:Political party/sandbox|fetch|Agrarian Party of Albania|color}} -> #21B330
Give it a look and let me know. Gonnym (talk) 17:14, 9 September 2021 (UTC)
Looks good. I was worried for a bit that we might end up with alternates in one letter going to alternates in another, but having just input all the alternates I don't think that's the case. Plus, I've added in an extra item to our checklist, in that we can have testcases for all of our values (which will throw errors if there are any such loops). Primefac (talk) 17:17, 9 September 2021 (UTC)

Not sure if this is the same thing as being discussed above (can't quite get my head round it), but in cases where a party has been renamed at some point, having a meta colour template redirect under their former name ensures the colour pointed to is the same as the one for the current name of the party (as the target is the meta colour template under the current name). How is this going to work in the module – will redirects be built into it, or will we manually have to ensure the different names have the same colours listed? Cheers, Number 57 08:30, 10 September 2021 (UTC)

Just so I understand the question I'll create an example so you can help me understand. Scenario: "Old party" is now called "New party". What should happen:
  1. Should the entry of "Old party" take the values of "New party"? That means /shortname (and /abbr) and /color values are the same.
  2. Should the entry of "Old party" only take some of the values of "New party"? If so, which?
    1. Should the /shortname (and /abbr) values be the same but /colors different?
    2. Should the /color values be the same but /shortname (and /abbr) values different?
  3. Should no values be the same? "Old party" does not connect to "New party" at all. Gonnym (talk) 08:39, 10 September 2021 (UTC)
Only the colours would remain unchanged – the short version of the old name would not match the short version of the new name. For example, in the current system, if the Conservative Party (UK) was renamed the Tory Party (UK) but kept the same colour branding etc, then we'd move Template:Conservative Party (UK)/meta/color to Template:Tory Party (UK)/meta/color and so have a redirect at the former, meaning anywhere either of them were used, we'd get the same colour. However, we'd keep Template:Conservative Party (UK)/meta/shortname and Template:Tory Party (UK)/meta/shortname separate as in articles where the party contested under the old name, that's what would have to be displayed. Hope that makes sense? Number 57 08:47, 10 September 2021 (UTC)
Separately, there may be cases where a party article is moved for disambiguation purposes, so a new listing in the module would be needed. How will the old listing be pointed to the new one? And also, this goes back to my question below about how to identify where calls are being made for the old name – how will we identify which articles are still using the old article name and potentially need updating? Number 57 08:52, 10 September 2021 (UTC)
Ok, so I've modified the code a bit to work with how you said it should. So now instead of an alt list being:
["A Better Britain - Unionist Party"] = "A Better Britain – Unionist Party",
It should be:
["A test"] = {main = "Business and Professional Group", abbrev = "AT", shortname = "atest"},
With main being the new party. In this current style, any values listed in the alt list will get used and anything else will be taken from the linked party from the main value.
See examples:
Gonnym (talk) 09:56, 10 September 2021 (UTC)
Pardon me for always being the odd one out, but if the name changes, we shouldn't be using the old one for the new group... right? If in 1975 the "Whig" party changes its name to the "Hairband" party, we want articles from '75 and prior to use "Whig", and everything after '75 to say "Hairband". Sure, the "Whig" links will likely be redirects following a move to "Hairband", but as stated elsewhere, we're only interested in the data. We have plenty of instances of "Party (year)" showing in the template; some of them are alternate names, but a lot of them have their own values.
As far as maintenance goes, people are more than welcome to ask for a TPER to update values if and when they change. Primefac (talk) 10:38, 10 September 2021 (UTC)

Name templates

There is another group of templates which might be related under Category:Political party name templates (Category:Mexico political party name templates, Category:Singapore political party name templates, and Category:Taiwan political party name templates). --Gonnym (talk) 22:11, 7 September 2021 (UTC)

Those look to be convenience link templates, much like the footy team templates. Primefac (talk) 22:22, 7 September 2021 (UTC)

Unused templates

It was easy enough to filter through the unused template redirects (~1200) when placing the alternate names, but having gone through a few of the As there's an issue with the fact that we're combining three templates into one, so it's going to take a lot of time to manually check the ~300 templates for those that might not be used in all three /abbrev, /shortname/, and /color categories. Honestly, it's a small enough number that I think having the excess isn't going to be a huge burden. Thoughts? Primefac (talk) 17:22, 9 September 2021 (UTC)

It might not be an issue (I don't really know), but 1200 is quite a lot. A bot can create a table with the transclusion counts for each party listed there and check all 3 meta/types which would save us the time of having to check it manually. I sadly can't help with that as I never took the time to see how to create and operate a bot, etc. We can probably get help at the bot request page. Gonnym (talk) 18:27, 9 September 2021 (UTC)
Sorry, I think you're misunderstanding. I did not include any of the unused redirects when I added in the alternate names today, so the alts are 1200 names lighter. I've actually gone through a few letters of the the non-redirects (~300) and there are ~20 that would be removed from extant full names, so I think it becomes a "loss" from a cost/benefit standpoint. Primefac (talk) 18:30, 9 September 2021 (UTC)
I'm still not entirely clear what you mean. Is it that 300 or so of the (non-redirect) meta templates are unused? Cheers, Number 57 19:28, 9 September 2021 (UTC)
I went through the unused templates database and pulled every template related to this project. Before I added the alternate names (i.e. template redirects) to the individual lists, I removed all of the unused values based on the dbase results. Of the ~1500 templates on the unused list, ~1200 of them were those redirects. The ~300 remaining are either /shortname, /abbrev, or /color templates, but not using one template doesn't necessarily mean that all three are not used; for example, {{Ahd 54/meta/shortname}} is unused, but {{Ahd 54/meta/color}} is used, meaning that our entry for "Ahd 54" should be kept. In looking at the values, I'm seeing about 90% of them are non-/color values, most of which are likely in use and thus would not need removing; tracking through to remove 30 templates seems a little unnecessary. Primefac (talk) 20:12, 9 September 2021 (UTC)

Out of interest, in future, how will we be able to see if a meta shortname/color is being called from anywhere when it all ends up being pointed to the module? Cheers, Number 57 19:28, 9 September 2021 (UTC)

That's a good question. I know that it is possible to track usages of parameters and their values. TemplateData has a monthly updated report but only shows the result for entries with less than 50 unique values (which is very unhelpful). That means that it is possible. We might be able to get a bot operator to create a monthly task that collects the data, compares it to the lists and prints to the table the entries with no usages. Gonnym (talk) 19:44, 9 September 2021 (UTC)
I'm going to ask the question mainly from a maintenance perspective, but... do we care? I would assume that any parties in-use today will likely stay in use, since the pages they're being used on are unlikely to be deleted or otherwise significantly modified. Just like with the handful of unused templates I mention above, I doubt we would have attrition anywhere near 100 names per year, which is a ballpark figure in my head for what would convince me to start trimming the templates due to lack of use. Primefac (talk) 20:12, 9 September 2021 (UTC)
I guess that since entries will from now need to be added from a page request and will need to be named correctly then we won't end really need to remove unused entries from the list. So maybe we don't need to do anything? Gonnym (talk) 20:28, 9 September 2021 (UTC)
The reason I ask is that it will allow finding of errors in party names in templates that call on colours/shortnames etc. Number 57 21:48, 9 September 2021 (UTC)
There's certainly something to be said for fixing some of the more blatant typos (for example "Cumann na nGaedhael" instead of the properly-spelled "Cumann na nGaedheal") but I don't think that's something we need to worry about in the immediate future, unless we see such uses and know to simply replace extant uses with the proper template(s) before we remove them all. Primefac (talk) 21:51, 9 September 2021 (UTC)

Module and template name

A bit jumping ahead, but if the module is used for parties (and not individuals) then perhaps a better name would be Module:Political party so that a query to the module for a color would make more sense:

Gonnym (talk) 15:06, 7 September 2021 (UTC)

When I created the module/name scheme I was thinking that would be good, but it would clash with {{Political party}}. I mean, I have no issue using that as the module name, but then we'd either need to come up with a different name for the implementation template, and/or risk the issue of folks confusing Template:Political party with Module:Political party. If neither of these are issues, though, I can see the benefit of a rename. Primefac (talk) 15:16, 7 September 2021 (UTC)
{{Political party}} has only six uses and I think could easily be replaced in those articles with a bit of coding, so could be taken over by a new tenmplate. Number 57 15:21, 7 September 2021 (UTC)
Either rename that template or replace with manual code would indeed be better. Gonnym (talk) 15:29, 7 September 2021 (UTC)
I've renamed it and fixed all the links, so it's free to be taken over. Number 57 15:56, 7 September 2021 (UTC)
Just to throw out one more idea, what about Module:Political party info? I keep momentarily thinking that it's too vague to just call it "political party". Primefac (talk) 15:58, 7 September 2021 (UTC)

There are a few (1, 2, 3) shortnames that include partial links. I believe this is so that when they are called as part of a wikilink, it will show two wikilinks instead of one (see for example Aberavon for the National Liberal and Conservative shortname). If we are intending this module to essentially work the same as the individual templates, I would think that it would be necessary to keep this feature intact. Primefac (talk) 21:48, 9 September 2021 (UTC)

A couple of them were also broken (as they didn't produce the correct links), and I've repaired them. Number 57 21:49, 9 September 2021 (UTC)
Actually that didn't work, so have self-reverted. Combining this section with the one created below by Gonnym on the same issue. Number 57 21:54, 9 September 2021 (UTC)

The entries that are written like ["Parnellite Home Rule League"] = {abbrev = "", color = "#99FF66", shortname = "Home Rule League]] [[Charles Stewart Parnell|(Parnellite)",} should not be supported as they can cause issues in places we might not even know to look. If a table like the one used in Cavan (UK Parliament constituency), which uses Template:Election box winning candidate with party link wants to use another link for an individual, that is fine, but that template should be changed and another field added to it. This module should not handle the presentation side, only the data. In this case, "Charles Stewart Parnell (Parnellite)" is not the name of the party. Gonnym (talk) 21:51, 9 September 2021 (UTC)

Good points. Consider any objections I might have had rescinded. Primefac (talk) 22:20, 9 September 2021 (UTC)

Ready to go?

I've shored up error handling, created the implementation templates, and have started checking usage in Template:Election box winning candidate with party link/sandbox to see if there are any major issues. So far I am seeing none.

Other than deciding on a final name for this module, and potentially how we want this template to be set up (I have created both {{political party}} as well as subpages such as {{political party/color}}) I think we're good to start replacing /meta/ template usage with our module call. Primefac (talk) 20:36, 24 September 2021 (UTC)

I think the name is good. Is there an idiot's guide somewhere as to how it'll work? If so, I'm happy to start testing it in a few templates' sandboxes. Cheers, Number 57 22:54, 24 September 2021 (UTC)
A few comments:
  1. The name should in my opinion be called Module:Political party to match the templates.
    1. If the name changes, the error categories at Module:Political party#L-3 should be modified as well.
  2. The template code ({{#invoke:Political party|fetch|{{{1|}}}|{{{2|}}}|error{{#if:{{{error|}}}||_NULL}}={{{error|}}}}}) doesn't need to have the parameters passed to it as you should get it from the frame.args table. The code can then just be {{#invoke:Political party|fetch}}.
  3. Module:Political party#L-61 is correct that it's empty and not nil (referring to your edit summary) as at that point you have a party but might not have a specific value. In how it's currently set up when a value does not exist we initialized it to an empty value.
  4. Looking at some of the data it would seem that there is a misuse with how the data was set up previously (before the module). See for example in Module:Political party/A how the shortname values for "Alliance for the Union of Romanians" and "Alliance for Tanzania Farmers Party" are actually abbreviations and how the shortname value for "Animals First" is the same as the actual name. Can we fix it before live without this causing issues? Gonnym (talk) 08:01, 25 September 2021 (UTC)
I've now noticed that while the error function does stop the module and returns right away, it produces Lua error in Module:Political_party at line 31: parameter 1 should be a party name. so maybe it would be better to just return an error message styled as one instead of an actual Lua error, as the line number is not really relevant here and is a lot of "noise" to non-technical people. Gonnym (talk) 11:19, 25 September 2021 (UTC)
Aaaaand....
  1. Done
  2. It does if we are going to just use frame and not frame:getParent().args. I'm not really bothered either way, but since we need the error handling to be in (as a blank |error= will still trigger the eventual args.error call) we might as well just keep it in the template.
  3. You're right, and I feel dumb for forgetting that.
  4. I think you're right in that it was the Wild West with regard to what went in which templates. It's worth further discussion so I'll split it into its own section.
If that's easy to do, go for it; typing in "error(stuff)" in the module is simple, but I do see your point about the user/editor-facing side of it. That being said, making it an actual script error means that it will flag in the category and someone will see it; for example, someone vandalises a backwater article and no one notices so an error sticks on the page for ages - this happened to me with one of my country flag templates a few years back. Primefac (talk) 11:39, 25 September 2021 (UTC)
Yeah, that's a fair point. I guess the question is if there are editors going through Category:Pages with script errors, which has a lot of irrelevant entries. BTW, regarding the blank |error=, I've only worked with Module:Arguments (require("Module:Arguments").getArgs) so I'm assuming that is why I've never ran into such a problem. Gonnym (talk) 11:45, 25 September 2021 (UTC)

Alternate names, redux

As mentioned in point 4 above, there are discrepancies with how the various values are being stored: some shortnames are really abbreviations, and some of them are actually the full name of the party. I think it would reasonable to store abbreviations as abbrev in the first case and remove "shortname-equals-party-name" values in the second case (since we would just return the full name anyway). From a "we are turning thousands of templates into one module" perspective, though, that would mean we would immediately have thousands of entries that are no longer returning the intended value when called in the article space (e.g. calling "Alliance for the Union of Romanians" would no longer return "AUR").

So, I guess the question is this - do we say "oh well" and just keep the status quo, or do we change everything as described above and then return something if it's there? To continue with the AUR example, we would change the current listing

   ["Alliance for the Union of Romanians"] = {abbrev = "", color = "#FCC224", shortname = "AUR",},

to

   ["Alliance for the Union of Romanians"] = {abbrev = "AUR", color = "#FCC224", shortname = "",},

and then return essentially an {{if empty|shortname | abbrev | party}} for future calls. Primefac (talk) 11:48, 25 September 2021 (UTC)

Template:Alliance for the Union of Romanians/meta/shortname is used three times. One use is from the |abbreviation= parameter of Template:Infobox political party, which pretty much shouts misuse (and the call itself can be baked into that infobox now). Two uses are eventually from Template:Infobox election/shortname. For that specific example, we can modify that template to do -> abbr->short->passed value. The question is, how many meta-templates like this are? But I would be in favor of fixing this issue so we can a clean version. Gonnym (talk) 11:56, 25 September 2021 (UTC)
I have gone through all of the subpages. If it looked like an abbreviation, it's now in the abbrev field. If it was a duplicate to the fullname, it's been removed. I'm sure I missed a few things and/or things will need tweaking, but I would say 99% of them have been taken care of.
Before we start (slowly) replacing extant uses in the template and article space, I just want to ask the reverse question from my initial post - is there a time when we wouldn't want to give abbrev -> shortname -> passed value, or (if no abbrev is asked for) shortname -> passed value? I cannot think of one but that's why talk pages exist (to bounce ideas). If we can't figure out a reason why we wouldn't want to do it this way, I think we can reasonably start going live. Primefac (talk) 15:39, 27 October 2021 (UTC)
I'll take a look at Module talk:Political party/uses later and see how current templates are setup with fallbacks and maybe get some insights from that. I would note though that even if we use the above suggested fallback scheme, we should still add a parameterized option to get the specific value or none. So something like |only=yes (name doesn't have to be "only") would get what was request. This might be rarely used or not at all maybe, but it seems correct to have it in there just in case (and it isn't really hard to code it). Gonnym (talk) 10:28, 28 October 2021 (UTC)
Apologies, I had a look at a couple of them, and couldn't work out how to integrate this module into it. In the meantime, I have been continuing to create meta templates to work with {{Infobox election}}, {{Infobox legislative election}} and {{Election results}}, but once these have been coded to work with this module, I will copy all the meta template data across into the module. Some other editors have been creating new meta templates too, but hopefully most can be picked up from here. Cheers, Number 57 10:35, 28 October 2021 (UTC)
Yeah, some cases might be easy, others less so. Primefac (talk) 10:37, 28 October 2021 (UTC)
(edit conflict) Just keep in mind that a lot of the extant /shortnames are really abbreviations, and in this module are now properly stored as abbrev. I think that's my main concern with template-swapping, as a "shortname request" in the current system may or may not be valid in the module if the shortname became an abbrev. Primefac (talk) 10:36, 28 October 2021 (UTC)
I don't think 'shortname' and 'abbrev' are really meaningful terms. 'shortname' templates are used to display a party's name in infoboxes and election box tables. In some cases a party's 'shortname' is an abbreviation (like 'SNP' for Scottish National Party) and in some cases it is part of the party's name (like 'Labour' for the Labour Party) – see the infobox of 2017 United Kingdom general election where the shortnames called are a mix of abbreviations and shortened names. I don't believe the 'abbrev' template was that widely used and I would suggest it would be simpler to just combine the two fields. Cheers, Number 57 10:42, 28 October 2021 (UTC)
There are admittedly a very small number of parties that have both (34 by my count). Some are probably a bit unnecessary, but others such as the Liberal Democrats go evenly between that and "LibDem". I'd be hesitant to assume that one is preferred over the other. Primefac (talk) 11:01, 28 October 2021 (UTC)
If you can give me a list, I'd be happy to go through them and suggest a single shortname/abbrev (and cop any subsequent flak). I've looked at the Liberal Democrats uses, and I don't think there would be any major problem with using "Liberal Democrats" instead. There seem to be only a tiny number of templates that use the abbrev template ({{Compact election box}} and {{Elected official with party link}} are the only two that I can see use the British parties' abbrev templates) and I'm not sure they justify having a completely different set of parameters.
Or alternatively, given the relatively small number of abbrev templates in existence, we leave them as they are for now and only use this module for shortnames, and once it's up and running, suggest converting the templates that use abbrev to use the shortnames stored in this instead (or find another way to avoid using them – for example, the Danish ones only seem to be used on one article, which seems particularly pointless). Number 57 11:29, 28 October 2021 (UTC)
See below.
Parties with abbrev and shortname
Alliance Party of Northern Ireland		#F6CB2F	APNI		Alliance
All-for-Ireland League				#66FF99	AFI		All-for-Ireland
Business and Professional Group			#3333CC	BP		Businessmen's Party
Commonwealth Labour Party			#b22222	ComLab		Commonwealth Labour
Democratic Socialist Party (Ireland)		#FF0099	DSP		Democratic Socialist
Democratic Left (Ireland)			#C700C7	DL		Democratic Left
Farmers' Party (Ireland)			#B8860B	FP		Farmers' Party
Green Party (Ireland)				#22AC6F	GP		Green
Irish Unionist Alliance				#9999FF	U		Irish Unionist
Irish Parliamentary Party			#99FF66	IPP		Irish Parliamentary
Independent politicians in Ireland		#DDDDDD	Ind		Independent
Irish Democratic Party				#23588C	IDP		Irish Democratic
Independents 4 Change				#FFC0CB	I4C		Inds. 4 Change
Liberal Unionist Party				#2061A2	LibU		Liberal Unionist
Liberal Democrats (UK)				#FAA61A	Lib Dem		Liberal Democrats
Liberal Party (UK)				#ffd700	Lib		Liberal
Labour Party (Ireland)				#CC0000	Lab		Labour
Labour Party (UK)				#E4003B	Lab		Labour
Mansfield Independent Forum			#DDDDDD	MIF		Mansfield Independent
National Labour Party (Ireland)			#FF7F50	NLP		National Labour Party
Northern Ireland Labour Party			#DC241f	NILP		NI Labour
National Democratic Party (Northern Ireland)	#DDFFDD	NDP		National Democratic
National Centre Party (Ireland)			#0000FF	NCP		National Centre Party
Nationalist Party (Northern Ireland)		#32cd32	Nat		Nationalist
Nationalist Party (Ireland)			#99FF66	IrishNat	Irish Nationalist
People Before Profit/Solidarity			#8E2420	PBP/S		PBP/Solidarity
Republican Labour Party				#85de59	RepLab		Republican Labour
Republican (Ireland, 1923)			#008800	Rep		Republican
Speaker of the House of Commons (United Kingdom)	white	Spkr	Speaker
Socialist Party (Ireland)			#FF3300	SP		Socialist Party
Socialist Labour Party (Ireland)		#AD3030	SLP		Socialist Labour
Social Democrats (Ireland)			#752F8B	SD		Social Democrats
Ulster Liberal Party				#DAA520	ULib		Ulster Liberal
United Left (Ireland)				#FF5555	UL		United Left
Workers' Party of Ireland			#930C1A	WP		Workers' Party
I think we need to do one or the other - allow both abbrev and shortname, or force a choice between them. With only ~30 (out of how many thousands...) having dual values, I think it's reasonable to have one "short" value; whether that is a true shorter name or a full-on abbreviation is up to the community, to be dealt with on a per-party basis. Primefac (talk) 11:47, 28 October 2021 (UTC)
Happy to go with the one short value (which, as you say, can be tweaked later if people aren't happy with them). I'll have a look through that list this evening and make some suggestions. Cheers, Number 57 12:21, 28 October 2021 (UTC)
I think in all cases, we should use the shortname rather than the abbrev. There are varying uses of the abbrev templates, but in several cases they could simply be replaced with text (e.g. at 1924 Northern Ireland local elections or 2019 Irish local elections where they are not used in a template, but simply to create the abbreviation in a table cell). Some abbrev templates are not even used in articles, only in {{Cathead Parliament of Northern Ireland}}, which appears in categories (and similar to the above, they are just used to write out a party's name and could be replaced with text). Cheers, Number 57 21:47, 28 October 2021 (UTC)

In that case, unless I hear otherwise from our third hand I'll re-combine the abbrev and shortnames, get rid of abbrev, and update the main module. Primefac (talk) 09:27, 29 October 2021 (UTC)

@Primefac went over most of the list and left my comments there but in short:
  • The abbr usages in the office holder family of templates seem like a "valid" use. By valid I mean that there is a deliberate distinction there. As I noted there, I'm not sure if that choice is user-friendly or even follows our MoS and policies (are the letters en.wiki made up things, or come from real-word?)
  • There are /abbr templates but also /abbrev templates. Did you pick those up as well?
  • A lot of current usages do not have a fall back so those templates should break with their current system.
  • Might be worthwhile adding always a default color (the color of the default background color of the table), using it like no color was used. The reason for this is that a lot of current code does "background-color: <color>" but then gets an empty string (or error?). This way there won't be an error. Another advantage is that is removes the need to do an "if module_call then module_call, else default" and instead do "module_call".
    • As a continuation to this - one of the templates did a "if /meta/color then /meta/color, else default", so maybe we can add another parameter of |default= which then if no color is found returns the requested default instead of the module default.
  • There are many election table templates but some of them are exact duplicates, others are extremely similar that can be merged with a parameter switch. There is no reason for coding stuff like this. When people at TfD claim "maintenance burden" this is exactly it.
  • After looking at the templates I'm confident that the new system can work and work better (as long as it doesn't run into memory issues).
Hope this was clear enough, if not ask and I'll try to explain better. Gonnym (talk) 17:36, 29 October 2021 (UTC)
All very good points, and I'll give some more detailed replies once I've got a bit more room in my brain, but the one question you've not answered is the one I was waiting on, namely "should we just combine abbrev and shortname and call it good?" Primefac (talk) 17:54, 29 October 2021 (UTC)
Regarding your question, the 3 Office Holder templates use specifically a abbr system in two columns so if we change that, that column would probably need a small redesign. In my opinion those single letter "abbreviations" are made up en.wiki ones and if that assumption is correct then a short name should replace them, even if that means making those columns wider. That's my opinion on that issue. Gonnym (talk) 20:12, 29 October 2021 (UTC)
Regarding the fourth bullet point, several templates/modules have the option of inputting a colour manually, so I guess the hierarchy needs to be manual input > meta template > default (you may already be thinking this, but just wanted to double check).
Regarding the office holder templates, it seems to be largely used for Scandinavian countries, where parties are known by one- or two-letter abbreviations (so these are not made up for Wikipedia purposes). Given the relatively low usage, perhaps the templates could be tweaked to allow hard coding for that column and then done via an AWB run? Similar tables exist for other countries where party names are piped rather than having abbrev templates created. Cheers, Number 57 22:25, 29 October 2021 (UTC)

This issue is still not resolved and a lot of what was in the shortname templates is still listed under abbrev, which will cause some issues as this is rolled out (for example, there is no shortname for the ANC, which will mess up South African election articles). Are we going to merge the two? If not (or at least not immediately), then the text that is in the abbrev field needs to be copied back across to the shortname field in cases where there is no shortname. Cheers, Number 57 12:46, 25 November 2021 (UTC)

The module returns the first value that isn't empty. If you ask for an abbrev, it looks for abbrev -> shortname -> input. If you ask for a shortname, it looks for shortname -> abbrev -> input. This means that we can keep the values separate in the module and we don't have to choose when a party has both an abbrev and shortname. Primefac (talk) 12:57, 25 November 2021 (UTC)
Thanks, that's good to know. However, I still think we should merge the two given the very low level of overlap. I'm also concerned that by separating them, it might give some editors the idea that (e.g.) 'ANC' cannot be a shortname (for infobox purposes) because it's an abbreviation. Cheers, Number 57 13:01, 25 November 2021 (UTC)

Script errors

@Primefac: is there a way to remove all the new articles in Category:Pages with script errors? seems related to this change? Frietjes (talk) 21:55, 18 November 2021 (UTC)

my guess is the problem is that if |party= is blank then it used to fetch Template:/meta/color but now it returns {{#invoke:Political party|fetch||color}} which is a script error! Frietjes (talk) 21:57, 18 November 2021 (UTC)
for now, I have made this change and this change to avoid the error, but it would be better to trap this inside the module along with other failed lookups. Frietjes (talk) 22:02, 18 November 2021 (UTC)
I've noted above in my 4th bullet that when new color is found a default color (what a table without style uses now) should be passed instead of none (or a fallback color passed to the module), that would eliminate the need to modify the templates like you did. Gonnym (talk) 22:34, 18 November 2021 (UTC)
I would have expected |error=white to work for the colors, but maybe that should be |error1= for error in the first parameter? By the way, we also need to fix lowercase i? See this edit and this edit to fix a script error. Thanks! Plastikspork ―Œ(talk) 23:18, 18 November 2021 (UTC)
I implemented some fixes (or hacks?) for some common lower case parties like n/a, solidaritéS, and write-in candidate, but I imagine we could just uppercase the letter before the data module load. Thanks! Plastikspork ―Œ(talk) 23:46, 18 November 2021 (UTC)
Plastikspork it looks like this was fixed by Gonnym so you can delete the lowercase redirects now. Frietjes (talk) 17:52, 19 November 2021 (UTC)
@Gonnym and Primefac: could we get a separate tracking category for errors as well as the visible error? finding the errors in by searching Category:Pages with script errors is hard. Frietjes (talk) 17:54, 19 November 2021 (UTC)
I haven't had a chance to look into the error/tracking handling yet, but I've made it so that if the party doesn't exist and the call is asking for a colour, it returns "white" per the old Template:/meta/color use case. I left in the error pass for if the colour isn't in the module yet, because as far as I'm aware if we have a political party in the list, it has a colour. Primefac (talk) 08:59, 25 November 2021 (UTC)
White is the colour of some parties, and is also specifically used for 'Other parties'. Using it for parties with no designated colour could be confusing – I'd prefer we stick to no colour at all, or if one has to be used to make it work, use #F8F9FA, the default background colour of wikitables and infoboxes. Number 57 09:24, 25 November 2021 (UTC)

Separately, I wasn't aware that implementation had started – would it be possible to tick off which templates have been converted from the meta templates to this module at Module talk:Political party/uses? Cheers, Number 57 21:59, 18 November 2021 (UTC)

Seems reasonable. I picked white just because white is the colour we keep throwing about. Primefac (talk) 09:34, 25 November 2021 (UTC)
Number 57, I agree. for now I am using this search to find uses of the module in templates. Frietjes (talk) 22:09, 18 November 2021 (UTC)
{{Election box winning candidate with party link}} and {{Election box candidate with party link}} were the only two I updated, and since I didn't find the former on the list I figured the latter might not be on it as well (I know, I know, making assumptions...). They're both relatively simple enough that I thought it would be a good dry run to iron out any of the kinks (I've been checking via the sandbox version for a while now). Primefac (talk) 06:57, 19 November 2021 (UTC)

Lower/upper redux

Gonnym, I was just checking the final implementation of some conversions when I noticed that the 1980 United States presidential election (third infobox down in this section of the testcases) has an "independent (United States)" value but it is not being treated as "Independent (United States)". Does the getFirstLetter function starting on Line 15 need to be tweaked? Primefac (talk) 12:47, 30 November 2021 (UTC)

There is no entry for "independent (United States)" in Module:Political_party/I. Gonnym (talk) 13:10, 30 November 2021 (UTC)
No, but there is an alt name: ["Independent (United States)"] = "Independent (US)",. I think I see the issue now: we use an upper check for the index to choose the right subpage, but then we don't repeat that when actually looking for the name, so independent (United States) will correctly shoot for the /I subpage, but then it will fail to match against the properly-capitalised version. Primefac (talk) 13:16, 30 November 2021 (UTC)
Yes. In my opinion we shouldn't support incorrect names. If the entry is really "independent" then we should have an entry, but if it isn't, we shouldn't and the editor will notice the color isn't working and eventually realize they wrote it wrong. We should remember that the party name is a reader-facing text so we should want to fix those, not support them (to exaggerate to make a point, we wouldn't support "InDePenDenT (United States)" either). Gonnym (talk) 13:26, 30 November 2021 (UTC)
Very good point, consider my concerns withdrawn. Primefac (talk) 13:31, 30 November 2021 (UTC)

Errors with shortnames and colors

Some of the recent changes resulted in party shortnames and colors not displaying properly. See example. ― Tartan357 Talk 09:03, 21 November 2021 (UTC)

  Fixed In the example linked above, "Libertarian Party of Pennsylvania" was not included in the module. It is now an alternate name for "Libertarian Party (US)" and should be working as intended.
As a minor note, if you see such instances in the future, please be a bit more specific about things "not displaying properly", because when I initially went to the page it looked (to someone not actually familiar with the Libertarian Party colouring scheme) like it was behaving as expected. In other words, "the Libertarians don't have the correct colour" is more helpful to fixing the issue. Primefac (talk) 09:14, 21 November 2021 (UTC)
@Primefac: Thanks. It looks like the shortnames are still not displaying properly, though. They should be "Republican" and "Democratic" only. ― Tartan357 Talk 09:28, 21 November 2021 (UTC)
Ah, yes. Looks like the /meta/ system that led up to this had fifteen different variants of "X Party (state)" and some of them weren't redirecting or containing the proper shortnames. Fixed (though I suspect there might be some future cleanup for double-redirs). Primefac (talk) 10:21, 21 November 2021 (UTC)

@Primefac: It appears the recent switch of Template:Election box gain with party link no swing to using this module has produced an error where the losing party is displayed as its hex color code, rather than the party name. Example. ― Tartan357 Talk 03:08, 26 November 2021 (UTC)

  Fixed. Copy/paste fail is most likely. Thanks. Primefac (talk) 07:20, 26 November 2021 (UTC)

Infobox election/shortname

@Primefac: The change to {{Infobox election/shortname}} is creating issues where the party name is input as a link rather than relying on a shortname template (which don't always exist). See, for example, 2022 Portuguese legislative election or Next Ukrainian parliamentary election. Number 57 13:04, 25 November 2021 (UTC)

I think a {{delink}} with |wikilinks=target will fix that, yes? Primefac (talk) 13:14, 25 November 2021 (UTC)
Actually, now that I think about it, the infobox is likely not the only place that will have that issue (I had to fix a /doc earlier that was using a wikilinked party). It might be worth calling Module:Delink in the module itself to avoid too much in-template hacking like that. Primefac (talk) 13:18, 25 November 2021 (UTC)
Would that affect all linking? Sometimes it's a valid way of doing things as multiple parties may be entered into a field where they run in an alliance. Number 57 13:27, 25 November 2021 (UTC)
If the party is not in the system, the module returns the input party. If the entire point (at least for 90% of the templates I converted today) is to provide the link text for a wikilink, then that input party should be the target of the wikilink that is passed to the module.
On a related note, we already had the issue where we try to fit multiple parties into one value, and it didn't work. Primefac (talk) 15:06, 25 November 2021 (UTC)
Sorry, I wasn't entirely clear on the first bit. So if you have an input like for party3 in the infobox here or party2 here, it won't attempt to delink it? Cheers, Number 57 15:13, 25 November 2021 (UTC)
Yes and no. If you just send the party as-is, it would attempt to delink the input and then pass it along. However, {{infobox election/shortname}} has a |link= parameter, that when set to "no" will not attempt to find a shortname (e.g. |party3=[[Guyana Action Party|GAP]]–[[Working People's Alliance|WPA]] would be returned directly as GAPWPA). However, this functionality doesn't actually exist in the main {{infobox election}} or {{infobox election/row}} (the latter of which calls the /shortname template). Thus, if the main infobox and /row templates are updated, the linkX parameter can be used to bypass the module search. Primefac (talk) 15:21, 25 November 2021 (UTC)

I've started a discussion about the infobox and changes that need making. Primefac (talk) 07:53, 29 November 2021 (UTC)

Another minor issue – sometimes there are notes against unlinked names in the infobox – e.g. at 2000 Lithuanian parliamentary election. Here it is trying to link an unlinked name, and creating an error. How do we get around this? Is there a nolink function we can add? This would be useful for cases like 1962 Brazilian legislative election, where we don't really need to link 'Coalitions'. Cheers, Number 57 22:33, 30 November 2021 (UTC)
The infobox has parameters that allow for the inputs to not be linked. Primefac (talk) 10:17, 1 December 2021 (UTC)
It doesn't seem to be working. I've tried setting |link1=no at 2000 Lithuanian parliamentary election, and nothing happens. Number 57 10:21, 1 December 2021 (UTC)
You need to set |party_name=no. Primefac (talk) 10:24, 1 December 2021 (UTC)
This also doesn't work. Number 57 10:26, 1 December 2021 (UTC)

Having seen multiple edits pop up on my watchlist, there is a wider issue with the module attempting to add links to things that aren't meant to be linked (basically it tries to link everything entered to the party/alliance field as plain text, whether it has a /meta/shortname or not, while previously when you entered plain text to the party/alliance field, links were only created if a /meta/shortname template existed). Can the module be edited so that if a party name is entered as plain text, and no /meta/shortname exists, then it doesn't attempt to link it? I've tried using |party_name=no to uses of {{Infobox election}}, but it then delinks all parties, so you then have to add all the links back in manually... Cheers, Number 57 10:48, 1 December 2021 (UTC)

The module links nothing. We specifically set it up to return basic text. If there are issues with displays, then that is a template issue. Primefac (talk) 12:22, 1 December 2021 (UTC)
I've created a testcase example here and reset the sandbox versions of the template to the pre-module version. You can see in the sandbox version, the parties are not linked. It appears that the problem has been caused by the changes to {{Infobox election/shortname}}, which previously had an ifexist check to see if a shortname template existed and only created a link if there was one. Number 57 12:48, 1 December 2021 (UTC)
Again, this is not a module issue. There is a discussion at the template's talk page specifically about my concerns with making this transition; if the template needs fixing, then it should be discussed at its talk page. Primefac (talk) 13:01, 1 December 2021 (UTC)

Another run of meta template importing required

The current batch of sub-modules was created nearly three months ago, since which there have been hundreds of new meta templates created, plus existing ones have been moved (from spotting an error in the 2022 Portuguese election infobox, I realised that he Left Bloc was not displaying properly as the meta templates were moved from Left Bloc to Left Bloc (Portugal) during the intervening period.

As it looks like implementation is happening now, could another run be done to grab the templates as they are now? Cheers, Number 57 13:13, 25 November 2021 (UTC)

Genuinely out of curiosity, do you know it's hundreds, or just guessing (and if so, how did you determine this information?)? Primefac (talk) 13:19, 25 November 2021 (UTC)
Both myself and PLATEL have created over 200 new meta templates each since 1 September; mine are mostly colour ones for results tables; PLATELs are for infoboxes. I put my own total at around 240. You can see a regular stream of them appearing at User:AlexNewArtBot/PoliticsSearchResult. Number 57 13:24, 25 November 2021 (UTC)
Ugh (not for what you've done, just the work required to update things). I'll see about rustling up the chap that ran the search for me last time. and while I'm doing that, you might want to think about why you weren't updating the submodules as you went along.... Primefac (talk) 15:12, 25 November 2021 (UTC)
In fairness, I did say above that my plan was to do all mine in one go once the module went properly live :) However, I wasn't accounting for others continuing to create them in such numbers. Plus the moves/renames may cause some issues if we don't get that right. Once this is fully live, I'll also keep an eye on the new article alerts and flag up the fact that no more should be created with the editor in question. Number 57 15:15, 25 November 2021 (UTC)
Once we've replaced all /meta/ template calls, they'll be deleted, so there won't be anything to monitor.
I'd say we're pretty much at "live"; at the moment we only have the two infoboxes and the 900 or so direct calls to specific /meta/color templates (which I can likely hit with an AWB run). I realise that's still a good 24k articles that are as-of-yet unaffected, but it'll get done soon.
That being said, the deletion can be held off until we check the newest /meta/ creations so that at least the majority of them are included. Primefac (talk) 15:23, 25 November 2021 (UTC)
Re the monitoring, I meant any more new creations of the meta templates – there will be some editors unaware of the change and will keep creating them otherwise. Cheers, Number 57 15:30, 25 November 2021 (UTC)
Good point. Primefac (talk) 15:38, 25 November 2021 (UTC)
When the collation is done, can we make sure it includes both abbrev and abbr templates (which are effectively the same thing)? As they weren't picked up originally, it means we have long-ish party names appearing in the coalition column here (which is because {{Social Democrats (Denmark)/meta/abbr}} and the like weren't picked up, meaning there is no abbrev for the party in the module).
Also, regarding my comments/concern above about people thinking that shortname can't be an abbreviation, it's potentially an opportunity to put the contents of shortname templates back into the shortname field. Number 57 17:25, 26 November 2021 (UTC)
@Number 57 and Primefac: looking at this, could I suggest perhaps adding /meta/shortname and /meta/color to the title blacklist with a note to make an edit request at the relevant module instead? Elli (talk | contribs) 19:25, 27 November 2021 (UTC)
Great idea! I didn't know that was a thing. Cheers, Number 57 20:05, 27 November 2021 (UTC)

Is this new run going to happen soon? Many of the meta templates are used for election infoboxes, which have now been converted (for the shortnames at least), so the gaps are staring to appear. Cheers, Number 57 13:18, 30 November 2021 (UTC)

I haven't heard back from my code-person, but I'll drop them a note as a reminder. Primefac (talk) 13:23, 30 November 2021 (UTC)
Thanks. A particularly affected article is 2021 Kyrgyz parliamentary election, as most parties are new and meta templates were created since September. Number 57 13:38, 30 November 2021 (UTC)
Well, as I said above, you're welcome to add them yourself should you find the need; it will take me some time to process everything. Primefac (talk) 14:10, 30 November 2021 (UTC)
I've done a temporary fix on the article.
Also, regarding my concerns about the potential for confusion between shortname and abbrev (i.e. that the shortname is simply how the party is listed in the infobox, not an actual 'short name' as opposed to an abbreviation), can this run put the content of /meta/shortname into the shortname field and not move many to the abbrev field (in cases where the shortname is an abbreviation like SNP, ANC etc). Cheers, Number 57 14:57, 30 November 2021 (UTC)
Done with the importing.
We've been saying since the beginning that we don't want people doing the "wrong thing" just because we can - this goes for "independent" vs "Independent" and short names that are actually abbreviations. Primefac (talk) 19:03, 30 November 2021 (UTC)
Thanks. However, it doesn't seem to have picked up templates like {{Social Democrats (Denmark)/meta/abbr}}.
The shortname/abbrev thing is not the "wrong thing", as the names "shortname" and "abbrev" are not to be taken literally. /meta/shortname templates are a version of a party name that is short enough to work in an infobox or results table, and can be either a short name or an abbreviation. /meta/abbr(ev) are very short versions of a party name that can fit in a smaller cell in a table, and again can be either a short name or an abbreviation (e.g. the abbrev for Labour Party (UK) is Lab not LP, which would be meaningless to most people). Cheers, Number 57 20:55, 30 November 2021 (UTC)
There are probably some that got missed; I do not have the time nor the inclination to figure out a way to determine every page that was created since the last time we went through these but yet didn't make it onto the new list. Fix them as you find them.
You're kind of making my point re: Labour Party; it's an abbreviation but it's not a shortname (which would just be "Labour", which is incidentally exactly what's stored in the shortname). Primefac (talk) 21:07, 30 November 2021 (UTC)
None of the the Danish party /abbr appear to have been picked up, which makes me wonder whether the /abbr title namespace was not included in the run?

Related to the above, I had a thought while doing this update in that any Party with a disambiguator (i.e. parentheses) should probably have their shortname be whatever the base party is (if it doesn't already have a shortname), so for example Democratic Action (El Salvador) should have a shortname of Democratic Action. Primefac (talk) 21:12, 30 November 2021 (UTC)

No – this is related to the above point that /meta/shortname does not mean 'short name'. The meta/shortname of many parties are abbreviations (possibly the majority). This sort of thinking is why I am so concerned about what is happening here. If, for example, the shortname of Socialist Party (Netherlands) was changed from SP to Socialist Party it would make the infobox of 2021 Dutch general election look very odd. Number 57 21:25, 30 November 2021 (UTC)
Maybe those templates should be changed to use abbrev, then. Either way, for 90% of party names it's a moot point, as there is either a shortname or an abbrev but not both, and the module returns "whatever is there". The entire system needs an overhaul (3/4 of these election-related templates are identical) and this is just the first step; there will be choices that need to be made, but I would rather make them when the decision arises than try and guess how things will happen and potentially have to revert past changes we made due to guessing. Primefac (talk) 22:05, 30 November 2021 (UTC)
I agree that at some point choices may need to be made, but until there is consensus to do so, we should continue with the current arrangements – i.e. put whatever was in /meta/shortname into the shortname field and whatever was in /meta/abbr(ev) templates into the abbrev field. Once the meta templates are deleted, we are potentially stuck with the way it has been arranged in the module and the change effectively becomes a fait accompli. Number 57 16:59, 1 December 2021 (UTC)
As this is still being ignored, I am going to start an RfC to see whether there is support for this unilateral action. Number 57 19:33, 4 December 2021 (UTC)
Genuinely curious, do you propose undeleting every /abbrev and /shortname template to determine which values go where? Primefac (talk) 19:35, 4 December 2021 (UTC)
No, I just want you to move the contents of the shortname templates into the shortname fields. I assume you still have the data in some form from what you were provided. Number 57 19:41, 4 December 2021 (UTC)
This module is going to be used by the entire community. This means that if an editor creates a template that requests a party abbreviation, the module should return that. If they require a "short name", then it should return that. What it should not do, is make it do random things. Any "fix" should be done in the calling template level and not corrupt the module database. Gonnym (talk) 19:45, 4 December 2021 (UTC)
And for the final time, a shortname is not a 'short name'. If people want SNP to appear in an infobox that calls the shortname field, SNP is what should be in the shortname field. Number 57 19:48, 4 December 2021 (UTC)
If people want SNP to appear in the infobox, then the infobox should be designed to call for SNP (the abbreviation). Gonnym (talk) 19:49, 4 December 2021 (UTC)
But people want 'Conservative', 'Labour' and 'SNP' to appear alongside each other. Number 57 19:54, 4 December 2021 (UTC)
Last I checked, they already do. The module is set up so that it gives what is asked for, and then goes down the list of valid alternates if it doesn't exist. Primefac (talk) 19:56, 4 December 2021 (UTC)

Issue with alternative names of other alternative names

I've noticed an issue which has shown up on some pages. This is that attempting to fetch data for an alias, which is aliased to another alias, does not work. For example, "California Democratic Party" is aliased to "Democratic Party (California)" which is aliased to "Democratic Party (US)".

Demonstration
Code Result
{{#invoke:Political party|fetch|California Democratic Party|shortname}} Democratic
{{#invoke:Political party|fetch|Democratic Party (California)|shortname}} Democratic
{{#invoke:Political party|fetch|Democratic Party (US)|shortname}} Democratic

The result for the first invocation should be the same as for the latter two, but it isn't. Would be nice if this could be fixed, I don't have the knowledge of how this is programmed or the time to fix it myself. Elli (talk | contribs) 23:54, 30 November 2021 (UTC)

I've been cleaning those up as I come across them, but when I get time I'll make an effort to hit all 50 states just to be safe. Primefac (talk) 09:59, 1 December 2021 (UTC)
My eyes occasionally started glazing over, but at least as far as US States goes I think I got them all. Please let us know if there are any further issues like this. Primefac (talk) 12:54, 1 December 2021 (UTC)
I can bypass them myself, if that the route we're going for -- I assumed these were intentionally linked like this so if we were to at some point add a separate color, abbreviation, or shortname for the California Democratic Party, any aliases would also be updated. I suppose that's not really worth the effort though. Elli (talk | contribs) 00:17, 2 December 2021 (UTC)
I have fixed a couple of Illinois and Iowa links over the past couple of days. I think all of the US state party connections are updated. – Jonesey95 (talk) 20:34, 3 December 2021 (UTC)

Template-protected edit request on 1 December 2021

Please change ["Reform PH - People's Party"] = {abbrev = "RP", color = "#800000", shortname = "",}, to ["Reform PH-People's Party"] = {abbrev = "RP", color = "#800000", shortname = "",}, per redirect of the two pages. NewManila2000 (talk) 01:22, 1 December 2021 (UTC)

@NewManila2000: Should it not be Reform PH–People's Party (i.e. with an ndash not a hyphen)? Number 57 09:13, 1 December 2021 (UTC)
  Not done, the certified list of candidates has them listed as "REFORM PH - PEOPLE'S PARTY". Primefac (talk) 09:56, 1 December 2021 (UTC)

Please also change ["Kabalikat ng Bayan sa Kaunlaran"] = {abbrev = "KABAKA", color = "#FEFD91", shortname = "",}, to ["Kabalikat ng Bayan sa Kaunlaran"] = {abbrev = "KABAKA", color = "#01692E", shortname = "",}, as per color change in its party color template. NewManila2000 (talk) 03:34, 1 December 2021 (UTC)

Done. Number 57 09:13, 1 December 2021 (UTC)

Please also change ["Aggrupation of Parties for Progress"] = {abbrev = "APP", color = "#1325AE", shortname = "",}, to ["Aggrupation of Parties for Prosperity"] = {abbrev = "APP", color = "#1325AE", shortname = "",}, as per name change and page move in its party color template and party shortname template. NewManila2000 (talk) 13:55, 1 December 2021 (UTC)

  Done. Primefac (talk) 14:22, 1 December 2021 (UTC)

Please also change ["Probinsya Muna Development Initiative"] = {abbrev = "PROMDI", color = "#000040", shortname = "",}, to ["Progressive Movement for the Devolution of Initiatives"] = {abbrev = "PROMDI", color = "#000040", shortname = "",}, as per name change as stated in COMELEC list of tentative candidates for 2022 elections. NewManila2000 (talk) 23:09, 1 December 2021 (UTC)

  Done. Primefac (talk) 11:36, 2 December 2021 (UTC)

Problem

A few articles are in Category:Pages with script errors, for example Poole (UK Parliament constituency). The error is hidden. It is due to the use of the following:

{{party color|Cavalier}}
{{party color|Roundhead}}

Previewing either of these shows "Lua error in package.lua at line 80: module 'Module:Political party/' not found." Something is missing and ends up as an empty string after the slash. Johnuniq (talk) 02:56, 7 December 2021 (UTC)

@Johnuniq: it's because Cavalier is aliased to an empty string (in Module:Political party/C). It should be aliased to an actual party or added as its own party. Elli (talk | contribs) 04:25, 7 December 2021 (UTC)
{{Roundhead/meta/color}} and {{Cavalier/meta/color}} are redirects to the horribly named Template:/meta/color. Whatever that is, it needs to be imported into the module. – Jonesey95 (talk) 04:30, 7 December 2021 (UTC)
I think I have fixed the script errors at Poole (UK Parliament constituency) by setting the color in the C and R modules to "white". That page still uses Template:/meta/color, which will probably need to be dealt with. – Jonesey95 (talk) 04:37, 7 December 2021 (UTC)

I'm hoping someone here knows how to fix another problem. 2010 Cook Islands general election#Party totals is showing "Lua error: bad argument #1 to 'sub' (string expected, got table)." That happens at line 16 of Module:Political party in function "getFirstLetter" which is called from line 59 in function "_fetch" which is called from line 62 of Module:Election results in function "get_color". Johnuniq (talk) 04:10, 10 December 2021 (UTC)

  Fixed. It was a misplaced edit to Module:Political party/P. – Jonesey95 (talk) 04:24, 10 December 2021 (UTC)

Module entry point

I added support for a module entry point by splitting the fetch function (same idea was already implemented in the sandbox). this will allow us to change Module:Election results to use this module directly. let me know if there are any problems. if there are no problems, I will update Module:Election results to stop using the /meta/color templates. Frietjes (talk) 15:57, 8 December 2021 (UTC)

Frietjes, looks like things are working as intended. From what I can tell the call to /meta/color in line 63 is the last thing holding up full conversion to this module. Primefac (talk) 14:56, 12 December 2021 (UTC)
It should work now. Gonnym (talk) 15:16, 12 December 2021 (UTC)
Awesome. Should have the last of the /meta/color templates cleared out by end-of-day. Primefac (talk) 15:18, 12 December 2021 (UTC)

Right to Change

Hi, can someone update Right to Change, it is currently at Right To Change. This is causing to colour to be blank. Spleodrach (talk) 21:48, 8 December 2021 (UTC)

Done. – Jonesey95 (talk) 22:07, 8 December 2021 (UTC)

Template-protected edit request on 8 December 2021

Change "Rikken Minseito #8DB600" to "Rikken Minseito #6EA4CA"
Change "Rikken Seiyukai #FF3333" to "Rikken Minseito #B0D3A8"
The new colors
1. Conform with various pre-existing election diagrams
2. Form a more aesthetically pleasing color palate in a two-party system
Both parties never had any official colors. 沁水湾 (talk) 00:04, 9 December 2021 (UTC)

This actually is something I have been wondering since before we created this module - if a political party does not (or did not) ever have an "official colour", should we be saying they have a colour? I feel like we shouldn't be making things up that cannot be verified. Primefac (talk) 09:06, 9 December 2021 (UTC)
I can see the point, but we have various parliamentary diagrams and maps for which editors have decided to use a certain colour to represent parties, so it makes sense for the meta colour to match the colour used on those files for ease of reference between them.
@沁水湾: Did you mean to change Rikken Seiyukai's shortname to Rikken Minseito? Would it not be best to be "Seiyukai"? Cheers, Number 57 10:17, 9 December 2021 (UTC)
...for which editors have decided to use a certain colour - so... it's completely arbitrary? Genuinely trying to understand how we're going to deal with future TPERs saying "X party's colour is wrong" and potentially avoid arguments over changing from green to blue back to green again when it's all made up anyway. Primefac (talk) 10:33, 9 December 2021 (UTC)
The colours in the module are effectively providing a key for the map/parliamentary diagram, so ultimately it's dependent on what colour is used in the map/diagram, and the discussion is around them, rather than this module. If someone changes the colour in the map/diagram and comes here and requests a colour change, then they can be asked to justify the change with evidence that the colour was used by the party or that there is consensus to use that colour in the files. Number 57 12:50, 9 December 2021 (UTC)
Eh, fair enough. Primefac (talk) 13:19, 9 December 2021 (UTC)
  Done. Primefac (talk) 13:19, 9 December 2021 (UTC)

Documentation

With more folks editing and updating this module (and fixing errors!) I've updated the main documentation to hopefully make it a bit easier for people not intimately familiar with the code to help out. Wordsmithing is welcomed. Primefac (talk) 13:14, 9 December 2021 (UTC)

Script to check problems with the subpages

@Gonnym, Primefac, Number 57, and Jonesey95: I just hacked together User:Frietjes/politicalparty.js which when installed in your common.js gives you a new special page, "Special:PoliticalParty". if you press the "query" button on that page, it will check the module subpages for (1) duplicate entries which could be a duplicate "full name" or a duplicate "alternative name" or an "alternative name" that is also a "full name" (2) broken redirects which are alternative name targets that don't exist as full names. Here is the result from running it a few minutes ago.

Duplicates:Broken redirects:
Humanist Party
Liberal
Sans étiquette → Independent

the first entry in the "duplicates" column is "Abolish the Welsh Assembly". searching Module:Political party/A for that entry, you will see the problem.

the first entry in the "broken redirects" column is a redirect to "Other parties (US)". searching Module:Political party/O I see that "Other parties (US)" is a redirect to "Other parties" so this is a double redirect. I don't know if the module allows for double redirects?

I haven't checked to make sure that all the results are valid problems, but I thought it might be useful tool. the "broken redirects" could be checked using LUA, but the duplicates are harder, because LUA doesn't care if you overwrite a prior entry with a new entry. it also doesn't check to make sure the entries are "well formed" (like full entries in the alternate section, or the other way around), but I could probably do something if we think this could be a problem. let me know if you have any comments, suggestions, etc. Frietjes (talk) 21:42, 10 December 2021 (UTC)

This is great – thanks! I will start working my way through the above (I'll leave the examples mentioned until last so others can see what you mean). Cheers, Number 57 21:47, 10 December 2021 (UTC)
Nice, thanks. To answer the redirect question, we decided not to go recursively so "double redirects" are not allowed and will need fixing. Primefac (talk) 21:59, 10 December 2021 (UTC)
I've done N to W, and will take a break now. Number 57 22:27, 10 December 2021 (UTC)
As far as I can tell, some duplicates do not cause error messages (with my limited testing). The duplicates that have caused problems for me have been dups in the "local full" section in which one of the copies has a color and one does not. I believe that I fixed all of those a few days ago. The script above will be useful for tidying the lists and finding tricky problems, so thanks! – Jonesey95 (talk) 23:09, 10 December 2021 (UTC)
thanks for fixing some of these. I have updated the list above. Frietjes (talk) 18:03, 13 December 2021 (UTC)
Frietjes, I put the script in my vector.js, and when I go to the special page and press query, I get an error: Example text. Can you please check my work? I haven't added a new script for a while, and I may be using an outdated method of importing scripts. – Jonesey95 (talk) 19:30, 13 December 2021 (UTC)
Jonesey95, yes, the script was broken but subsequently fixed in my personal .js because I had another script with a function of the same name that wasn't broken. the script should work now, and I have updated the list above. Frietjes (talk) 21:03, 13 December 2021 (UTC)
Thanks, the script works now. Nice work. All errors have been fixed, as of this date stamp. – Jonesey95 (talk) 22:06, 13 December 2021 (UTC)

A few more transclusions to clean up

After the amazing PrimeBot did its work, I did a quick search and found a few pages with malformed /meta/color template calls. I fixed most of them; some of the ones I fixed need replacement by the bot. – Jonesey95 (talk) 15:01, 12 December 2021 (UTC)

Thanks for doing that, I figured there would be a few but I need #Module entry point above to get sorted before I could find the outliers with the bot. Primefac (talk) 15:10, 12 December 2021 (UTC)
As of about half an hour ago, all /meta/color templates have been deleted, meaning that we are officially transitioned over. Primefac (talk) 20:32, 12 December 2021 (UTC)
Excellent! Would you like to do the honors of removing the beta notice from the documentation? Also, I added a rough table of error messages to the documentation, mostly to remind myself of how to fix each of the errors. Help with the actual messages and their resolutions is welcome. Some of them have search links, which would ideally be replaced by maintenance categories, but the links should help for now. – Jonesey95 (talk) 20:35, 12 December 2021 (UTC)

Question

Hi all. I have tried to understand this change from Election Box Metadata templates to modules, but it's really not settling in my head.

I've been tending this particular garden for years here so I'm determined to understand the new process.

So here is my first of what might be a tonne of questions. If there is created a new article for a new political party, how does an editor create the colour/shortname that we need to for results boxes etc?

Thanks x doktorb wordsdeeds 21:31, 12 December 2021 (UTC)

Request it to be added here per the explanation here. So just post here an edit request with the values of the party you want:
["<party name>"] = {abbrev = "", color = "", shortname = "",}, - note that you don't need to fill all values if there is no need for them. Gonnym (talk) 21:38, 12 December 2021 (UTC)
Thanks @Gonnym: doktorb wordsdeeds 22:16, 12 December 2021 (UTC)

Welsh Conservatives and UKIP

Unlike the Scottish Conservatives, the Welsh Conservatives don't get shortened to "Conservative". Plus, UKIP now links to UKIP instead of UK Independence Party. Thankfully, Propel no longer shows up with brackets, which it was doing until recently. Unreal7 (talk) 21:57, 12 December 2021 (UTC)

I've fixed the Welsh Conservatives issue. However, infoboxes and results tables will link to UKIP wherever someone has input 'UKIP' in the party parameter – this isn't anything to do with the module as it would have worked the same with meta shortname templates. Cheers, Number 57 22:29, 12 December 2021 (UTC)
Thanks. Would you be able to drop "party" from Abolish the Welsh Assembly Party as well? Just for consistency with Labour, Conservative and Green. Unreal7 (talk) 23:19, 12 December 2021 (UTC)
@Unreal7: I've set the shortname to just 'Abolish', which would be a better fit for infoboxes. Cheers, Number 57 21:59, 13 December 2021 (UTC)

NDA and UPA not displaying

I noticed that the colours for the National Democratic Alliance and United Progressive Alliance aren't showing up when transcluded through Template:Party name with colour. They seem to be working when transcluded through Template:Party name with color, though, which seems odd. Anyone know why this is happening?

e.g. Goa Legislative Assembly vs Chhattisgarh Legislative Assembly.

YttriumShrew (talk) 08:55, 13 December 2021 (UTC)

I think I fixed it now. Let me know. Gonnym (talk) 09:55, 13 December 2021 (UTC)
@Gonnym: Seems fixed. Thanks! YttriumShrew (talk) 19:52, 13 December 2021 (UTC)

Archiving

This talkpage seems to be filling out quite rapidly, so I therefore propose that we add an archiving bot. I think ClueBot III seems to be more appropriate for this situation. What do people think? YttriumShrew (talk) 19:50, 13 December 2021 (UTC)

Archive bot won't do any good because all but two discussions are from the last two weeks. I'll be manually archiving things as they are no longer relevant, but I wanted to make sure we were fully-live before starting that process. Primefac (talk) 21:01, 13 December 2021 (UTC)

Edit requests

  The headers in this section have been removed for the sake of the TOC and for clarity, as have the {{EPER}} templates. Primefac (talk) 20:53, 14 December 2021 (UTC)

The colour for Ukrainian Strategy of Groysman party is incorrect, it should be #F6DF55. This color is used in the range. A similar color is also used on the Ukrainian version of Wikipedia. Many Ukrainian parties are given the color blue, so it will be better to distinguish between parties, for example in the article "Opinion polling for the next Ukrainian parliamentary election". Block baby (talk) 14:45, 13 December 2021 (UTC)

  Done Elli (talk | contribs) 15:24, 13 December 2021 (UTC)

The colour for Servant of the People (political party) is incorrect, it should be #37B34A. This color is used in the logo and is more correct. Block baby (talk) 15:50, 13 December 2021 (UTC)

  Not done for now: It appears that that color is already used? Elli (talk | contribs) 15:59, 13 December 2021 (UTC)

The colour for European Solidarity is incorrect, it should be #2760AD. This color is used in the logo and is more correct. Block baby (talk) 15:56, 13 December 2021 (UTC)

  Done Elli (talk | contribs) 16:01, 13 December 2021 (UTC)

The colour for Opposition Platform — For Life is incorrect, it should be #0062B8. This color is used in the logo and is more correct. Block baby (talk) 16:30, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The colour for All-Ukrainian Union "Fatherland" party is incorrect, it should be #EE2136. This color is used in the logo and is more correct. Also the article changed its name to Batkivshchyna (political party). Block baby (talk) 16:34, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The colour for Strength and Honor is incorrect, it should be #0063AF. This color is used in the logo and is more correct. Block baby (talk) 16:38, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The colour for Nashi (political party) party is incorrect, it should be #101B4F. This color is used in the logo and is more correct. Block baby (talk) 16:40, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The colour for Radical Party of Oleh Liashko is incorrect, it should be #D4544E. This color is used in the logo and is more correct. Block baby (talk) 16:42, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The colour for Svoboda (political party) is incorrect, it should be #0E294D. This color is used in the logo and is more correct. Block baby (talk) 16:45, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The colour for Party of Shariy is incorrect, it should be #FF0000. This color is used in the logo and is more correct. Block baby (talk) 16:48, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The colour for Ukrainian Democratic Alliance for Reform is incorrect, it should be #DA2127. This color is used in the logo and is more correct. Block baby (talk) 16:50, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The colour for Voice (Ukrainian political party) is incorrect, it should be #FA4616. This color is used in the logo and is more correct. Block baby (talk) 16:52, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

The name Radical party of Oleh Lyashko is not correct, Radical party of Oleh Liashko is correct Block baby (talk) 20:06, 13 December 2021 (UTC)

  Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

Request

["<Farmers' Party (Sweden)>"] = {abbrev = "B", color = "#016A39", shortname = "Farmers' League",},

Could the Farmers' Party (Sweden)'s shortname be changed to Farmers' League, because Centre Party is for its successor? Thank you in advance. 2A02:C7F:662B:5700:D04A:934:F717:731A (talk) 05:55, 14 December 2021 (UTC)

Is the abbreviation really "B"? Gonnym (talk) 08:41, 14 December 2021 (UTC)
That does seem like an odd abbrev, but according to Centre Party (Sweden) it stands for Bondeförbundet . Primefac (talk) 09:03, 14 December 2021 (UTC)
  Done. Primefac (talk) 13:30, 14 December 2021 (UTC)

Batkivshchyna

The name All-Ukrainian Union "Fatherland" is not correct, should be Batkivshchyna (political party). Block baby (talk) 15:57, 14 December 2021 (UTC)

  Not done: please provide reliable sources that support the change you want to be made. - FlightTime (open channel) 15:59, 14 December 2021 (UTC)
FlightTime, All-Ukrainian Union "Fatherland" is a redirect to Batkivshchyna (political party), so that seems like a reasonable request (which I've done). Primefac (talk) 16:23, 14 December 2021 (UTC)

The name Batkivshchyna is not correct, should be Batkivshchyna (political party). Add shortname Batkivshchyna. Block baby (talk) 20:05, 14 December 2021 (UTC)

  Not done: There's no need for the disambiguator. Primefac (talk) 20:13, 14 December 2021 (UTC)

Also change the color of Batkivshchyna (political party) to #EE2136 and delete All-Ukrainian Union "Fatherland" from Module:Political party/A (the same things). Block baby (talk) 20:11, 14 December 2021 (UTC)

  Not done: please provide reliable sources that support the change you want to be made. The article says it's crimson, so I'm inclined to keep it that way. Primefac (talk) 20:15, 14 December 2021 (UTC)
Also, I'm going to request that you make more "all-in-one" edit requests - please don't spam the page with a dozen one-line requests, instead put one section that has all of your requests inside of it. Primefac (talk) 20:17, 14 December 2021 (UTC)

About Batkivshchyna (political party). #EE2136 - This color is used in the logo and is more correct. This is the exact color of the heart on the logo. Yesterday I changed the colors for all the main Ukrainian parties, you can see it in history. I changed the color for the all-Ukrainian Union "Fatherland" to #EE2136. The name and shortname should be the same as in the Svoboda party, because it is also an all-Ukrainian Union and there the name is Svoboda (political party) and the shortname is Svoboda. That's more correct, I want to be okay with that. Block baby (talk) 20:27, 14 December 2021 (UTC)

Source code of their official website uses #ed1c24, so for the sake of "close enough" I'm going to go with that. Primefac (talk) 20:33, 14 December 2021 (UTC)
For each party, the color was selected according to the selected items or letters on the logo. Here it is the heart and it has the color #EE2136. The color should be the same as on the logo. Let all the parties have the same judgment parameters, not each in its own way. Also in the last message, I made arguments about renaming the name and shortname that you ignored. Block baby (talk) 20:46, 14 December 2021 (UTC)
And I get #ee1c32 when I check the heart directly. This is why I said "close enough", because it is used on their site and doesn't involve pulling hex values off an image. As for the name, nothing in their article indicates they go by "Svoboda"; they're in an alliance with them. Primefac (talk) 20:50, 14 December 2021 (UTC)

Ok, I used website imagecolorpicker for each Ukrainian party. For Batkivshchyna I used File:Logo of the All-Ukrainian Union "Fatherland".svg (it uses English Wikipedia) and looked what color is heart and it is #EE2136. I also checked the information on other sites. As for the name, I mean Svoboda A.K.A. All-Ukrainian Union “Freedom” and has the name Svoboda (political party) and the short name Svoboda. So Batkivshchyna A.K.A. All-Ukrainian Union “Fatherland” should have the name Batkivshchyna (political party) and the short name Batkivshchyna. I mean they both are Unions, but different unions. So they should be named according to the same scheme. Block baby (talk) 21:40, 14 December 2021 (UTC)

The Color for Batkivshchyna is not correct, should be #EE2136. This color is used in the logo and is more correct. Also the name Batkivshchyna is not correct, should be Batkivshchyna (political party), because it is All-Ukrainian Union. Another All-Ukrainian Union has the name Svoboda (political party) and short name Svoboda. Block baby (talk) 13:13, 15 December 2021 (UTC)

Note: duplicate header removed The colour has been discussed already. I am still not convinced by the name issue, but I will leave that for someone else so that we can get some sort of consensus going. Primefac (talk) 13:26, 15 December 2021 (UTC)
The article is at Batkivshchyna, so the DAB is not required. Number 57 13:44, 15 December 2021 (UTC)
Thank you for renaming the article Batkivshchyna. But a color change is also necessary - you agreed on the color #EE2136 yesterday at 13:27 (UTC) (edit requests section). I changed the color for all the largest parties on December 13 by the same parameter - the color of some element on the logo (from the English article Wikipedia). For me, it is essential that Ukrainian parties have order with colors. Block baby (talk) 16:22, 15 December 2021 (UTC)
  Not done: I did no such thing; I explicitly rejected your specific request for a colour change, opting instead to use what the party uses on their official website. Primefac (talk) 20:34, 15 December 2021 (UTC)

You did it in edit requests section:

The colour for All-Ukrainian Union "Fatherland" party is incorrect, it should be #EE2136. This color is used in the logo and is more correct. Also the article changed its name to Batkivshchyna (political party). Block baby (talk) 16:34, 13 December 2021 (UTC) Done. Primefac (talk) 13:27, 14 December 2021 (UTC)

Block baby (talk) 07:48, 16 December 2021 (UTC)

That was my fault, I was trying to get through all of the requests in one shot; I converted the /A listing to a redirect so I mostly forgot about the colour change. Primefac (talk) 10:14, 16 December 2021 (UTC)

Ok, then can I change the colors of all parties presented in the article Next Ukrainian parliamentary election, as well as Opinion polling for the next Ukrainian parliamentary election by the same parameter - take the main color from the site of each party? I can do it tonight and have it in order. Block baby (talk) 11:53, 16 December 2021 (UTC)

Template-protected edit request on 15 December 2021

Delete shortname Batkivshchyna, as a name is the same. Block baby (talk) 17:39, 15 December 2021 (UTC)

  Not done This needs to be there for incoming redirects to it. Number 57 18:07, 15 December 2021 (UTC)

Extended-confirmed-protected edit request on 15 December 2021

The color of Radical party of Oleh Liashko is not correct, should be #C8102E. This color is used on the new party logo. Block baby (talk) 17:54, 15 December 2021 (UTC)

  Not done: 48 hours ago you asked for it to be #D4544E. You cannot change your mind every two days about what the party colours should be. Get some references that support your requests in the future or they'll probably be ignored. Primefac (talk) 20:32, 15 December 2021 (UTC)

I applied for a color change not because I wanted to, but because the party changed the logo. Block baby (talk) 07:56, 16 December 2021 (UTC)

Edit requests, 16 Dec

Servant of the people

Color of Servant of the people is not correct, should be #38b34a. This color is used by the party site. Block baby (talk) 15:44, 16 December 2021 (UTC)

  Done DarthFlappy 16:22, 16 December 2021 (UTC)

European Solidarity

The color of European Solidarity is not correct, should be #1b3892. This color is used by the party site. Block baby (talk) 15:47, 16 December 2021 (UTC)

  Done DarthFlappy

Template-protected edit request on 16 December 2021 (2)

Change color of Opposition Platform - for life to #1B508A. Change color of Stregth and Honor to #0064B4. Change color of Nashi to #16327A. Change color of Ukrainian Stategy of Groysman to #FFDD00. Change color of Radical party of Oleh Liashko to #D64541. Change color of Ukrainian Democratic Alliance for Reform to #C93732.

These colors are used by the party sites and more correct. Block baby (talk) 16:45, 16 December 2021 (UTC)

  Not done for now: please establish a consensus for this alteration before using the {{edit template-protected}} template. Wikipedia is NOT governed by other sites. - FlightTime (open channel) 16:48, 16 December 2021 (UTC)
Primefac has changed the color of the Batkivshchyna for the same reason I am requesting. He did not establish a consensus. Accept this request and I don't need anything else. Block baby (talk) 18:34, 16 December 2021 (UTC)


Irish political party requests

For whatever reason, the module seemed to have a number of difficulties importing Irish party names. Thankfully I was able to fix the major party names just there. However, a number of parties are still broken and some I cannot access as their section is locked.

Can someone attempt to fix ["Sinn Féin (Anti-Treaty)"] and ["Sinn Féin (Pro-Treaty)"] in the S section? Until they're fixed, 1922 Irish general election is broken. The timing of this is awkward as there's a lot of attention in Ireland right now on the 1922 election in the national media due to the forthcoming centenary of the event.

Can I also request that in the C section, Cumann na nGaedheal's shortname be made "Cumann na nGaedheal", that Clann na Poblachta's shortname be made "Clann na Poblachta" and that Clann na Talmhan's shortname be made "Clann na Talmhan". In the I section, may I request that Irish Worker League's shortname be made "Irish Worker League".

I think that would cover the Irish parties that appear in Infoboxes which are currently experiencing issues. Thank You. CeltBrowne (talk) 07:35, 6 December 2021 (UTC)

@CeltBrowne: can you please clarify what's broken here? Elli (talk | contribs) 07:44, 6 December 2021 (UTC)
I've also done the changes at Module:Political party/C and Module:Political party/I you requested (Diff 1 Diff 2). Elli (talk | contribs) 07:48, 6 December 2021 (UTC)
@Elli: In the S section, I altered
["Sinn Féin (Anti-Treaty)"] = "Sinn Féin",

to

["Sinn Féin (Anti-Treaty)"] = "Sinn Féin (Anti-Treaty)",

and

["Sinn Féin (Pro-Treaty)"] = "Sinn Féin",

to

["Sinn Féin (Pro-Treaty)"] = "Sinn Féin (Pro-Treaty)",

This seemed to fix the issue over on the infobox side over at 1922 Irish general election. However, this was reverted by Primefac with the message: "neither of these parties exist in the module, which is why they are alternate names". To be perfectly honest, I don't understand what that means in technical terms. I'm just seeking that both "Sinn Féin (Anti-Treaty)" and "Sinn Féin (Pro-Treaty)" display as such, rather than as simply "Sinn Féin". Thank you for your help so far. CeltBrowne (talk) 07:55, 6 December 2021 (UTC)

@CeltBrowne: ah, I see what you mean. They're currently just aliases for entries for Sinn Féin, and your edit aliased them to themselves. I'll go ahead and add them as their own entries. Elli (talk | contribs) 07:59, 6 December 2021 (UTC)
Done Elli (talk | contribs) 08:01, 6 December 2021 (UTC)
@CeltBrowne I've noticed that in most of your additions, the shortname you've added is identical to the party name. If you need the exact name as the name you are sending, why are you using the module? Can you point me to where this is an issue? Gonnym (talk) 09:08, 6 December 2021 (UTC)
@Gonnym: well, it's used in {{Infobox election}} which automatically pulls data from here. If there isn't a preferable shortname, then I guess it makes sense to use the exact name here. Elli (talk | contribs) 09:11, 6 December 2021 (UTC)
For the record, {{infobox election}} has a |partyX_name=, which if set to "no" will not go via the module. See this discussion for more. Primefac (talk) 09:13, 6 December 2021 (UTC)
Ah. Perhaps still useful for the color though? No strong opinion on if it's better to return these to aliases or not myself. Elli (talk | contribs) 09:14, 6 December 2021 (UTC)
Color is called regardless, this is only re: the shortname. Primefac (talk) 09:15, 6 December 2021 (UTC)
@Gonnym: @Primefac: Sorry, I wasn't aware of ability to bypass the module via the |partyX_name= function. I'm not really honed in on the more advanced aspects of coding here on Wikipedia, not yet anyway, I just learn as I go. I was just surprised earlier when I saw all the significant current Irish party names abbreviated and going through the module was just the first solution I came across. CeltBrowne (talk) 09:36, 6 December 2021 (UTC)
In fairness, that's a relatively recent change, and I honestly don't know if it's made it into the documentation for the infobox yet, so a little confusion is likely to be expected. Primefac (talk) 09:39, 6 December 2021 (UTC)
One thing I should also mention is; and maybe I'm not understanding this correctly (again, because code is not my forte): Until a shortname was entered for each Irish party, each instance of the party name in any infobox was defaulting to its abbreviation. So for example, Fianna Fáil was defaulting to simply "FF" across 29 separate general election articles (Irish parties tend to last a long time). Now, it is of course possible to go back and manually alter each one, but that's quite laborious. Also, this was not just the case in the main infobox; if we go to 2020 Irish general election#Results, that box was also rendering each party name as its abbreviation rather than its full name. It seems like each entry into the module should have a shortname by default, even if that was something like, hypothetically, "Party Name (Country)", as something seems better than a blank at the moment. If us more lower-level users are not really supposed to be inputting shortnames directly into the module, how else should we be going about things? Because as I said, in the case where the party has existed for quite a long time, this can lead to quite an amount of busywork. CeltBrowne (talk) 09:58, 6 December 2021 (UTC)
Check the discussions above this one - we've discussed the matter before about defaulting to a set of shortnames, but I don't think we've actually reached a consensus about the matter. Primefac (talk) 10:10, 6 December 2021 (UTC)
The issue here is that the /meta/shortname templates in question were not imported properly. For example, the {{Fine Gael/meta/shortname}} was "Fine Gael", while {{Fianna Fáil/meta/shortname}} was "Fianna Fáil", but these were not copied across into the module. Number 57 12:14, 6 December 2021 (UTC)
Any templates where the content was the same as the template name (as in the two examples you've provided) were ignored, as at the time we were going under the assumption that if you didn't have a shortname (or abbrev) it would just return the input party. Obviously the system has changed since then, but that's an easy reversal if there's consensus to do so. Primefac (talk) 12:41, 6 December 2021 (UTC)
That won't work either. Because then you'd have an editor who wants the abbr to return, but the template they are using requests the shortname, so then we're back to placing the abbr in the shortname field. Eventually one of three things would need to be done: overhaul and fixing the calling templates (best), using only one "short name" field (meh) or random value in each field (worst). Gonnym (talk) 12:55, 6 December 2021 (UTC)
It will work if what was in the shortname templates is put in the shortname fields. Editors can then agree on the best name to be used for the party in that field, as used to happen for the meta templates. The issue is absolutely not with the calling templates – it's caused by a failure of editors creating the module to properly replicate what was in the templates. Number 57 13:08, 6 December 2021 (UTC)
@CeltBrowne the answer would probably be that the templates or tables calling the module need to get an overhaul and be better designed. That means for example that in 2020 Irish general election#TDs who lost their seats the first row is calling {{party shortname linked|Fianna Fáil}}. However, that call is pointless if the result is "Fianna Fáil" (and in general, the more templates calls on a page, the slower it loads, so if there is no need for one, it really shouldn't be used). Instead of calling the template, just do Fianna Fáil. The module is not a substitute for incorrect usage. Gonnym (talk) 12:46, 6 December 2021 (UTC)
May I request that the abbreviation "IFF" is removed from "Independent Fianna Fáil", or that "Independent Fianna Fáil" becomes that party's short name, whichever is more correct code-wise. Thank you. CeltBrowne (talk) 13:27, 7 December 2021 (UTC)
  Done. Primefac (talk) 08:26, 19 December 2021 (UTC)


Nepalese party

["People's Progressive Party (Nepal)"] = {abbrev = "PPP", color = "#228B22", shortname = "PPP (N)",} 36.252.119.156 (talk) 18:44, 15 December 2021 (UTC) Till when do we have to wait? @Soman:, can you help here?

Added. Number 57 19:23, 19 December 2021 (UTC)

How to deal with colour change requests

I had a worrying feeling this would happen, but given the dozens of colour-change requests we've received in the past 48 hours we need to sort out how we're going to deal with this, especially since we have some editors enacting the protection requests and others rejecting them because of "no consensus". I'm all for being as accurate as possible, but something makes me think that we'll sit around debating colours all day if we need to have a consensus. On the other hand, one of the requests wanted a change from   to  , which are literally indistinguishable. Primefac (talk) 17:51, 16 December 2021 (UTC)

If the protection level has been downgraded to ECP across all the submodules, I don't think this will be a big issue on an ongoing basis; the particular issue here is that Block baby is not ECP yet; usually new editors are not so active in stuff like this. Number 57 18:25, 16 December 2021 (UTC)
Good point; we probably won't be fielding that many requests if it's ECP. Admin to admin, what say you about granting Block baby ExCon just so we can stop dealing with their requests? (I say this only half-joking...) Primefac (talk) 19:39, 16 December 2021 (UTC)
Primefac, instead of writing it all you could just confirm my requests and we will never intersect again. All I want is an orderliness with the colors of Ukrainian parties and nothing more. I requested to accept my suggested colors in Template-protected edit request on 16 December 2021 (2). These colors were selected according to the same parameters that you had when you changed the color of Batkivshchyna to #ed1c24. Block baby (talk) 20:01, 16 December 2021 (UTC)
Well, you're in luck, you've got ExCon now so you can edit the modules yourself! Primefac (talk) 20:13, 16 December 2021 (UTC)
(e/c) I wouldn't be opposed to that; they've been around a reasonable amount of time and seem to know what they're doing. Number 57 20:06, 16 December 2021 (UTC)
  Done. Primefac (talk) 20:13, 16 December 2021 (UTC)

Free Voters FW party color

pary color of free voters/ freie wähler in germany is wrong, they use orange not blue 80.156.219.243 (talk) 09:50, 17 December 2021 (UTC)

I've restored the colour that was in the meta template before it was deleted. Number 57 19:18, 19 December 2021 (UTC)

Hong Kong political parties

  • ["Professional Power"] = {abbrev = "", color = "#0E8AC8 ", shortname = "",

Pls add it. ChongTsz (talk) 03:38, 19 December 2021 (UTC)

  Done Number 57 19:17, 19 December 2021 (UTC)

Template-protected edit request on 19 December 2021

Change Civil Position party color to #FFDD00. This color is used by the party site. I would change it by myself, but this article has increased privacy. Block Baby (talk) 18:37, 19 December 2021 (UTC)

I've updated the protection to ECP. Cheers, Number 57 19:15, 19 December 2021 (UTC)

Labor Party (United States, 19th century)

["Labor Party (United States, 19th century)"] = {abbrev = "", color = "#FF6347", shortname = "Labor",}

This one badly needs a shortname added, the full name breaks a lot of the templates it's used in. --Asdasdasdff (talk) 01:26, 20 December 2021 (UTC)

  Done. – Jonesey95 (talk) 05:29, 20 December 2021 (UTC)

Social Democratic Movement

["Social Democratic Movement"] = {abbrev = "MDS", color = "#43B53C", shortname = "Social Democratic",}

"Democratic" also works as a short name. Krisgabwoosh (talk) 08:09, 21 December 2021 (UTC)

Done, but not the shortname. The party is listed as MDS where it appears in infoboxes (e.g. here). Number 57 12:44, 21 December 2021 (UTC)