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

Cake 4.3 Routing deprecation #42

Closed
raul338 opened this issue Oct 28, 2021 · 1 comment
Closed

Cake 4.3 Routing deprecation #42

raul338 opened this issue Oct 28, 2021 · 1 comment

Comments

@raul338
Copy link

raul338 commented Oct 28, 2021

This should be fixed by changing config/routes.php, and requiring cake 4.3

diff --git a/config/routes.php b/config/routes.php
index 6ed7cdd..0cd2bce 100644
--- a/config/routes.php
+++ b/config/routes.php
@@ -3,7 +3,8 @@
 use Cake\Routing\RouteBuilder;
 use Cake\Routing\Router;
 
-Router::prefix('Admin', function (RouteBuilder $routes) {
+/** @var \Cake\Routing\RouteBuilder $routes */
+$routes->prefix('Admin', function (RouteBuilder $routes) {

I tried to make a PR but couldn't get test to run with new Test Migrator

@dereuromark
Copy link
Owner

@deprecated 4.3.0 Use the non-static method RouterBuilder::prefix() instead.

This cannot be fixed in a way that it works for CakePHP 4.2 as well
As such you should just set

  • routes to false for loading the plugin, and define the routes on app level for now.
  • or silence all deprecations coming from plugins in vendor (as they are not relevant for your app deprecations and outside of control)

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

2 participants