Page MenuHomePhabricator

[Regression pre-wmf.12] VE crashes with an error "VM51:1122 Uncaught TypeError: Cannot read property 'thumbtime' of undefined" while trying to add an image
Closed, ResolvedPublic

Description

VE crashes with an error "VM51:1122 Uncaught TypeError: Cannot read property 'thumbtime' of undefined" while trying to add an image

Event Timeline

Deskana triaged this task as High priority.Jul 3 2018, 6:35 PM

Needs fixing before the next train.

I saw the || {} after model.getAttribute( 'mw' ) being removed, but I assumed that it was intentional and okay since all MWImageNodes should have the 'mw' attribute set – in the original version of rEVED5cdbc17899b5: Pass video thumbtime to thumbnail metadata request, MWInlineImageNodes didn't have it, but that was changed after code review.

I see now that we only updated the code which parses HTML to MWImageNodes data, and in the test cases, but apparently not the code that generates new images (ve.dm.MWImageModel#getUpdatedAttributes?).

But we should probably keep the 'mw' attribute optional, for compatibility with existing code that might be inserting images… (in case any gadget or something did that, or in case our own code does that somewhere else).

Change 443678 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] MWImageNode: Make 'mw' attribute optional again

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

Change 443678 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWImageNode: Make 'mw' attribute optional again

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

Jdforrester-WMF renamed this task from [Regression pre-wmf.11] VE crashes with an error "VM51:1122 Uncaught TypeError: Cannot read property 'thumbtime' of undefined" while trying to add an image to [Regression pre-wmf.12] VE crashes with an error "VM51:1122 Uncaught TypeError: Cannot read property 'thumbtime' of undefined" while trying to add an image .Jul 9 2018, 7:45 PM
Deskana claimed this task.