Page MenuHomePhabricator

Images: {{largethumb}} template on nlwiki getting substituted on save
Closed, ResolvedPublic

Description

Author: romaine.wiki

Description:
The VisualEditor substitutes templates that shouldn't been substituted. The largethumb template got substituted on several occasions, like:

https://nl.wikipedia.org/w/index.php?title=Managua_%28stad%29&diff=38749742&oldid=38743043

If this continues to happen too long, we are forced to disable the VisualEditor for everyone as it changes things that absolutely should not be changed.


Version: unspecified
Severity: major
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=54315

Details

Reference
bz54803

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:28 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz54803.

Is this just the {{largethumb}} template, or are there others? (Templates that define some but not all of the parameters of an image are particularly troublesome.)

romaine.wiki wrote:

I haven't seen it happen with other templates so far.

This doesn't round trip in Parsoid.

Wanted to create an offline copy of nlwiki; but this bug is, for this usage, a showstopper.

The rendering is awful (but this is nothing new), for example:
http://parsoid-lb.eqiad.wikimedia.org/nlwiki/Abraham_Lincoln?oldid=39371115

... and such type of templates are widely used: ~10.000 articles only for {{largethumb}} on nlwiki. This bumps the whole size of the dump by a factor 2.

@James, good news: I have had a look a little bit around and I don't have found other templates working on the same principle.

(In reply to comment #4)

Wanted to create an offline copy of nlwiki; but this bug is, for this usage,
a
showstopper.

The rendering is awful (but this is nothing new), for example:
http://parsoid-lb.eqiad.wikimedia.org/nlwiki/Abraham_Lincoln?oldid=39371115

... and such type of templates are widely used: ~10.000 articles only for
{{largethumb}} on nlwiki. This bumps the whole size of the dump by a factor

@James, good news: I have had a look a little bit around and I don't have
found
other templates working on the same principle.

@Kelson, that is great news! Scott is looking into image rendering issues, so assigning to him. We should be able to add a special-case hack for this template and edit-protect affected images.

For proper editing the thumb parameter should be pulled out, as in |thumb|{{large}} with large returning just something like '400px'. That will require some convincing and bot activity.

@GABRIEL Do you mean Parsoid won't be able to parse this template in the same way like the PHP one does?

After discussing a little bit about that on the nlwiki IRC channel, they are (of course) not so happy about that. Not only because the thousands of pages but also because the template is old and a lot of people would have then to change their habits.

We can parse it (so that it renders as expected), but I don't see a sane way to represent multiple attributes generated by the same template for visual editing.

If the Parsoid will be able to parse this, this would at least avoid bad rendering (thumbnail at the right size) and fix (selfishly) my concern :)

Change 110095 had a related patch set uploaded by Subramanya Sastry:
WIP: Set up data-mw for all templated image attributes.

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

Change 110095 merged by jenkins-bot:
Set up data-mw for all templated image attributes.

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

Scheduled for deployment next Wednesday.