SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Employee.username' in 'where clause' - sql

I am trying to get my login working with CakePHP 2.4.7 but I seemed to run into a problem. I am using the 'Employees' as the user of the database.
I got this error
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Employee.username' in 'where clause'
and after i changed all my 'username' fields to employee_username, I'm still getting the same error. Could someone please help?
Below is my code for AppController, EmployeeController, Employee and login.ctp:
AppController:
class AppController extends Controller {
public $components = array(
'DebugKit.Toolbar',
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'employees', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'employees', 'action' => 'login'),
'authError' => 'You must be logged in to view this page.',
'loginError' => 'Invalid Username or Password entered, please try again.',
'authenticate' => array(
'Form' => array(
'fields' => array('username' => 'employee_username', 'password' => 'employee_pw'),
'userModel'=>'Employee'
))
));
// only allow the login controllers only
public function beforeFilter() {
$this->Auth->allow('login');
}
}
EmployeesController:
class EmployeesController extends AppController {
/**
* Components
*
* #var array
*/
//public $components = array('Paginator');
public $paginate = array(
'limit' => 25,
'conditions' => array('status' => '1'),
'order' => array('Employee.employee_username' => 'asc' )
);
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('login','add');
}
public function login() {
//if already logged-in, redirect
if($this->Session->check('Auth.Employee')){
$this->redirect(array('action' => 'index'));
}
// if we get the post information, try to authenticate
if ($this->request->is('post')) {
$result = $this->Employee->findByUsername($this->data['Employee']['employee_username']);
if ($this->Auth->login(/*$result['Employee']*/)) {
$this->Session->setFlash(__('Welcome, '. $this->Auth->user('employee_username')));
$this->redirect($this->Auth->redirectUrl());
} else {
$this->Session->setFlash(__('Invalid username or password'));
}
}
}
public function logout() {
$this->redirect($this->Auth->logout());
}
/**
* index method
*
* #return void
*/
public function index() {
$this->paginate = array(
'limit' => 6,
'order' => array('Employee.employee_username' => 'asc' )
);
$employees = $this->paginate('Employee');
$this->set(compact('employees'));
}
Employee Model:
public $validate = array(
'id' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'employee_name' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'date_hired' => array(
'date' => array(
'rule' => array('date'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
/*'employee_phone_number' => array(
'phone' => array(
'rule' => array('phone'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),*/
'employee_email' => array(
'email' => array(
'rule' => array('email'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'employee_dob' => array(
'date' => array(
'rule' => array('date'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'access_level' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'employee_username' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'employee_pw' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
);
login.ctp
<div class=“employees form">
<?php echo $this->Session->flash('auth'); ?>
<?php echo $this->Form->create('Employee'); ?>
<fieldset>
<legend>
<?php echo __('Please enter your username and password'); ?>
</legend>
<?php echo $this->Form->input('employee_username');
echo $this->Form->input('password');
?>
</fieldset>
<?php echo $this->Form->end(__('Login')); ?>
</div>

Related

Change the url associated with cancel button

I want to change the URL of cancel button presently on canceling the page it is showing me the list but I want to redirect the user on the cancel button.
public function renderForm() {
$this->fields_form = array(
'legend' => array('title' => $this->l('Additional Service'), 'icon' => 'icon-cogs'),
'input' => array(
array(
'type' => 'text',
'label' => $this->l('id_citydelivery'),
'name' => 'id_citydelivery',
'size' => 255),
array(
'type' => 'text',
'label' => $this->l('Service_name'),
'name' => 'service_name',
'size' => 255,
'required' => true,
'desc' => $this->l('Enter name of Arrival port')
),
array(
'type' => 'switch',
'label' => $this->l('Active'),
'name' => 'active',
'required' => false,
'is_bool' => true,
'values' => array(array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Active')), array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Inactive')))),
),
'submit' => array('title' => $this->l('Save')),
);
return parent::renderForm();
}
After Diving into the code I came to know back button URL is set it by $_post['Back']
So I have overridden it; you have to change # with your URL
public function postProcess() {
if (Tools::getIsset('submitAddadditional_service')) {
$this->redirect_after = Context::getContext()->link->getAdminLink('AdminGCardeliverycity', true) . '&updatecitydelivery&id_citydelivery=' . Tools::getValue('id_citydelivery');
} else {
$_POST['back'] = '#'; //For Cancel button url on form which is genrated by renderform()
}
parent::postProcess();
}

how to remove the view button and list buttons from fields_list in prestashop 1.6.3

I want to remove the view button and list buttons such as Export ,Add button from fields_list in prestashop 1.6
Below is my render listview code, This list is populated when the view button is clicked from the main list view page
public function renderView()
{
if(Tools::getValue('id_query_dr')){
$id_query_dr =Tools::getValue('id_query_dr');
$this->module = new QueryDrDetail();
$this->context = Context::getContext();
$this->id_lang = $this->context->language->id;
$this->lang = false;
$this->ajax = 1;
$this->path = _MODULE_DIR_.'querydrdetail';
$this->default_form_language = $this->context->language->id;
$this->table = 'kits_query_dr_detail';
$this->className = 'querydrdetail';
$this->identifier = 'id_query_dr_detail';
$this->allow_export = true;
$this->explicitSelect = false;
$this->_select = ' id_query_dr_detail,
id_query_dr,
order_no,
ni_online_ref_id,
transaction_type,
response,
status,
error_code,
error_msg,
date_add,
date_upd';
$this->_where.= 'AND id_query_dr='.$id_query_dr.' ';
$this->_orderBy = 'id_query_dr_detail';
$this->_orderWay = 'DESC';
//Field list -
$this->fields_list = array(
'id_query_dr_detail' => array(
'title' =>$this->l('Detail Id'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'id_query_dr' => array(
'title' => $this->l('Query Dr Id'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'order_no' => array(
'title' => $this->l('Cart Id'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'ni_online_ref_id' => array(
'title' => $this->l('Online Reference ID '),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'transaction_type' => array(
'title' => $this->l('Trx type'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'status' => array(
'title' => $this->l('Status'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'error_code' => array(
'title' => $this->l('Error Code'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'error_msg' => array(
'title' => $this->l('Error Message'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'response' => array(
'title' => $this->l('Response'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'date_add' => array(
'title' => $this->l('Date Added'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'date_upd' => array(
'title' => $this->l('Date Updated'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'query_dr_method' => array(
'title' => $this->l('Query Dr Method'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
);
}
$this->initTabModuleList();
$this->initToolbar();
$this->initPageHeaderToolbar();
parent::__construct();
return parent::renderForm();
}
public function initContent()
{
if($this->action!='view'){
$this->initTabModuleList();
$this->initToolbar();
$this->initPageHeaderToolbar();
$this->content .= $this->initFormToCallQueryDR();
$this->table = _DB_KITS_PREFIX_.'query_dr';
$this->toolbar_title = $this->l('Query Dr Logs');
$this->content .= $this->renderList();
$this->context->smarty->assign(array(
'content' => $this->content,
'url_post' => self::$currentIndex.'&token='.$this->token,
'show_page_header_toolbar' => $this->show_page_header_toolbar,
'page_header_toolbar_title' => $this->page_header_toolbar_title,
'page_header_toolbar_btn' => $this->page_header_toolbar_btn
));
}
//If its view the display another list here
if($this->action=='view'){
$this->initTabModuleList();
$this->initToolbar();
$this->initPageHeaderToolbar();
$this->content = $this->renderView();
$this->table = _DB_KITS_PREFIX_.'query_dr_detail';
$this->toolbar_title = sprintf($this->l('Query Dr Detail Logs of Query Dr ID: %d'),Tools::getValue('id_query_dr'));
$this->content .= $this->renderList();
$this->context->smarty->assign(array(
'content' => $this->content,
'url_post' => self::$currentIndex.'&token='.$this->token,
'show_page_header_toolbar' => $this->show_page_header_toolbar,
'page_header_toolbar_title' => $this->page_header_toolbar_title,
'page_header_toolbar_btn' => $this->page_header_toolbar_btn
));
}
}
In quella classe dovresti cercare la funzione renderlist e commentare la riga
$this->addRowAction('view');

Cakephp 2.5.2 Auth always returns false

The Auth is returning false. Hashed password matches the hashed password in database, but still returns false.
Here is the model:
App::uses('AppModel', 'Model');
class User extends AppModel {
public $validate = array(
'username' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'password' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
);
public function beforeSave($options = array()) {
if (isset($this->data[$this->alias]['password'])) {
$this->data[$this->alias]['password'] =AuthComponent::password($this->data[$this->alias]['password']);
;
}
return true;
}
}
Here is the AppController:
class AppController extends Controller {
public $components = array(
'Session',
'Auth' => array(
'authenticate' => array(
'Form' => array(
)
),
'loginAction'=>array(
'controller'=>'users',
'action'=>'login'
),
'loginRedirect' => array(
'controller' => 'references',
'action' => 'admin_index'
),
'logoutRedirect' => array(
'controller' => 'home',
'action' => 'index',
'home'
)
)
);
public function beforeFilter() {
$this->Auth->allow('index', 'view');
}
}
Here is the UsersController:
public function login(){
var_dump($this->Auth->login());die;
if ($this->request->is('post')) {
if ($this->Auth->login()) {
return $this->redirect(array('controller'=>'references', 'action'=>'admin_index'));
}
$this->Session->setFlash(__('Invalid username or password, try again'));
}
}
And the view :
<div class="users form">
<?php echo $this->Session->flash('auth'); ?>
<?php echo $this->Form->create('User',array('action'=>'login')); ?>
<fieldset>
<legend>
<?php echo __('Please enter your username and password'); ?>
</legend>
<?php echo $this->Form->input('username');
echo $this->Form->input('password');
?>
</fieldset>
<?php echo $this->Form->end(__('Login')); ?>
</div>
I have tried using BlowFish but its not working, so I switched to Auth default hashing and the hashes when creating user and then loging in match so the hashing is working fine. I dont get what the problem is, so please help.
after a half an hour i tried again and now its working. Who knows what was the problem. Anyway, thanks for reading and post answers if you find any issue in code above. Thanks!

Populating Form Data in ZF2 when using Fieldsets

I am currently playing around with ZF2 beta 4 and I seem to be stuck when i try to use fieldsets within a form and getting the data back into the form when the form is submitted. I am not sure if I am not setting the input filters right for fieldsets or I am missing something. For example, I have the following (simplified to make it clear):
Controller
public function indexAction(){
$form = new MyForm();
$request = $this->getRequest();
if ($request->isPost()) {
$form->setData($request->post());
if ($form->isValid()) {
//Do something
print_r($form->getData()); //for debug
}
}
return array('form' => $form);
}
MyForm.php
class MyForm extends Form
{
public function __construct()
{
parent::__construct();
$this->setName('myForm');
$this->setAttribute('method', 'post');
$this->add(array(
'name' => 'title',
'attributes' => array(
'type' => 'text',
'label' => 'Title',
),
));
$this->add(new MyFieldset('myfieldset'));
//setting InputFilters here
$inputFilter = new InputFilter();
$factory = new InputFactory();
$inputFilter->add($factory->createInput(array(
'name' => 'title',
'required' => true,
'filters' => array(
array('name' => 'StripTags'),
array('name' => 'StringTrim'),
),
)));
//Now add fieldset Input filter
foreach($this->getFieldsets() as $fieldset){
$fieldsetInputFilter = $factory->createInputFilter($fieldset->getInputFilterSpecification());
$inputFilter->add($fieldsetInputFilter,$fieldset->getName());
}
//Set InputFilter
$this->setInputFilter($inputFilter);
}
}
MyFieldset.php
class MyFieldset extends Fieldset implements InputFilterProviderInterface{
public function __construct($name)
{
parent::__construct($name);
$factory = new Factory();
$this->add($factory->createElement(array(
'name' => $name . 'foo',
'attributes' => array(
'type' => 'text',
'label' => 'Foo',
),
)));
}
public function getInputFilterSpecification(){
return array(
'foo' => array(
'required' => true,
'filters' => array(
array('name' => 'StripTags'),
array('name' => 'StringTrim'),
),
),
);
}
}
I am able to output the form as expected and I end up with two input elements named 'title' and 'myfieldsetfoo' (the name given when outputing with the ViewHelper). So of course when I submit the raw post will show values for 'title' and 'myfieldsetfoo'. However, when I use SetData() the values for the field set are not being populated (although I can see the values in the raw post object). Instead, examining the output of '$form->getData()' I receive:
Array(
[title] => Test,
[myfieldset] => Array(
[foo] =>
)
)
What am I missing? What do I need to do so that ZF2 understands how to populate the fieldset?
Thanks for any help, this is driving me crazy.
Why I do is concatenate InputFilter so I could handle the whole HTML form array posted.
<form method="POST">
<input type="text" name="main[name]" />
<input type="text" name="main[location]" />
<input type="text" name="contact[telephone]" />
<input type="submit" value="Send" />
</form>
This will create an array posted like
post["main"]["name"]
post["main"]["location"]
post["contact"]["telephone"]
Filtered and validated with:
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Factory as InputFactory;
$post = $this->request->getPost();
$inputFilter = new InputFilter();
$factory = new InputFactory();
// $post["main"]
$mainFilter = new InputFilter();
$mainFilter->add($factory->createInput(array(
'name' => 'name',
'required' => true,
'filters' => array(
array('name' => 'StripTags'),
array('name' => 'StringTrim'),
),
'validators' => array(
array(
'name' => 'StringLength',
'options' => array(
'encoding' => 'UTF-8',
'min' => 1,
'max' => 100,
),
),
),
)));
$mainFilter->add($factory->createInput(array(
'name' => 'location',
'required' => true,
'filters' => array(
array('name' => 'StripTags'),
array('name' => 'StringTrim'),
),
'validators' => array(
array(
'name' => 'StringLength',
'options' => array(
'encoding' => 'UTF-8',
'min' => 1,
'max' => 100,
),
),
),
)));
$inputFilter->add($mainFilter, "main");
// $post["contact"]
$contactFilter = new InputFilter();
$contactFilter->add($factory->createInput(array(
'name' => 'name',
'required' => true,
'filters' => array(
array('name' => 'StripTags'),
array('name' => 'StringTrim'),
),
'validators' => array(
array(
'name' => 'StringLength',
'options' => array(
'encoding' => 'UTF-8',
'min' => 1,
'max' => 100,
),
),
),
)));
$contactFilter->add($mainFilter, "contact");
//Set posted data to InputFilter
$inputFilter->setData($post->toArray());
http://www.unexpectedit.com/zf2/inputfilter-validate-and-filter-a-form-data-with-fieldsets
I think you forgot to prepare your form in the controller:
return array('form' => $form->prepare());
This will rename the "name" field of your fieldset to "myfieldset[foo]", so you don't have to prepend the fieldsets name on your own.
Just use
'name' => 'foo'
instead of
'name' => $name . 'foo'
in your fieldset class.
I think the problem is that you declare a new form in your controller. And that clear the previous form.
$form = new MyForm();
I use the Service Manager to declare the form and filters.
And then in the controller I do:
$form = $this->getServiceLocator()->get('my_form');
That way I always get the object I want
Update
I no longer use service manager to call forms. I just call a new form and issue $form->setData($data);
The source for the data can also be entity though then I would issue: $form->bind($entity)

CakePHP - Missing Database Table

So I've got my server running on local machine. Everything is working there and I just wanted to extend the possibility of the server by adding an Agency model.
Then I put all of the files to the dev server, to make it available online - and when I try to go to "agencies" (domain.com/agencies/) - Missing Database Table Error shows up.
Everything works fine on my computer.
I've checked 5 times if all of the names in the database are correct.
I've checked the database.cfg in the cakephp but it must be good - everything else is working there.
Please help!
Update
Clearing models cache didn't help
Here is the code of the model:
<?php
class Agency extends AppModel{
var $name = 'Agency';
var $validate = array(
'id' => array(
'blank' => array(
'rule' => array('blank'),
//'message' => 'Your custom message here',
//'allowEmpty' => true,
//'required' => true,
//'last' => false, // Stop validation after this rule
'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'company' => array(
'notempty' => array(
'rule' => array('notempty'),
//'message' => 'Your custom message here',
'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'website_url' => array(
'url' => array(
'rule' => array('url'),
//'message' => 'Your custom message here',
'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'status' => array(
'notempty' => array(
'rule' => array('notempty'),
//'message' => 'Your custom message here',
'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'profession_id' => array(
'multiple' => array(
'rule' => array('multiple', array('min' => 1)),
'message' => 'Please select at least 1 profession',
//'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'seniority_id' => array(
'multiple' => array(
'rule' => array('multiple', array('min' => 1)),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'industry_id' => array(
'multiple' => array(
'rule' => array('multiple', array('min' => 1)),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'sector_id' => array(
'multiple' => array(
'rule' => array('multiple', array('min' => 1)),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'zone_id' => array(
'multiple' => array(
'rule' => array('multiple', array('min' => 1)),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'size' => array(
'notempty' => array(
'rule' => array('notempty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
)
);
var $hasAndBelongsToMany = array(
'Profession' => array(
'className' => 'Profession',
'joinTable' => 'agencies_professions',
'foreignKey' => 'agency_id',
'associationForeignKey' => 'profession_id',
'unique' => true,
//'conditions' => '',
//'fields' => '',
//'order' => ''
),
'Seniority' => array(
'className' => 'Seniority',
'joinTable' => 'agencies_seniorities',
'foreignKey' => 'agency_id',
'associationForeignKey' => 'seniority_id',
'unique' => true,
//'conditions' => '',
//'fields' => '',
//'order' => ''
),
'Industry' => array(
'className' => 'Industry',
'joinTable' => 'agencies_industries',
'foreignKey' => 'agency_id',
'associationForeignKey' => 'industry_id',
'unique' => true,
//'conditions' => '',
//'fields' => '',
//'order' => ''
),
'Sector' => array(
'className' => 'Sector',
'joinTable' => 'agencies_sectors',
'foreignKey' => 'agency_id',
'associationForeignKey' => 'sector_id',
'unique' => true,
//'conditions' => '',
//'fields' => '',
//'order' => ''
),
'Zone' => array(
'className' => 'Zone',
'joinTable' => 'agencies_zones',
'foreignKey' => 'agency_id',
'associationForeignKey' => 'zone_id',
'unique' => true,
//'conditions' => '',
//'fields' => '',
//'order' => ''
)
);
var $hasMany= array(
'Office' => array(
'className' => 'Office',
'foreignKey' => 'office_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
}
Update
The debug was set to 2 from the very beginning because it is a dev server.
Update
It is not a matter of lower/upper case names.
Whenever you make any changes to your database, please make sure that your app/config/core.php file debug value is 2. Configure::write('debug', 2);
If it is 0 database changes will not be detected.
This is because in production Cake caches the database structure so that it doesn't have to query the db again at every page load. This is rarely a problem because you should develop with debug level set to 2 anyway.
So whenever you change your database just make it 2 once.
Problem solved. The database I was adding new tables was not the one connected to the dev server, but to the main site.