r99085 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99084‎ | r99085 | r99086 >
Date:10:57, 6 October 2011
Author:yaron
Status:deferred
Tags:
Comment:
Fixed validation of property type (Number, URL, Email) to only happen if the field is meant to hold a single value, not a list of values
Modified paths:
  • /trunk/extensions/SemanticForms/includes/forminputs/SF_TextInput.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextInput.php
@@ -89,9 +89,12 @@
9090 $input_id = "input_$sfgFieldNum";
9191 // Set size based on pre-set size, or field type - if field
9292 // type is set, possibly add validation too.
 93+ // (This special handling should only be done if the field
 94+ // holds a single value, not a list of values.)
9395 $size = 35;
9496 $inputType = '';
95 - if ( array_key_exists( 'field_type', $other_args ) ) {
 97+ if ( array_key_exists( 'field_type', $other_args ) &&
 98+ !array_key_exists( 'is_list', $other_args ) ) {
9699 if ( $other_args['field_type'] == 'number' ) {
97100 $size = 10;
98101 $inputType = 'number';

Follow-up revisions

RevisionCommit summaryAuthorDate
r99132Fix to r99085yaron19:59, 6 October 2011