Last modified: 2010-01-08 06:30:41 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 T23552, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21552 - error in validate_type_of_multiple_fields (SF_FormUtils)
error in validate_type_of_multiple_fields (SF_FormUtils)
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Normal major (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-17 19:03 UTC by Jack D. Pond
Modified: 2010-01-08 06:30 UTC (History)
1 user (show)

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


Attachments
patch for order error in validate_type_of_multiple_fields (SF_FormUtils) (926 bytes, patch)
2009-11-17 19:03 UTC, Jack D. Pond
Details

Description Jack D. Pond 2009-11-17 19:03:28 UTC
Created attachment 6798 [details]
patch for order error in validate_type_of_multiple_fields (SF_FormUtils)

I don't know if this covers more than dates, but at least for type=date, the IDs for the field tags for multiple part fields in the form are in the format "input_<<field_num>>_<<instance_num>>", example:
id="input_123_day"
id="input_123_month"
id="input_123_year"
. . .

This javascript was looking for them in the format "input_<<instance_num>>_<<field_num>>", example:
id="input_day_123"
id="input_month_123"
id="input_year_123"

The attached patch fixes that order.

Unknown:  Will this cause or fix problems with validate_type_of_multiple_fields with type other than "date"?

Causes browser hangs in large forms
Comment 1 Yaron Koren 2009-12-22 19:23:04 UTC
I can't duplicate this problem; date validation works fine for me on multiple-instance templates. Is this still an issue?
Comment 2 Jack D. Pond 2009-12-23 21:51:30 UTC
Yes, this is still a problem.  To replicate, do validation when you have MULTIPLE instances of a multiple-instance template.  Only the first will be validated because the javascript only verifies the passed ID.

This was a big problem for us - and would not alow us to have multiple instances of where file uploads occured - the upload popup will fail.
Comment 3 Jack D. Pond 2009-12-23 21:56:34 UTC
Yaron, wasn't this an IE only problem?   I just remember you couldn't save a form because the validations would never pass.
Comment 4 Jack D. Pond 2009-12-29 15:36:44 UTC
(In reply to comment #1)
> I can't duplicate this problem; date validation works fine for me on
> multiple-instance templates. Is this still an issue?

This error occurs when there are multiple instances of multi-part forms that contain any fields that use validate_type_of_multiple_fields.  The primary example of this is dates.  You can reproduce this in two ways:

1. Create a multi-part form that uses at least two different templates each having a unique field that uses the above validate:
2. Create a multiple instance form with a field that has the validate in question.

In either case, the second field would fail to validate because it doesn't exist (found this out by debugging the javascript).

To validate the existence of this bug, I offer three options:

1. Use the below code (you'd have to create your own templates or get them from me)
2. Contact me and I'll set up a site to demonstrate
3. Take my word for it - this is a real a replicable problem solved by the attached fix (which doesn't have any performance or security issues)

<pre>
{{{info|Add title=Add New Change/Incident Report|edit title=Edit New Change/Incident Report|page name=CIR-<unique number;start=000000>}}}
{{{for template|Change Incident Report}}}
{| {{FormStyle}} style="width:100%"
|-
| colspan=2 | {{{field|Name|size=80}}}
| colspan=2 | {{{field|Date|input type=datetime|default=now}}}
|}
{{{end template}}}

{{{for template|Activity Plan|multiple}}}
{| {{FormStyle}} style="width:100%"
|-
! style="vertical-align:text-top;" | &nbsp;&nbsp;Expected Time to Complete:
| {{{field|Expected Time to Complete|input type=datetime|default=now}}}
|}
{{{end template}}}
</pre>
Comment 5 Jack D. Pond 2009-12-29 15:39:52 UTC
(In reply to comment #4)
Also, the symptom is that the browser hangs (can't find the field in question), until the browser times out - this may be especially noticeable in IE, may just appear as an error in other browsers.
Comment 6 Yaron Koren 2010-01-08 06:30:41 UTC
Setting to "invalid" - this is apparently no longer a bug in the current version of SF.

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


Navigation
Links