Page MenuHomePhabricator

VisualEditor: Adding a file/media fails with wrong wikicode (Image insertion sets resource='undefined')
Closed, ResolvedPublic

Description

Adding a file/media fails with wrong wikicode.

This wikicode is created, see URL:

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


Version: unspecified
Severity: major
URL: https://test.wikipedia.org/w/index.php?title=User:Raymond/image&diff=174461&oldid=174460

Details

Reference
bz49596

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 1:51 AM
bzimport set Reference to bz49596.

Roan, do we get the typeof:/etc. wrong at our end, or is this a Parsoid issue?

  • Bug 49795 has been marked as a duplicate of this bug. ***

(In reply to comment #3)

I get the same type of error:
<http://pt.wikipedia.org/w/index.
php?title=PLoS_ONE&diff=36119075&oldid=34872658>

On this example there is also something else: I think the code "direita,right" should be just "direita" or "right".

winne2i wrote:

The same on plwiki: https://pl.wikipedia.org/w/index.php?diff=36790309
("prawo" means "right" in polish, "ramka" means "frame")

  • Bug 49829 has been marked as a duplicate of this bug. ***

From bug 49829 comment 0:

This is the DOM returned by the VE after inserting a new thumbnail:
<figure typeof="mw:Image/Frame" class=" mw-halign-right">
<a rel="mw:thumb" href="http://commons.wikimedia.org/wiki/File:Apples.jpg">
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Apples.jpg/
100px-Apples.jpg" width="100" height="150" resource="undefined"></a></figure>
Note the 'undefined' in the resource attribute. The resource is the image
target, so we notice that the link and the image named 'undefined' differ and
serialize as
[[undefined|link=http://commons.wikimedia.org/wiki/File:Apples.jpg|thumb]].

This is partially fixed in gerrit 69581 which we will deploy this afternoon.

However, the link issue is still not fixed, thus (in the example in comment 0) we will now 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, but nothing like as terrible as it was. Forking that off to a new bug, bug 49844, and marking this as fixed.

What about commend 5 and comment 6?

(In reply to comment #10)

What about commend 5 and comment 6?

Sorry, yes; created as bug 49849.

  • Bug 50021 has been marked as a duplicate of this bug. ***