Last modified: 2014-08-14 13:56:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71497, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69497 - Embeddable HTML for file reuse is incorrect for files at the Commons
Embeddable HTML for file reuse is incorrect for files at the Commons
Status: RESOLVED DUPLICATE of bug 57458
Product: MediaWiki extensions
Classification: Unclassified
MultimediaViewer (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-13 22:03 UTC by Lupo
Modified: 2014-08-14 13:56 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Lupo 2014-08-13 22:03:56 UTC
https://commons.wikimedia.org/wiki/Template:Cc-by-sa-layout and possibly other license templates contain extra whitespace and in particular line breaks in the HTML-based license metadata.

The "Use this file" function includes these linebreaks in the generated embedding HTML, which then doesn't work correctly (the license isn't linked).

For https://commons.wikimedia.org/wiki/File:Saint-Pierre-de-M%C3%A9sage_%2838%29_-_Salle_des_f%C3%AAtes.jpg#mediaviewer/File:Saint-Pierre-de-M%C3%A9sage_%2838%29_-_Salle_des_f%C3%AAtes.jpg

The HTML generated is

<p><a href="https://commons.wikimedia.org/wiki/File:Saint-Pierre-de-M%C3%A9sage_(38)_-_Salle_des_f%C3%AAtes.jpg#mediaviewer/File:Saint-Pierre-de-M%C3%A9sage_(38)_-_Salle_des_f%C3%AAtes.jpg"><img alt="Saint-Pierre-de-Mésage (38) - Salle des fêtes.jpg" src="https://upload.wikimedia.org/wikipedia/commons/2/20/Saint-Pierre-de-M%C3%A9sage_%2838%29_-_Salle_des_f%C3%AAtes.jpg" height="960" width="1280"></a><br>"<a href="https://commons.wikimedia.org/wiki/File:Saint-Pierre-de-M%C3%A9sage_(38)_-_Salle_des_f%C3%AAtes.jpg#mediaviewer/File:Saint-Pierre-de-M%C3%A9sage_(38)_-_Salle_des_f%C3%AAtes.jpg">Saint-Pierre-de-Mésage (38) - Salle des fêtes</a>" by <a href="//commons.wikimedia.org/wiki/User:Parisdreux" title="User:Parisdreux" class="mw-redirect">Parisdreux</a> - <span class="int-own-work">Own work</span>. Licensed under <a title="Creative Commons Attribution-Share Alike 3.0
" href="http://creativecommons.org/licenses/by-sa/3.0
">CC BY-SA 3.0</a> via <a href="//commons.wikimedia.org/wiki/">Wikimedia Commons</a>.</p>

Note the linebreaks in the title and href attributes of the license link.

While this could be fixed in the templates, I think it'd be better to fix this in the MediaViewer by doing a trim() of the extracted metadata.
Comment 3 Andre Klapper 2014-08-14 06:47:17 UTC
(In reply to Lupo from comment #1)
> BTW, it'd be very nice if the MediaViewer would just generate the links back
> to the file

That is covered in bug 62266 instead.
Comment 4 Lupo 2014-08-14 11:52:25 UTC
(In reply to Andre Klapper from comment #3)
> That is covered in bug 62266 instead.

I don't understand. Bug 62266 is about browser history, not about the backlink generated into embeddable HTML.
Comment 5 Lupo 2014-08-14 13:27:59 UTC
Does MediaViewer use the extmetadata API? If so, this bug should probably moved to the MediaWiki API component:

https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&format=jsonfm&titles=File:Saint-Pierre-de-M%C3%A9sage%20%2838%29%20-%20Salle%20des%20f%C3%AAtes.jpg

returns:

"UsageTerms": {
  "value": "Creative Commons Attribution-Share Alike 3.0\n",
  "source": "commons-desc-page",
  "hidden": ""
},
"LicenseUrl": {
  "value": "http://creativecommons.org/licenses/by-sa/3.0\n",
  "source": "commons-desc-page",
  "hidden": ""
},


Again, note the line breaks in the values.
Comment 6 Tisza Gergő 2014-08-14 13:56:08 UTC

*** This bug has been marked as a duplicate of bug 57458 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links