Hi,
I’ve been developing with CakePHP 2 for years and recently jumped to 4, and it’s a big change. But, got my app working nicely locally and deployed it to a testing server. Locally I’m on a Mac running XAMPP without any issues. The deployment server is Fedora 31 running PHP 7.3. Everything seems set up correctly, I’ve tested the database connection too.
But, when I load my site, I get the following error:
Unknown method “parameters” called on Cake\ORM\Table
But it works fine locally. I’ve checked everything. Re-run composer on the deployment server. Checked requirements.The files are synced with Git. But, I cannot figure out why I’m getting this error.
The file referenced in the error looks like this:
AppController.php
namespace App\Controller;
use Cake\Controller\Controller;
use Cake\ORM\TableRegistry;
use Cake\Core\Configure;
use App\Application;
class AppController extends Controller {
public function initialize(): void {
parent::initialize();
$this->App = new Application(dirname(dirname(__DIR__)) . '/config');
$this->requester = $this->App->requester();
...
$this->loadComponent('RequestHandler');
$this->loadComponent('Flash');
$this->Babel = TableRegistry::getTableLocator()->get('babel');
$this->Brands = TableRegistry::getTableLocator()->get('brands');
$this->Collections = TableRegistry::getTableLocator()->get('collections');
...
$this->Odin = TableRegistry::getTableLocator()->get('odin');
$requestparams = $this->request->getAttribute('params');
$this->params = $this->Odin->parameters($requestparams);
...
I’d really appreciate it if someone could help me figure out why I get this error on one server but not the other. Am I missing something in the set up that isn’t synced over Git? Is there a file I need to manually add to the server? I feel if this was the case it would just crash.
Anyway, all help gratefully received.
Thanks,
Michael