From the Cake Manual
Controller’s constructor now takes two parameters. A CakeRequest, and CakeResponse objects. These objects are used to populate several deprecated properties and will be set to $request and $response inside the controller.
The Fix:
Change your constructor signature..
From:
function __construct()
{
parent::__construct();
}
To:
// Pass through the request and response objects
// AND declare the visibility of the method
public function __construct($request = null, $response = null)
{
parent::__construct($request, $response);
}
This should resolve your Error: Call to a member function parseAccept() on a non-object
.
The official Cake 2.x
docs for this issue can be found here:
http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html#controller
If you have just upgraded from 1.x
to 2.x
, I would highly recommend you read through the detailed migration guides provided by cakePHP
.
Migration Guides
2.0 Migration Guide
2.1 Migration Guide
2.2 Migration Guide
2.3 Migration Guide
2.4 Migration Guide