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

Deprecation warnings #34

Closed
marianodonal opened this issue Oct 29, 2021 · 6 comments · Fixed by #37
Closed

Deprecation warnings #34

marianodonal opened this issue Oct 29, 2021 · 6 comments · Fixed by #37
Labels
cake4 Specifies that the issue/pr is specific to master(cake4) branch

Comments

@marianodonal
Copy link

Describe the bug
Hi, i'm new with react and laravel mix.
I'm trying to create an app when I get two deprecation warnings:

Router::plugin() is deprecated, use the non-static method RouterBuilder::plugin() instead. - /Applications/MAMP/htdocs/cakereact/vendor/ishanvyas22/asset-mix/config/routes.php, line: 11
You can disable all deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED, or add vendor/ishanvyas22/asset-mix/config/routes.php to Error.ignoredDeprecationPaths in your config/app.php to mute deprecations from only this file. [CORE/src/Core/functions.php, line 322]

Router::scope() is deprecated, use the non-static method RouterBuilder::scope() instead. - /Applications/MAMP/htdocs/cakereact/vendor/cakephp/cakephp/src/Routing/Router.php, line: 912
You can disable all deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED, or add vendor/cakephp/cakephp/src/Routing/Router.php to Error.ignoredDeprecationPaths in your config/app.php to mute deprecations from only this file. [CORE/src/Core/functions.php, line 322]

@ishanvyas22
Copy link
Owner

ishanvyas22 commented Nov 13, 2021

What is exact CakePHP version you are using? Also, the package version.

@marianodonal
Copy link
Author

CakePHP 4.3.0

@marianodonal
Copy link
Author

I've fixed it by updating routes.php file in plugin config folder.

use Cake\Routing\RouteBuilder;
use Cake\Routing\Route\DashedRoute;

return static function (RouteBuilder $routes) {
    $routes->plugin('AssetMix', ['path' => '/asset-mix'], function (RouteBuilder $routes) {
        $routes->fallbacks(DashedRoute::class);
    });
};

I don't know how to perform a pull request, maybe I can collaborate. Thanks

@Andream98
Copy link
Contributor

Andream98 commented Jan 19, 2022

I'm on CakePHP 4.3 with the latest version of this package and I've also changed the routes.php file because of the deprecation warnings I get when I start the CakePHP server:

<?php

    use Cake\Routing\Route\DashedRoute;
    use Cake\Routing\RouteBuilder;

    /** @var RouteBuilder $routes */
    $routes->plugin(
        'AssetMix',
        ['path' => '/asset-mix'],
        function (RouteBuilder $routes) {
            $routes->fallbacks(DashedRoute::class);
        });

@ishanvyas22 let me know which version seems more appropriate to you so that I can create a PR.

PS: I will be opening the same PR on cakephp-inertiajs too

@ishanvyas22
Copy link
Owner

@Andream98 v4.3.0 seems good as it is deprecated in that version only.

You can create a PR with the change and updating CakePHP version to 4.3 in composer.json file.

@ishanvyas22 ishanvyas22 added cake4 Specifies that the issue/pr is specific to master(cake4) branch and removed need more info labels Jan 19, 2022
@ishanvyas22 ishanvyas22 linked a pull request Jan 19, 2022 that will close this issue
@ishanvyas22
Copy link
Owner

Released in 1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cake4 Specifies that the issue/pr is specific to master(cake4) branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants