Last modified: 2010-12-01 10:26:34 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 T26828, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24828 - Show on Select fields - All divs's are parsed regardless of which one is selected.
Show on Select fields - All divs's are parsed regardless of which one is sele...
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-08-17 17:01 UTC by Neill Mitchell
Modified: 2010-12-01 10:26 UTC (History)
1 user (show)

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


Attachments

Description Neill Mitchell 2010-08-17 17:01:25 UTC
Hi.

I'm using SF 1.9.1. I have the following:

{| class="formtable"
! width=25%|Area Grouping:
| {{{field|Area Groups|default=None|show on select=None=>none;North and 
East Hampshire=>ne_hampshire;West Hampshire=>w_hampshire;South East 
Hampshire=>se_hampshire}}}
|}

<div id="none">
{| class="formtable"
! width=10%|Areas:
| {{{field|Areas|input type=checkboxes|no autocomplete|property=Area|}}}
|}

</div>
<div id="ne_hampshire">
{| class="formtable"
! width=10%|Areas:
| {{{field|Areas|input type=checkboxes|no 
autocomplete|property=Area|default=Basingstoke & Deane Borough,Hart 
District,East Hampshire District,Rushmoor District,North and East 
Hampshire}}}
|}
</div>
<div id="w_hampshire">
{| class="formtable"
! width=10%|Areas:
| {{{field|Areas|input type=checkboxes|no 
autocomplete|property=Area|default=New Forest District,Test 
Valley,Eastleigh,Winchester City,West Hampshire}}}
|}
</div>
<div id="se_hampshire">
{| class="formtable"
! width=10%|Areas:
| {{{field|Areas|input type=checkboxes|no 
autocomplete|property=Area|default=Havant Borough,Gosport Borough, 
Fareham Borough,South East Hampshire}}}
|}

So, for example, if you select "North and East Hampshire", it correctly 
defaults the areas to the ones specified in the ne_hampshire div.

However, it then seems to process the other divs regardless and ends up 
setting the default= areas for w_hampshire, se_hampshire as well.  When 
you save the form you end up with ALL the default= property values in 
all the div's set for the area property, not just the ne_hampshire ones.

This is obviously a major issue and has caused a massive data integrity headache.

Thanks
Neill.
Comment 1 Yaron Koren 2010-08-25 19:38:01 UTC
I wouldn't call this a major issue - even if those default values get set, you could use #if calls in the template to ignore those values if the right conditions aren't met. I'm changing the severity from "critical" to "enhancement".
Comment 2 Neill Mitchell 2010-09-02 17:05:55 UTC
Hi Yaron.

I guess this will be covered off with the more dynamic forms that have been discussed on the mailing list. Looking forward to that functionality. So enhancement is definitely the right category :) 

Cheers
Neill.
Comment 3 Yaron Koren 2010-12-01 04:33:51 UTC
I think this has been fixed in v2.0.6, in that fields that are hidden due to "show on select" now no longer get their contents submitted. I'm marking this as "fixed" - feel free to re-open if not.
Comment 4 Neill Mitchell 2010-12-01 10:26:34 UTC
Great Yaron. Thanks a lot for that. I will check it out.

Cheers
Neill.

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


Navigation
Links