Validation - Array to string conversion error (line 709) |
[eluser]palaniappanc[/eluser]
I'm getting an unexpected error (array to string conversion in validation.php on line 709). Line 709: return str_replace(array("'", '"', '<', '>'), array("'", """, '<', '>'), stripslashes($data)); I'm trying to validate a form. Part of it contains a variable number of text fields, and so I've used name="printfilenames[]" to get every input as an array. If I submit the form without any data at all, I get the following as my $_POST array (job_id is a hidden input that is automatically populated). array 'job_id' => string '22' (length=2) 'printfilenames' => array 0 => string '' (length=0) 'filesavedto' => string '' (length=0) 'instructions' => string '' (length=0) 'jhb' => string '' (length=0) 'pjhb' => string '' (length=0) These are my validation rules: Code: $rules['printfilenames']="callback_printfilenames_check|required"; The only one that is an array is printfilenames Here is the printfilenames check function Code: function printfilenames_check($printfilenames) The error comes (obviously) after calling $this->validation->run() I checked the validation.php file, which seems to take care of looking at arrays if present. Why is this error being generated? Any ideas on what I can do? Thanks!
[eluser]vadivelan[/eluser]
The complete solution has been given here: http://ellislab.com/forums/viewthread/73012/
|
Welcome Guest, Not a member yet? Register Sign In |