Welcome Guest, Not a member yet? Register   Sign In
My validation callback isn't getting called. :(
#5

[eluser]Kinsbane[/eluser]
[quote author="Sumon" date="1222822054"]Paste your call back function as well as the line where you call that function.[/quote]

Here's the register function:
Code:
function register()
    {
        $rules[$this->config->item('auth_user_name_field')] = $this->config->item('auth_user_name_field_validation_register');
        $rules[$this->config->item('auth_user_password_confirm_field')] = $this->config->item('auth_password_required_confirm_validation')."|matches[".$this->config->item('auth_user_password_field')."]";
        $rules[$this->config->item('auth_user_password_field')] = $this->config->item('auth_user_password_field_validation_register');
        $rules['email'] = 'trim|required|valid_email|xss_clean|callback_email_dupliate_check';
        
        if ($this->config->item('auth_use_country'))
            $rules[$this->config->item('auth_user_country_field')] = $this->config->item('auth_user_country_field_validation_register');
        
        //additionalRegistrationRules($rules);
        
        $this->validation->set_rules($rules);
        
        if ($this->validation->run() && $this->authlib->register())
        {
            $this->load->view($this->config->item('auth_register_success_view'));
            $this->output->enable_profiler(TRUE);
        }
        else
        {
            $this->db_session->flashdata_mark();
            $this->register_index();
        }
    }

Here's the callback function:
Code:
function email_duplicate_check($value)
    {
        die('Is this callback even getting called?');
        $this->obj->db->where('email', $value);
        $query = $this->obj->db->get($this->obj->config->item('auth_user_table_name'));
        
        if (($query != null) && ($query->num_rows() > 0))
        {
            $this->validation->set_message('email_duplicate_check', 'The email address <strong>'.$value.'</strong> is already in use.');
            return false;
        }
        
        return true;
    }

The email_duplicate_check is the exact same function as the one that checks for dupe usernames, and that callback function works. This one, though, never even gets called.

If you're wondering about the $this->register_index(), the controller is working as it should, as the register_index() function just displays the view file. When the validation fails, all appropriate error messages get displayed, no problem.


Messages In This Thread
My validation callback isn't getting called. :( - by El Forum - 09-30-2008, 01:22 PM
My validation callback isn't getting called. :( - by El Forum - 09-30-2008, 01:40 PM
My validation callback isn't getting called. :( - by El Forum - 09-30-2008, 01:47 PM
My validation callback isn't getting called. :( - by El Forum - 09-30-2008, 02:55 PM
My validation callback isn't getting called. :( - by El Forum - 09-30-2008, 02:58 PM
My validation callback isn't getting called. :( - by El Forum - 09-30-2008, 03:02 PM
My validation callback isn't getting called. :( - by El Forum - 09-30-2008, 04:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB