ozee31 / cakephp-cors

A CakePHP (3.3+) plugin for activate cors domain in your application
MIT License
43 stars 31 forks source link

Class 'Cors\Error\AppExceptionRenderer' not found - Cakephp 3.7 #20

Closed reydajp closed 5 years ago

reydajp commented 5 years ago

With Cake 3.7, I get the following error :

Error: Class 'Cors\Error\AppExceptionRenderer' not found [ROOT\vendor\ozee31\cakephp-cors\src\Error\AppExceptionRenderer.php, line 15]

Any suggestion ?

Thanks !

wschwarte commented 5 years ago

I have the same issue.

seems to have to do something with aliasing a class. It works if i change it to this:


function get_dynamic_parent() {
    return Configure::read('Error.baseExceptionRenderer');// return what you need
}
//class_alias(get_dynamic_parent(), 'Cors\Error\BaseExceptionRenderer');   //comment

class AppExceptionRenderer extends ExceptionRenderer // changed name of extended class to cakes default
{
ozee31 commented 5 years ago

I have not this error with CakePHP 3.7 but for me, Cakephp no return a json response with exceptions and I don't understand why.

ozee31 commented 5 years ago

https://github.com/cakephp/cakephp/issues/12834

reydajp commented 5 years ago

The problem has been solved with cakephp 3.7.2 version.