Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -559,10 +559,9 @@ |
560 | 560 | $default_value = $sub_components[1]; |
561 | 561 | } elseif ( $sub_components[0] == 'preload' ) { |
562 | 562 | // free text field has special handling |
563 | | - if ( $field_name == 'free text' || $field_name = '<freetext>' ) { |
| 563 | + if ( $field_name == 'free text' || $field_name == '<freetext>' ) { |
564 | 564 | $free_text_preload_page = $sub_components[1]; |
565 | 565 | } else { |
566 | | - // this variable is not used |
567 | 566 | $preload_page = $sub_components[1]; |
568 | 567 | } |
569 | 568 | } elseif ( $sub_components[0] == 'show on select' ) { |
— | — | @@ -660,9 +659,13 @@ |
661 | 660 | $cur_value = ''; |
662 | 661 | } |
663 | 662 | |
664 | | - if ( $cur_value == null ) { |
665 | | - // set to default value specified in the form, if it's there |
666 | | - $cur_value = $default_value; |
| 663 | + if ( is_null( $cur_value ) ) { |
| 664 | + if ( $default_value ) { |
| 665 | + // Set to the default value specified in the form, if it's there. |
| 666 | + $cur_value = $default_value; |
| 667 | + } elseif ( $preload_page ) { |
| 668 | + $cur_value = SFFormUtils::getPreloadedText( $preload_page ); |
| 669 | + } |
667 | 670 | } |
668 | 671 | |
669 | 672 | // if the user is editing a page, and that page contains a call to |