Sending form

Asked

Viewed 49 times

0

I am trying to send a contact form, which uses the model "Contact", save the data, however, it does not enter the:

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

From the following error:

"Attempt to access private method in class Error: Table users for User model not found.".

Being that the contact model, has no connection with users, and I’m not using anything related to users either.

1 answer

1

Solved, the Auth Component, used for the 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->data normally.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.