CakePHP Illegal bias type

I am new to cakephp and am following this tutorial for a user authentication system

http://bakery.cakephp.org/articles/SeanCallan/2007/04/17/simple-form-authentication-in-1-2-xx

The only thing I changed was the login.ctp file. I changed pointers from

 $form-> 

      

to

 $this->Form->

      

I am getting two errors and I cannot figure out why. Here is the first

Warning (2): Invalid offset type [CORE \ Cake \ Model \ Model.php, line 2603]

This is the code / context it displays if ($ type! == 'all') {if ($ this-> findMethods [$ type] === true) {

$type   =   array(
'username' => '',
'password' => '*****'
)
$query  =   array(
'conditions' => null,
'fields' => null,
'joins' => array(),
'limit' => null,
'offset' => null,
'order' => null,
'page' => (int) 1,
'group' => null,
'callbacks' => true,
(int) 0 => 'id',
(int) 1 => 'username'
)
$this   =   object(User) {}

      

This information was also displayed

Model::buildQuery() - CORE\Cake\Model\Model.php, line 2603
Model::find() - CORE\Cake\Model\Model.php, line 2562
User::validateLogin() - APP\Model\User.php, line 9
UsersController::login() - APP\Controller\UsersController.php, line 21
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE\Cake\Controller\Controller.php, line 484
Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 104
Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 86
[main] - APP\webroot\index.php, line 96

      

Here is the second mistake

Warning (2): invalid offset type [CORE \ Cake \ Model \ Model.php, line 2579]

This is the code it displays

   return $results;
     } else {
        if ($this->findMethods[$type] === true) {

$type   =   array(
'username' => '',
'password' => '*****'
 )
 $query =   array(
'conditions' => null,
'fields' => null,
'joins' => array(),
'limit' => null,
'offset' => null,
'order' => array(
),
'page' => (int) 1,
'group' => null,
'callbacks' => true,
(int) 0 => 'id',
(int) 1 => 'username'
)
$results    =   array(
(int) 0 => array(
)
)
$this   =   object(User) {}

      

Here is some additional information

Model::find() - CORE\Cake\Model\Model.php, line 2579
User::validateLogin() - APP\Model\User.php, line 9
UsersController::login() - APP\Controller\UsersController.php, line 21
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE\Cake\Controller\Controller.php, line 484
Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 104
Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 86
[main] - APP\webroot\index.php, line 96

      

+3


source to share


1 answer


I would advise you to follow the later tutorial in

http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html



Which should follow your setup exactly since you are using cakephp 2.1. The one you are trying to accomplish now is for cakephp1.2 and was written in 2007, so I doubt it will be helpful to you.

+2


source







All Articles