Migration Issue
Hello. I've just joined a project that is currently using cake as it's framework, and one of the tasks assigned to me was to migrate the existing 2.0 version of cake to the latest (now 2.2.3).
Now a situation came up when moving from my windows localhost to the server. It starts to fail right at the login. While debugging I did find out that it's losing "something" along the way, I'll try to explain better.
This is where the call originates: $this->User->contain(array('UserInRole'=>array('Role')));
This are the 3 models:
class User extends AppModel {
var $name = 'User';
var $primaryKey = 'UserID';
public $actsAs = array( 'Containable' );
public $hasMany = array(
'UserInRole' => array(
'className' => 'UserInRole',
'foreignKey' => 'UserID',
'dependent' => false
)
);
...............
class UserInRole extends AppModel {
var $name = 'UserInRole';
var $primaryKey = array( 'UserID','RoleID');
public $actsAs = array( 'Containable' );
public $belongsTo = array(
'Role' => array(
'className' => 'Role',
'foreignKey' => 'RoleID',
'dependent' => false
),
'User' => array(
'className' => 'User',
'foreignKey' => 'UserID',
'dependent' => false
)
);
}
class Role extends AppModel {
var $name = 'Role';
var $primaryKey = 'RoleID';
var $hasMany = array(
'UserInRole' => array(
'className' => 'UserInRole',
'foreignKey' => 'RoleID',
'counterCache' => true,
'dependent' =>true
)
);
}
This is the error when running on linux:
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'contain' at line 1
SQL Query: contain
For this error if I debug I see that it's trying to execute a ' contain' query.
But on windows the same executes with the following query: "SHOW FULL COLUMNS FROM `pmgcms2_cms`.`cms_users`"
I've been going at this for ages, but I haven't had any luck so far, so I was hoping there's someone that might have ever had the same issue and can give me some sort of clue. I'm lost right now.
Thanks
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home