Jump to content

Module talk:SDcat: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
comment
Line 43: Line 43:
: {{re|cobaltcigs}} Infobox templates that generate short descriptions should be in the [[:Category:Templates that generate short descriptions]] and they should all add the <code>noreplace</code> parameter. Having the noreplace parameter prevents the short description from replacing any earlier defined short description, so the order won't matter: any explicit use of {{tl|short description}} will override a generated one.
: {{re|cobaltcigs}} Infobox templates that generate short descriptions should be in the [[:Category:Templates that generate short descriptions]] and they should all add the <code>noreplace</code> parameter. Having the noreplace parameter prevents the short description from replacing any earlier defined short description, so the order won't matter: any explicit use of {{tl|short description}} will override a generated one.
: If you think there's a maintenance value in looking at articles that have a generated and an explicit short description, then you can search for <code><nowiki>hastemplate:"Infobox settlement" hastemplate:"short description"</nowiki></code>, for example (and repeat for each of the other 36 templates in [[:Category:Templates that generate short descriptions]]). There are currently 527,822 articles with both {{tl|Infobox settlement}} and {{tl|short description}}. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 17:18, 28 September 2020 (UTC)
: If you think there's a maintenance value in looking at articles that have a generated and an explicit short description, then you can search for <code><nowiki>hastemplate:"Infobox settlement" hastemplate:"short description"</nowiki></code>, for example (and repeat for each of the other 36 templates in [[:Category:Templates that generate short descriptions]]). There are currently 527,822 articles with both {{tl|Infobox settlement}} and {{tl|short description}}. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 17:18, 28 September 2020 (UTC)
:: Negatory on the category, then? ―[[special:contributions/cobaltcigs|cobaltcigs]] 16:01, 30 September 2020 (UTC)

Revision as of 16:01, 30 September 2020

Testing

Check whether local short description matches that on Wikidata
Article Wikidata description Short description Category
Douglas Adams (Q42) English author and humourist (1952–2001) English author and humorist (1952–2001) Category:Short description is different from Wikidata
Christian art (Q645717) art genre Art genre Category:Short description matches Wikidata
Resultado do tratamento das fístulas enterovesicais para doença de Crohn (Q58861153) Category:Short description with empty Wikidata description

Wikidata is unavailable

@IceWelder: What is the point of this edit? Why would this module be used on a wiki where Wikidata is unavailable, and why would it be a good idea to populate the "different" tracking category with every single use if that were the case? * Pppery * it has begun... 16:37, 16 August 2020 (UTC)[reply]

Pppery, there is no guarantee that Wikidata is always available, and when it is not, this template produces an error displayed in red and bold on every single article using shortdescs. I use a local MediaWiki instance for preparing some of the articles I write and export/import the pages I intend to rewrite, which is how I noticed the issue. There are no trade-offs to this change. I assumed that the "different" category was the default, based on how the template was previously set up. If this is incorrect, I would be fine with changing it to another (I'm yet to test whether it works with none at all). IceWelder [] 16:44, 16 August 2020 (UTC)[reply]
You shouldn't mass-import templates from other wikis without making sure they make sense on the wiki they end up on. Neither {{short description}} nor Module:SDcat make any sense on any wiki that does not support Wikidata, therefore code to support such wikis is code bloat and does not belong. * Pppery * it has begun... 16:51, 16 August 2020 (UTC)[reply]
In my case specifically, they are not supposed to "make sense", just work for the purpose of displaying the article approximately like how it would appear here, which it does just fine. Adding this failsafe eases the process of quickly setting up such an instance. It also avoids errors here when Wikidata is offline for whatever reason. I checked on the template again locally and returning an empty string works just fine in this case. Implementing it that way would also avoid mass category-stuffing in the case of a Wikidata outage. IceWelder [] 17:02, 16 August 2020 (UTC)[reply]
I reverted the change for now but documented the new approach at Module:SDcat/sandbox. IceWelder [] 17:14, 16 August 2020 (UTC)[reply]
Wikidata was once offline, and the result was that viewing every single non-talk page produced an error, rendering any tracking category pollution irrelevant. * Pppery * it has begun... 17:23, 16 August 2020 (UTC)[reply]
If there's no connection to Wikidata, then the template should do nothing because it cannot determine the status of the short description in those circumstances. I've just made an edit to implement that. --RexxS (talk) 17:24, 16 August 2020 (UTC)[reply]
Looks similar to my proposed second solution, though even more concise. Thanks. IceWelder [] 17:25, 16 August 2020 (UTC)[reply]
Sorry, I didn't check the sandbox, but the line I added is my standard "catch error" for a missing wikibase connection. I agree with your assessment. --RexxS (talk) 17:29, 16 August 2020 (UTC)[reply]
No worries, your solution is better anyhow. I synced the sandbox to the main module's state, but if you won't need it, I can have it deleted again. IceWelder [] 07:05, 18 August 2020 (UTC)[reply]
Thanks, I can delete if needed, but I wouldn't normally bother. The next time someone wants to do tests, they have a sandbox already synced to work in. Cheers --RexxS (talk) 22:25, 18 August 2020 (UTC)[reply]

The following seemed too off-topic for the CFD discussion

So I found my way here from there. Forgetting about wikidata for a second, would it somehow be possible to detect pages with multiple local short descriptions? That would be an issue infinitely more worthy of maintenance categorization, especially when these do not match. I believe the most common scenario will be one description manually entered in the article's wikitext, and the other automatically generated from infobox parameters (which may or may not be positioned in that order, which may or may not matter—please advise). ―cobaltcigs 14:36, 28 September 2020 (UTC)[reply]

@Cobaltcigs: Infobox templates that generate short descriptions should be in the Category:Templates that generate short descriptions and they should all add the noreplace parameter. Having the noreplace parameter prevents the short description from replacing any earlier defined short description, so the order won't matter: any explicit use of {{short description}} will override a generated one.
If you think there's a maintenance value in looking at articles that have a generated and an explicit short description, then you can search for hastemplate:"Infobox settlement" hastemplate:"short description", for example (and repeat for each of the other 36 templates in Category:Templates that generate short descriptions). There are currently 527,822 articles with both {{Infobox settlement}} and {{short description}}. --RexxS (talk) 17:18, 28 September 2020 (UTC)[reply]
Negatory on the category, then? ―cobaltcigs 16:01, 30 September 2020 (UTC)[reply]