Possible bug in set_value method of Form Validation Library |
[eluser]everdaniel[/eluser]
Hi Guys! I posted a comment about this in the forums yesterday and I think I found what's wrong with it a few hours ago, basically, my problem is: I'm trying to re-populate a form with data from a db using the set_value() function, but this function only works when I enter the edit page for the first time (following a link), it doesn't work if I enter the edit page clicking on a submit button. Reason is, if there is no data in the $_POST var, the fields that I define using set_rules() are not set, and the set_value() works. The set_value() only returns the default data if the field hasn't been set. Since I'm entering the page using a submit button, there is data in the $_POST var, the fields are set using the set_rules() and the form_validation returns the postdata he has for that field (which is empty, since I'm coming from another different page). For better clarification, in line 732 in Form_validation.php file we have: Code: if ( ! isset($this->_field_data[$field])) if the field is not set, the default data is returned, so if I change this to: Code: if ( ! isset($this->_field_data[$field]['postdata'])) then it works and the default data is set in the form fields. Can anyone here confirm this? if it's a bug or it's just me? Attached are files to test this. |
Messages In This Thread |
Possible bug in set_value method of Form Validation Library - by El Forum - 01-16-2009, 08:32 AM
Possible bug in set_value method of Form Validation Library - by El Forum - 02-19-2009, 08:43 PM
Possible bug in set_value method of Form Validation Library - by El Forum - 02-19-2009, 09:26 PM
Possible bug in set_value method of Form Validation Library - by El Forum - 02-20-2009, 06:26 PM
|