[go: up one dir, main page]

Page MenuHomePhabricator

Uncaught TypeError: Cannot read property 'getData' of null at AddLinkSaveDialog.ve.ui.MWSaveDialog.updateReviewMode
Closed, ResolvedPublicBUG REPORT

Description

I get this error when trying to open the diff ("review changes") panel in the save dialog:

Uncaught TypeError: Cannot read property 'getData' of null
    at AddLinkSaveDialog.ve.ui.MWSaveDialog.updateReviewMode

The references line is

diffMode = this.reviewModeButtonSelect.findSelectedItem().getData(),

so this caused by neither the visual diff mode nor the source diff mode button being selected. Probably some side effect of AddLinkSaveDialog, even though we don't intentionally affect the diff buttons there.

Event Timeline

It's probably caused by this part of ve.ui.MWSaveDialog.getSetupProcess:

this.reviewModeButtonSelect.selectItemByData(
    ve.userConfig( 'visualeditor-diffmode-' + surfaceMode ) || surfaceMode
);

getting confused by our custom surface mode.

Change 685107 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@master] Add Link: Select visual diff mode on save dialog setup

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

kostajh triaged this task as Medium priority.May 5 2021, 10:35 AM
kostajh moved this task from Backlog to May 3 - May 7 on the Add-Link board.
kostajh changed the subtype of this task from "Task" to "Bug Report".
kostajh moved this task from May 3 - May 7 to Done / QA on the Add-Link board.

Change 685107 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add Link: Select visual diff mode on save dialog setup

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

Not fully fixed. It doesn't happen anymore when switching to the diff dialog, but it happens when opening -> closing -> reopening the save dialog.

Change 687661 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@master] Fix diff mode override

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

I don't get why this is happening, updateReviewMode should only be called when displaying the diff panel but apparently that is not the case. Anyway, the new way of overriding the diff preference works around it.

Change 687661 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Fix diff mode override

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