Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate Cakephp1.3 to 2.0

I have developed one heavily loaded project in cakephp 1.3 now my client want it in latest CakePHP version.

I have migrated it using shell script based tutorial provided on below link: http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html

version get replaced it got migrated in CakePHP 2.0 version but now on running a project i am getting an error

Fatal error: Call to a member function parseAccept() on a non-object in D:\xampp\htdocs\arguenet1\lib\Cake\Controller\Component\RequestHandlerComponent.php on line 134

project is mostly developed with ajax functionality and requesthandler componenet also have been used to check isAjax request or not on component side.

Can anyone help me to solve this error...Thanks in advance.

like image 673
Jhanvi Avatar asked Nov 03 '22 16:11

Jhanvi


1 Answers

The signature for the __construct() method has changed in 2.x. See the API docs here. Try modifying your AppController::__construct() like so:

public function __construct($request = null, $response = null) {
    parent::__construct($request, $response);
    // Your code here.
}

Credit to this Google Groups thread.

like image 86
beporter Avatar answered Nov 09 '22 14:11

beporter