r99691 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99690‎ | r99691 | r99692 >
Date:16:34, 13 October 2011
Author:yaron
Status:deferred
Tags:
Comment:
Bug fix for displaying input type
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormField.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormField.php
@@ -225,9 +225,9 @@
226226 }
227227 $text .= $this->inputTypeDropdownHTML( $field_form_text, $default_input_type, $possible_input_types, $template_field->getInputType() );
228228
229 - if (! is_null( $template_field->getInputType() ) ) {
 229+ if ( !is_null( $template_field->getInputType() ) ) {
230230 $cur_input_type = $template_field->getInputType();
231 - } elseif (! is_null( $default_input_type ) ) {
 231+ } elseif ( !is_null( $default_input_type ) ) {
232232 $cur_input_type = $default_input_type;
233233 } else {
234234 $cur_input_type = $possible_input_types[0];
@@ -272,8 +272,12 @@
273273 }
274274 if ( ! $part_of_multiple ) { $text .= "| "; }
275275 $text .= "{{{field|" . $this->template_field->getFieldName();
 276+ // TODO - why is there an input type field in both the form field and the template
 277+ // field? One of them should probably be removed.
276278 if ( $this->mIsHidden ) {
277279 $text .= "|hidden";
 280+ } elseif ( !is_null( $this->getInputType() ) ) {
 281+ $text .= "|input type=" . $this->getInputType();
278282 } elseif ( $this->template_field->getInputType() != '' ) {
279283 $text .= "|input type=" . $this->template_field->getInputType();
280284 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r100930Fix to r99691 - correct check for empty input typeyaron01:32, 27 October 2011