New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CakePHP 2.10.8 + Crud 3.1.0 + PHP 7.2 = Fatal error #581

Closed
knight-of-ni opened this Issue Mar 23, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@knight-of-ni

knight-of-ni commented Mar 23, 2018

CakePHP 2.10.8
Crud 3.1.0
PHP 7.2
Ubuntu 18.04 Beta

Those of us working on the ZoneMinder project have been working towards compatibility with PHP 7.2.
To accomplish that we are testing the most recent versions of cakphp & crud compatible with our project.

When using CakePHP 2.10.8 and Crud 3.1.0, we see the following fatal error when we make a call to our API, for example: http://localhost/zm/api/host/getVersion.json

Fatal error: Uncaught Error: Class 'RelatedModelsListener' not found in /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Component/CrudComponent.php:752
Stack trace: 
#0 /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Component/CrudComponent.php(728): CrudComponent->_loadListener('RelatedModels') 
#1 /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Component/CrudComponent.php(169): CrudComponent->_loadListeners() 
#2 /usr/share/zoneminder/www/api/lib/Cake/Utility/ObjectCollection.php(128): CrudComponent->initialize(Object(CakeErrorController)) 
#3 /usr/share/zoneminder/www/api/lib/Cake/Event/CakeEventManager.php(243): ObjectCollection->trigger('initialize') 
#4 /usr/share/zoneminder/www/api/lib/Cake/Controller/Controller.php(677): CakeEventManager->dispatch(Object(CakeEvent)) 
#5 /usr/share/zoneminder/www/api/lib/Cake/Error/ExceptionRenderer.php(158): Controller->startupProcess() 
#6 /usr/share/zoneminder/www/api/lib/Cake/Error/ExceptionRenderer.php(95): ExceptionRenderer->_getController(Object(FatalErro in /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Component/CrudComponent.php on line 752

We can fix this fatal error by modifying CrudBaseObject.php
FROM:
abstract class CrudBaseObject extends Object implements CakeEventListener {
TO:
abstract class CrudBaseObject extends CakeObject implements CakeEventListener {

PR targeting the 3.x branch is incoming...

knight-of-ni added a commit to knight-of-ni/crud that referenced this issue Mar 23, 2018

@ravage84

This comment has been minimized.

Show comment
Hide comment
@ravage84

ravage84 May 13, 2018

Confirmed with:

  • CakePHP 2.10.10
  • Crud 3.1.0
  • PHP 7.2
  • Windows 7

ravage84 commented May 13, 2018

Confirmed with:

  • CakePHP 2.10.10
  • Crud 3.1.0
  • PHP 7.2
  • Windows 7
@josegonzalez

This comment has been minimized.

Show comment
Hide comment
@josegonzalez

josegonzalez May 13, 2018

Member

Closed by v3.2.0

Member

josegonzalez commented May 13, 2018

Closed by v3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment