Page MenuHomePhabricator

Insert above/below throwing error instead of adding a new row
Closed, DuplicatePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

Uncaught TypeError: c is null
    style ve.ui.TableAction.js:717
    insertRowOrCol ve.ui.TableAction.js:717
    insert ve.ui.TableAction.js:131
    executeWithSource ve.ui.Surface.js:737
    execute ve.ui.Command.js:43
    onActionButtonClick ve.ui.TableLineContextItem.js:67
    emit oojs.js:858
    onClick oojs-ui-core.js:2377
    jQuery 9
        dispatch
        handle
        add
        on
        each
        each
        on
        on
        on
    setButtonElement oojs-ui-core.js:2317
    OoUiMixinButtonElement oojs-ui-core.js:2260
    OoUiButtonWidget oojs-ui-core.js:3970
    VeUiTableLineContextItem ve.ui.TableLineContextItem.js:23
    VeUiInsertRowOrColumnContextItem ve.ui.TableLineContextItem.js:115
    create oojs.js:1683
    items ve.ui.Context.js:173
    setupMenuItems ve.ui.Context.js:171
    toggleMenu ve.ui.Context.js:150
    toggleMenu ve.ui.TableLineContext.js:183
    onIconMouseDown ve.ui.TableLineContext.js:120
    jQuery 2
ve.ui.TableAction.js:717:32
    style ve.ui.TableAction.js:717
    map self-hosted:175
    insertRowOrCol ve.ui.TableAction.js:717
    insert ve.ui.TableAction.js:131
    executeWithSource ve.ui.Surface.js:737
    execute ve.ui.Command.js:43
    onActionButtonClick ve.ui.TableLineContextItem.js:67
    emit oojs.js:858
    onClick oojs-ui-core.js:2377
    jQuery 9
        dispatch
        handle
    (Async: EventListener.handleEvent)
        add
        on
        each
        each
        on
        on
        on
    setButtonElement oojs-ui-core.js:2317
    OoUiMixinButtonElement oojs-ui-core.js:2260
    OoUiButtonWidget oojs-ui-core.js:3970
    VeUiTableLineContextItem ve.ui.TableLineContextItem.js:23
    VeUiInsertRowOrColumnContextItem ve.ui.TableLineContextItem.js:115
    create oojs.js:1683
    items ve.ui.Context.js:173
    map self-hosted:175
    setupMenuItems ve.ui.Context.js:171
    toggleMenu ve.ui.Context.js:150
    toggleMenu ve.ui.TableLineContext.js:183
    onIconMouseDown ve.ui.TableLineContext.js:120
    jQuery 2
        dispatch
        handle

What should have happened instead?:

A new row inserted in the table

Event Timeline

I do seem to be able to insert below the second to last row and then move the new row down. Firefox 135.0, MacOS

Looks like T189826: Meta nodes are moved outside of table cells / list items when they appear as their last children, which breaks editing of those tables/lists.

The Parsoid HTML has the <link> tag at the end of a <td>…</td> tag: https://www.mediawiki.org/w/rest.php/v1/revision/7059754/html

image.png (1×1 px, 247 KB)

In VE debug mode, you can see that the corresponding node is outside of the corresponding table cell: https://www.mediawiki.org/w/index.php?oldid=7059754&veaction=edit&debug=true

image.png (1×1 px, 180 KB)

As a result, VE tries to treat that category node as if it was a table cell, and things go wrong. This exception is thrown when it tries to copy its style to the new row (whether it is a content or header cell), but if it wasn't that, something else would probably break.

Should this block today's train promotion?

dduvall triaged this task as Unbreak Now! priority.EditedFeb 27 2025, 7:34 PM

Just a reminder that all train blockers need to be UBN. If this isn't a blocker, please remove the parent task.