Form submission

0

I'm trying to send a contact form, which uses the "Contact" model, save the data, but it does not even enter:

if (!empty($this->data)) {
    $this->Contato->save($this->data)
}

Give the following error:

"Attempt to access private method in class Error: The users table for the User model was not found. ".

Since the contact model has no connection with users, I'm not even using anything about users as well.

    
asked by anonymous 15.08.2014 / 02:09

1 answer

1

Solved, the Auth component, used for admin, was causing this conflict, I did as follows:

if (!isset($this->params['admin']) || !$this->params['admin']) {
    $this->Auth->enabled = false;
    $this->Auth->allow('*');
}

if (!empty($this->params['prefix']) && $this->params['prefix'] == "admin") {
    $this->Auth->enabled = true;

It includes "$ this-> Auth-> enabled = false", and I was able to work with $ this-> date normally.

    
15.08.2014 / 03:20