Page MenuHomePhabricator

CommonsMetadata should retrieve custom Credit Line through licensetpl_attr
Closed, ResolvedPublic

Description

On Wikimedia Commons, users may indicate how they wish to be attributed through two specific mechanisms.

One is the {{Credit line}} template − see for example [1]

The other one is the attribution parameter of license templates − see for example [2]

As documented in [3], the attribution line in the second mechanism is marked with a <span class='licensetpl_attr'> − the first one is not but I just made a proposal for it to be.

This information should be retrieved by CommonsMetadata.

[1] https://commons.wikimedia.org/wiki/File:Corse-du-Sud_Evisa.jpg
[2] https://commons.wikimedia.org/wiki/File:Car_Park_entrance_at_Ealing_Magistrates_Court_-_geograph.org.uk_-_1729971.jpg
[3] https://commons.wikimedia.org/wiki/Commons:Machine-readable_data


Version: unspecified
Severity: normal

Details

Reference
bz57460

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:38 AM
bzimport added a project: CommonsMetadata.
bzimport set Reference to bz57460.
Tgr added a comment.Nov 24 2013, 10:51 AM

The license template part will be covered by the pending patch in bug 57197.
{{Information}} fragments have their own mechanism, see the section about infobox templates on [[Commons:Machine-readable data]]. I think it would be better to follow that, and keep the licensetpl_* stuff for actual license templates.

{{Credit line}} already uses a fileinfotpl_credit attribute, except it is a class, not an id. I think the cleanest solution would be to change that to an id, and document it in [[Commons:Machine-readable data]].

Tgr added a comment.Nov 24 2013, 6:21 PM

Also, licensetpl_* fields will probably be handled in a more complex way due to the possibility of multilicensing - most clients will probably want to show a single license only, so we will try select the least restrictive one and ignore attributes not belonging to that. "Global", license-independent attributes should better not use that mechanism. (Although this is just speculation at this point, there is no proper handling of multiple licenses currently - that is bug 57259.)

Huh, well, not sure what I was supposed to do but whatever. Attribution specified through {{Credit line}} is now wrapped in a class="licensetpl_attr".

Tgr added a comment.May 29 2014, 10:15 PM

The current implementation of CommonsMetadata ignores licensetpl_* fields not wrapped in a licensetpl class, so this won't have any effect. As I said, adding it to the information template metadata syntax seems like a more logical solution to me.

(In reply to Tisza Gergő from comment #4)

The current implementation of CommonsMetadata ignores licensetpl_* fields
not wrapped in a licensetpl class, so this won't have any effect.

I know. I was merely trying to make a stab at harmonizing Commons various, « inconsistent » ways of specifying attribution. If that’s not useful, well, *shrug*.

(In reply to Jean-Fred from comment #5)

(In reply to Tisza Gergő from comment #4)

The current implementation of CommonsMetadata ignores licensetpl_* fields
not wrapped in a licensetpl class, so this won't have any effect.

I know. I was merely trying to make a stab at harmonizing Commons various, «
inconsistent » ways of specifying attribution. If that’s not useful, well,
*shrug*.

Scrap that, I misread your comment. Well, *shrug*² then.

Tgr added a comment.May 29 2014, 10:44 PM

Again, how about adding id="fileinfotpl_credit" (to the first column, not the second) instead of class="fileinfotpl_credit"? That would be at least consistent with how other {{Information}} fields are marked, and trivial to parse.

(In reply to Tisza Gergő from comment #7)

Again, how about adding id="fileinfotpl_credit" (to the first column, not
the second) instead of class="fileinfotpl_credit"? That would be at least
consistent with how other {{Information}} fields are marked, and trivial to
parse.

{{done}}

Change 136833 had a related patch set uploaded by Gergő Tisza:
Handle id="fileinfotpl_credit" and class="licensetpl_attr"

https://gerrit.wikimedia.org/r/136833

Change 136833 merged by jenkins-bot:
Handle id="fileinfotpl_credit" and class="licensetpl_attr"

https://gerrit.wikimedia.org/r/136833

Tgr added a comment.Jun 3 2014, 9:06 PM

(In reply to Tisza Gergő from comment #11)

can be tested after it is deployed on Commons (now-ish)

Uh, next Tuesday, I mean. Also, via a local API query - remote repo queries are cached more aggressively.

Gilles triaged this task as Unbreak Now! priority.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Needs Triage.Dec 4 2014, 11:22 AM