Template talk:Desc

From OpenStreetMap Wiki
Jump to navigation Jump to search

Renaming of the template

"Desc" is no good name for this template IMHO and it should be renamed, before use grows. This name is too common and doesn't refer to data items. My suggestions are {{Item desc}} or {{O desc}} (related to {{O}}). --Chris2map (talk) 20:55, 12 June 2022 (UTC)

Bug with empty value

Unresolved

Current behavior:
Adding this

{{desc|}}

to a page with English set up results in the following:

[empty string]

on Sandbox:

This item is used for Wikibase testing. Feel free to make any changes to it.

But on a page in another language, the template behaves differently:

Lua error in Module:OSMWikiBase at line 84: attempt to index local 'entity' (a nil value).

Expected behavior:
The same result regardless of the language. maro21 21:19, 3 January 2025 (UTC)

--

If no parameter is given the Module:OSMWikiBase tries to find a data item description using the page title. Obviously this works on page titles without a (language) namespace, e.g.:
- The page Sandbox (and there is the data item Item:Q2761 "Sandbox" from which is the description "This item is used for Wikibase testing. Feel free to make any changes to it.").
- Pages with "Key:" or "Tag:", if there is a linked data item with a description. (You can try it on e.g. Key:balcony and Tag:tourism=museum).
But it does not work with "DE:Key:" and "DE:Tag:" pages, etc.
I'm not good enough at scripting to be able to quickly adapt this. Maybe I can figure something out. --Chris2map (talk) 07:20, 4 January 2025 (UTC)