From: Robert M. <xol...@ho...> - 2012-02-20 16:08:09
|
Hi, I'm using the formlink statement to place a copy-button on my content pages to pre-fill my form. Now I have multiple (numeric) fields which can have a value of "0" (the digit zero). SF seems not to handle that right, because all the 0-values are not copied to the form edit. It seems that SF uses the PHP empty() function to check the passed values, which also counts 0 and "0" as being empty. I tried to add testing for is_numeric() and that seems to work in that case. in SF_FormPrinter.php:OLD: if ( $form_submitted || ( ! empty( $field_query_val ) && ! is_array( $field_query_val ) ) ) { $cur_value = $field_query_val;} NEW: if ( $form_submitted || ( ! (empty( $field_query_val ) && ! is_numeric( $field_query_val)) && ! is_array( $field_query_val ) ) ) { $cur_value = $field_query_val;} I don't know if that is a bug or intended by design, but I think that that's a very rare case which was just not tested... Hope that helps, Robert |