Page MenuHomePhabricator

[Regression] WikiEditor "Table" dialog broken
Closed, ResolvedPublic

Description

Author: cristi.falcas

Description:
When using the WikiEditor to add a new table, the following message is printed:

"You have not entered a valid number of rows or columns."

It seems that in jquery.wikiEditor.dialogs.config.js, line 837, the following expression return true:

if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal )

From my tests, the culprit is rows !== rowsVal. It looks like one is a number and the other a string. Adding the following alert

alert (mw.msg(rows !== rowsVal)+mw.msg(rows)+mw.msg(rowsVal)+mw.msg(typeof rows)+mw.msg(typeof rowsVal));

uotputs this:

<true><3><3><number><string>

Currently I had to update the js script to remove the strict equality operators:

if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal )


Version: master
Severity: major

Details

Reference
bz38663

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:00 AM
bzimport added a project: WikiEditor.
bzimport set Reference to bz38663.

How Can we reproduce this? adding a table on en.wiki works. on which version of
wikimedia are you?

cristi.falcas wrote:

How can I found out?

I'm on master branch on extensions and mediawiki:

[root@localhost wiki]# git branch -r | sort -V

origin/HEAD -> origin/master

[root@localhost WikiEditor]# git branch -r | sort -V

origin/HEAD -> origin/master
origin/master
origin/wmf/1.20wmf1

check at [[special:version]] on the wiki.

cristi.falcas wrote:

MediaWiki 1.20alpha (2cc3faa)

WikiEditor (Version 0.3.1) (b88a866)

cristi.falcas wrote:

I'm not sure if this is the correct way, but I've done this:

git reset --hard e0adfee

and checked in the new file the comparison. It was also without strict.

I can reproduce this on mw.org i.e. with 1.20wmf8:
Open a page for editing, click the icon to insert a table, leave everything as it is, click insert.
Adding Krinkle to CC list, since probably https://gerrit.wikimedia.org/r/#/c/14014/ broke this.

rephrasing bug to be about the dialog (not the button). The basic table inserter (the default setting) works fine, the bug is in the dialog opt-in feature.

Regardless, this is indeed a regression from I445639b25a9688b3cdf9e5449e3d31cbcfa9c7ae.

My lint sweep exposed an oddity that was already in the code, fixing now.

Fixed in If32da14f80c6a0e4be3e1fe7fd0b650be4ed8a09.

As soon as it is reviewed I will request backport to 1.20wmf8. Expect deployment within 24h.