Welcome Guest, Not a member yet? Register   Sign In
Form Validation - returns "(Anonymous function)"

(This post was last modified: 03-13-2018, 07:02 AM by sintakonte.)

Hey guys,

i migh've found some bug.

In the docs there is a section called Callable use anything as a rule

I've an object where i do the following
PHP Code:
$this->arrValidationRules[] = array(
'field' => 'personid',
'label' => 'Duplicatecheck',
'rules' => array('check_duplicates', array($this->ci()->Cppersonsave_model,'duplicatesCheck'))

After that i ran the Validation like

PHP Code:

if (!
    throw new 

an excerpt of the model function looks like

PHP Code:
if ($col->count() > 0)
$this->form_validation->set_message('check_duplicates''This person already exists!');

return (
$col->count() > 0   false      true

My model function get called correctly.

But if i do that an error message appears (Anonymous function)

i debugged the code and got the following information 

In line 687 in the Form_validation Library the variable callable is set to true.
On Line 741 the $rule variable gets the callable value which is a boolean and therefore true.

This leads to line 799 which exactly put my message out.

Am i'm missing something here or is this a bug ?

Thx in advance for your answers

Messages In This Thread
Form Validation - returns "(Anonymous function)" - by sintakonte - 03-13-2018, 06:57 AM

Theme © iAndrew 2016 - Forum software by © MyBB