Last modified: 2014-03-18 22:11:52 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 T51844, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49844 - Images: New images get a link=… set whether or not they need it
Images: New images get a link=… set whether or not they need it
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal minor
: ---
Assigned To: C. Scott Ananian
:
: 49848 (view as bug list)
Depends on:
Blocks: 54844
  Show dependency treegraph
 
Reported: 2013-06-19 22:45 UTC by James Forrester
Modified: 2014-03-18 22:11 UTC (History)
10 users (show)

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


Attachments

Description James Forrester 2013-06-19 22:45:21 UTC
Follow-on from bug 49596.

The insertion of a new image adds link=… whether or not it's been actively set away from the default.

Thus (in the example in bug 49596 comment 0) we get:

[[File:CV.03326.jpg|link=https://commons.wikimedia.org/wiki/File:CV.03326.jpg|right|framed|424x275px]]

… instead of:

[[File:CV.03326.jpg|right|framed|424x275px]]

… which is bad in terms of wikitext-user utility.
Comment 1 Ed Sanders 2013-06-21 11:56:30 UTC
This looks like a Parsoid issue:
Comment 2 Ed Sanders 2013-06-21 11:57:59 UTC
<span typeof="mw:Image" ><a href="./File:VisualEditor-logo.svg" data-parsoid="{'a':{'href':'./File:VisualEditor-logo.svg'}}"><img src="http://vewiki/MediaWiki/images/thumb/1/12/VisualEditor-logo.svg/300px-VisualEditor-logo.svg.png" resource="./File:VisualEditor-logo.svg" width="300" height="105"></a></span>

serialises to:

[[File:VisualEditor-logo.svg|300x105px]]

Whereas

<span typeof="mw:Image" ><a href="./File:VisualEditor-logo.svg"><img src="http://vewiki/MediaWiki/images/thumb/1/12/VisualEditor-logo.svg/300px-VisualEditor-logo.svg.png" resource="./File:VisualEditor-logo.svg" width="300" height="105"></a></span>

(removed data-parsoid from <a> tag)

serialises to:

[[File:VisualEditor-logo.svg|link=File:VisualEditor-logo.svg|300x105px]]
Comment 3 Gerrit Notification Bot 2013-06-25 22:09:25 UTC
Related URL: https://gerrit.wikimedia.org/r/70551 (Gerrit Change I75dbbfdd248a6f5696252ef3a2d7ca6ede0fa156)
Comment 4 James Forrester 2013-06-26 02:43:46 UTC
*** Bug 49848 has been marked as a duplicate of this bug. ***
Comment 5 James Forrester 2013-06-26 02:44:23 UTC
This is worked around (albeit with potentially a bit of a hack) in VisualEditor, so not so important now from VisualEditor's POV.
Comment 6 Andre Klapper 2013-07-04 10:33:40 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]
Comment 7 ssastry 2013-11-22 00:56:13 UTC
I cannot reproduce this on latest master.

[subbu@earth lib] cat /tmp/img.html
<span typeof="mw:Image" ><a href="./File:VisualEditor-logo.svg"><img src="http://vewiki/MediaWiki/images/thumb/1/12/VisualEditor-logo.svg/300px-VisualEditor-logo.svg.png" resource="./File:VisualEditor-logo.svg" width="300" height="105"></a></span>
[subbu@earth lib] node parse --html2wt < /tmp/img.html
[[File:VisualEditor-logo.svg|300x300px]]
Comment 8 C. Scott Ananian 2013-12-23 15:07:24 UTC
This should be fixed by https://gerrit.wikimedia.org/r/103082 (if it wasn't already fixed).  Should be verified fixed by the VE team once this lands (and their local workaround reverted?).
Comment 9 C. Scott Ananian 2014-02-19 22:07:39 UTC
This bug is fixed; opened bug 61560 for the VE team to revert their workaround hack.
Comment 10 James Forrester 2014-03-01 01:39:14 UTC
Still appears to be happening now that the workaround is removed:

http://en.wikipedia.beta.wmflabs.org/w/index.php?title=User:Whatamidoing_(WMF)/Sandbox&diff=81525&oldid=81245
Comment 11 C. Scott Ananian 2014-03-17 15:54:46 UTC
Hm, maybe this only occurs with images from commons now?  Can you confirm that, James?  It would be helpful to see exactly what VE is giving to Parsoid for new images, and how you are indicating that the link is the default.
Comment 12 C. Scott Ananian 2014-03-17 16:04:24 UTC
Hm, I note that the DOM spec describes "resource attribute on image" this way:

> link to image resource page. TODO: what to use for images from commons?

I'm guessing this is the root of the problem.  What is VE currently setting the resource attribute to, for images from commons?
Comment 13 C. Scott Ananian 2014-03-17 17:30:36 UTC
Ok, from looking at the code I can confirm that the link= attribute should be suppressed iff the img[resource] attribute is equal to the a[href].  I'm guessing that autocommons is screwing with this?
Comment 14 C. Scott Ananian 2014-03-17 18:20:39 UTC
mooeypoo and I tried to reproduce without success.  the code looks correct: the link option is suppressed iff a[href] == img[resource].   Both of these should be local relative URLs, since the only way external images can be referenced is via instacommons (which provides local URLs for the image).
Comment 15 C. Scott Ananian 2014-03-17 18:36:02 UTC
Clarified the spec: https://www.mediawiki.org/w/index.php?title=Parsoid%2FMediaWiki_DOM_spec&diff=931265&oldid=931084
I believe Parsoid's behavior is correct.
Comment 16 Gerrit Notification Bot 2014-03-17 18:39:19 UTC
Change 119087 had a related patch set uploaded by Cscott:
Clarified the default link for image insertion.

https://gerrit.wikimedia.org/r/119087
Comment 17 Gerrit Notification Bot 2014-03-17 18:45:00 UTC
Change 119087 merged by jenkins-bot:
Clarified the default link for image insertion.

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

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


Navigation
Links