Page MenuHomePhabricator

VisualEditor: Clicking in a table that contains templated rows causes JS error
Closed, ResolvedPublic

Description

  1. Go to http://en.wikipedia.beta.wmflabs.org/wiki/User:RoanKattouw/Evil_table?veaction=edit
  2. Click on a non-templated cell in the table (e.g. the cell that says "simple" in row 2)
  3. "undefined is not a function" error appears in console

What happens is that TableMatrix#update runs, and when it hits cell (2,0) (3rd row, 1st column), it will find that cellNode is a ve.dm.MWTransclusionNode rather than a ve.dm.TableCellNode, and so calling .getRowSpan() on it will explode.

We probably need some way to deal with templated rows/cells in the middle of an otherwise normal table, but I'm not entirely sure what that should look like. Maybe we can get away with skipping over these rows/cells everywhere in a consistent manner, and hopefully that will work out OK?


Version: unspecified
Severity: critical

Details

Reference
bz72717

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 3:46 AM
bzimport set Reference to bz72717.

gerritadmin wrote:

Change 170245 had a related patch set uploaded by Esanders:
Add support for non-table nodes in tables (e.g. aliens)

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

gerritadmin wrote:

Change 170245 merged by jenkins-bot:
Add support for non-table nodes in tables (e.g. aliens)

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

Verified with the Evil_table given in the link - the js error is not displayed anymore.