Last modified: 2013-07-10 23:03:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T52717, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50717 - VisualEditor: Transclusion dialog doesn't account for aliases when preventing duplicate entries from being added
VisualEditor: Transclusion dialog doesn't account for aliases when preventing...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: High normal
: VE-deploy-2013-07-11
Assigned To: Trevor Parscal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-04 04:54 UTC by Krinkle
Modified: 2013-07-10 23:03 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2013-07-04 04:54:56 UTC
Note that this is not the same as bug 50715. Though they behave the same from the user point of view, bug 50715 is for a case where aliases are not in play.

e.g. given our Unsigned template with parameter "user", "timestamp" and aliases "1" and "2" respectively.

Having added "mw.log('addParameterSearch-select', name, names);" to ve.ui.MWTransclusionDialog#getTemplatePage in the select event handler of the addParameterSearch object; editing the following invocations:

 case {{Unsigned|Foo|April 1}}
 case {{Unsigned|1=Foo|2=April 1}}
    typing "1"
    >  addParameterSearch-select null ["1", "2"]
    >  addParameterSearch-select "user" ["1", "2"]
    > "Add" is enabled
    typing "user"
    >  addParameterSearch-select null ["1", "2"]
    >  addParameterSearch-select "user" ["1", "2"]
    > "Add" is enabled

 case {{Unsigned|user=Foo|timestamp=April 1}}
    typing "1"
    >  addParameterSearch-select null ["date", "user"]
    >  addParameterSearch-select 1 ["date", "user"]
    > "Add" is enabled
    typing "user"
    >  addParameterSearch-select null ["date", "user"]
    >  addParameterSearch-select null ["date", "user"] 
    > "Add" is disabled

The latter case actually works as expected, although it is odd that the value given to the select callback is null and not "user" and that the button is already disabled (probably by the select widget?).

Also weird that the callback is constantly triggered twice, once for null and once for the actual value.

Anyway, the solution is to resolve the names to their alias origins before doing the names.indexOf( name ) check.
Comment 1 Krinkle 2013-07-04 04:55:35 UTC
Working on this.
Comment 2 Gerrit Notification Bot 2013-07-10 19:06:52 UTC
Change 73010 had a related patch set uploaded by Trevor Parscal:
Retain original param names and ignore leading/trailing whitespace

https://gerrit.wikimedia.org/r/73010
Comment 3 Gerrit Notification Bot 2013-07-10 22:57:56 UTC
Change 73010 merged by jenkins-bot:
Retain original param names and ignore leading/trailing whitespace

https://gerrit.wikimedia.org/r/73010
Comment 4 James Forrester 2013-07-10 23:03:20 UTC
This is now fixed in master and we will push to production very soon. Sorry for the inconvenience.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links