Last modified: 2011-12-12 05:22:13 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 T28088, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26088 - Have combobox allow only existing values
Have combobox allow only existing values
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-23 19:23 UTC by skew
Modified: 2011-12-12 05:22 UTC (History)
3 users (show)

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


Attachments
one-to- many validation (2.58 KB, patch)
2011-12-09 08:33 UTC, Vladimir Kostyukov
Details

Description skew 2010-11-23 19:23:36 UTC
Consider a field that lets a user set a value based on category Wiki Page:

   {{{field|Homepage|autocomplete on category=Wiki Page}}}

Today, this field specification will allow the user to save a value that does not exist.  I propose that the field be defined so that the final value is limited to existing values.  For example, 

   {{{field|Homepage|autocomplete on category=Wiki Page|mustexist}}}

The user could still type in a non-existing page, since it's a combobox.  Existence is verified after the user hits "Save page".  If the value does not exist within the specified set (category=Wiki Page above), an error message displays and the form stays open.  This behavior would match that of a mandatory string field that is empty on "Save page".
Comment 1 Yaron Koren 2010-11-24 16:48:57 UTC
Ignore previous description, see new subject line.
Comment 2 Yaron Koren 2011-03-08 18:59:42 UTC
This feature has been added to SF in version 2.1, with the new "existing values only" parameter.
Comment 3 badon 2011-12-09 06:45:36 UTC
Reopened. I just tested this feature with Semantic Forms 2.2.1 and 2.3.1 and it is only partially working, just barely. The only time it works that I was able to find is when focus changes. 

If the user immediately clicks the "Submit" button, or just hits the "Enter" key while focus is still in the field, any non-existing value can be submitted.

I tested input types combobox and text with autocomplete, with both single values and multiple.

It appears that this bug is being worked on already:

http://wikimedia.7.n6.nabble.com/quot-one-to-many-quot-validation-td678004.html#a678006
Comment 4 Vladimir Kostyukov 2011-12-09 08:33:21 UTC
Created attachment 9644 [details]
one-to- many validation

Fixed bug with focus;
Added validation for fields with autocomplete;
Comment 5 Yaron Koren 2011-12-09 17:39:36 UTC
I don't think the issues with the focus are cause enough to re-open this feature request - the basic functionality is now there. And note that it applies to the 'combobox' input, not any other input type. I'm resetting this to 'fixed'.
Comment 6 badon 2011-12-10 21:37:20 UTC
Reopened.

There are no issues with the focus as far as I can tell. It appears to me that it works perfectly in all of my tests. The issue is that nothing else works, and the goal proposed in this report has definitively not been achieved:

> The user could still type in a non-existing page, since it's a combobox. 
> Existence is verified after the user hits "Save page".  If the value does not
> exist within the specified set (category=Wiki Page above), an error message
> displays and the form stays open.  This behavior would match that of a
> mandatory string field that is empty on "Save page".

The combobox still will:

* allow non-existing values to be saved.
* no error message is displayed
* the form does not remain open to allow the user to fix the error in the same manner as the behavior invoked by the "mandatory" parameter

Although the focus feature is interesting, I think it should be removed. The focus feature will delete all of the data the user entered if there is a minor typographical error, with no opportunity to fix it. 

In the case where a user meticulously enters in some data, and then switches to another browser tab to check that the data is entered in correctly, it would be more than a little annoying for the user to come back to the form and see all of the data has been erased.
Comment 7 Yaron Koren 2011-12-11 02:55:05 UTC
The idea that validation should be improved is a valid opinion, but nevertheless it belongs in a different feature request, if anywhere, since this feature already exist. Marking back to "fixed".
Comment 8 badon 2011-12-12 05:22:13 UTC
Fresh report:

https://bugzilla.wikimedia.org/show_bug.cgi?id=32976

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


Navigation
Links