Skip to content
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

Zend\Diactoros\Uri not found in IsAuthorizedTrait.php #69

Closed
Petrucheqa opened this issue May 20, 2022 · 4 comments
Closed

Zend\Diactoros\Uri not found in IsAuthorizedTrait.php #69

Petrucheqa opened this issue May 20, 2022 · 4 comments

Comments

@Petrucheqa
Copy link

Petrucheqa commented May 20, 2022

Hello, I'm struggling with this issue on production just after deployment.

2022-05-20 16:40:25 error: [Error] Class "Zend\Diactoros\Uri" not found in /app/vendor/cakedc/auth/src/Traits/IsAuthorizedTrait.php on line 74
Stack Trace:
- /app/vendor/cakedc/auth/src/Traits/IsAuthorizedTrait.php:61
- /app/vendor/cakedc/auth/src/Traits/IsAuthorizedTrait.php:37
- /app/vendor/cakedc/users/src/View/Helper/AuthLinkHelper.php:49
- /app/templates/element/global/navbar.php:27
- /app/vendor/cakephp/cakephp/src/View/View.php:1181
- /app/vendor/cakephp/cakephp/src/View/View.php:1138
- /app/vendor/cakephp/cakephp/src/View/View.php:1673
- /app/vendor/cakephp/cakephp/src/View/View.php:660
- /app/templates/layout/default.php:10
- /app/vendor/cakephp/cakephp/src/View/View.php:1181
- /app/vendor/cakephp/cakephp/src/View/View.php:1138
- /app/vendor/cakephp/cakephp/src/View/View.php:821
- /app/vendor/cakephp/cakephp/src/View/View.php:780
- /app/vendor/cakephp/cakephp/src/Controller/Controller.php:764
- /app/src/Controller/PagesController.php:65
- /app/vendor/cakephp/cakephp/src/Controller/Controller.php:539
- /app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php:140
- /app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php:115
- /app/vendor/cakephp/cakephp/src/Http/BaseApplication.php:317
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:77
- /app/vendor/cakephp/authorization/src/Middleware/RequestAuthorizationMiddleware.php:102
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /app/vendor/cakephp/authorization/src/Middleware/AuthorizationMiddleware.php:129
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /app/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php:124
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /app/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php:174
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /app/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php:157
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /app/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php:161
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /app/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php:68
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /app/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php:126
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:73
- /app/vendor/cakephp/cakephp/src/Http/Runner.php:58
- /app/vendor/cakephp/cakephp/src/Http/Server.php:90
- /app/webroot/index.php:40

Runtime PHP 8.1.6

Composer.lock deps :

            "name": "cakedc/users",
            "version": "11.1.0",
            
            "name": "cakedc/auth",
            "version": "7.0.1",

I don't understand what's wrong and why I have no problem in dev env.

Tell me if you want more informations for trying to reproduce this strange behaviour

@rochamarcelo
Copy link
Contributor

It seems to be an configuration issue in your environment, problably affecting composer not being able to alias the class name.

Ref: CakeDC/users#997

@rochamarcelo
Copy link
Contributor

@Petrucheqa Have you tried to add the plugin in a new project?

@Petrucheqa
Copy link
Author

Petrucheqa commented May 23, 2022

Yes It's a brand new project. I'll open an issue on Heroku PHP Buildpack.

I will keep you posted.

If they don't provide a solution, do you think as a newcomer in OS contribution I could replace usage of Zend by Laminas dependency ?

Or this solution implies many changes related to other components that depends on CakeDC/Auth ?

@rochamarcelo
Copy link
Contributor

rochamarcelo commented May 23, 2022

I'm not sure what configuration is required, about changes in the code there was a conversation about renaming the namespace in the plugin code. see at CakeDC/users#997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants