Page MenuHomePhabricator

SemanticMediaWiki: ol/ul and map print formats: Inconsistent template arguments
Closed, DeclinedPublic

Description

Author: van.de.bugger

Description:
Actual problem in SemanticMaps, but decision should be made on SemanticMediaWiki level; so I am setting Component' to SemanticMediaWiki'. Later we can change it to `SemanticMaps'.

{{ #ask: ...

mainlabel = -
?Waypoint id
?Location no
?Location title
?Coordinates
?Description
format = ol (or ul' or template')
template = test

}}

Template `test' receives arguments:

1 = Waypoint id
2 = Location no
3 = Location title
4 = Coordinates
5 = Description

If I change format to map', template test' receives arguments:

1 = Location no
2 = Location title
3 = Description

This makes switching between different type of representation quite hard. I strongly believe template should receive the exactly same list of positional arguments regardless of used format. I know that map' printer handles Coordinates and passes to template two named arguments latitude' and `longitude' -- that's completely ok; but I do not see reason for changing positional arguments.

If you agree with idea that template should receive the same list of positional arguments regardless of format, I will try to prepare a patch.


Version: unspecified
Severity: normal

Details

Reference
bz32657

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:00 AM
bzimport set Reference to bz32657.

Changing this would break compat. I think having named params instead if a better way to go.

van.de.bugger wrote:

Changing this would break compat.

I knew it.

To my taste it is better to fix and document it, rather than maintain undocumented behaviour. But you decide.

van.de.bugger wrote:

Implementation of the named args.

Initial implementation of the named args.

There is still work to do. Named args in ol'/ul'/template' formats depends on printout statement: ?Property' causes argument to be a link, while ?Property#' causes argument to be plain text. In map' format, argument always plain text, which is not good. It should depend on printout to behave similar to other formats.

Attached:

`?Property#' causes argument to be plain text

This is behavior I'm actually not really familiar with. I do suspect that it is not applied consistently at all, and might only be implemented correctly in the list printers.