3.4 to 3.6 migration : do we need to fix the "Cake" warnings section?


#1

Hello,

I am (still) working on my migration from 3.4 to 3.6
The only warnings I got using DebugKit are in the “Cake” and the “Others” section.
For instance:

Cake
CAKE/Http/ActionDispatcher.php:61
ActionDispatcher::addFilter() is deprecated. This is only available for backwards compatibility with DispatchFilters - /Users/mverdun/Projets/ma-gestion/development/mbail/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php, line: 61 You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php.
CAKE/Http/ActionDispatcher.php:61
ActionDispatcher::addFilter() is deprecated. This is only available for backwards compatibility with DispatchFilters - /Users/mverdun/Projets/ma-gestion/development/mbail/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php, line: 61 You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php.
CAKE/Http/ActionDispatcher.php:61
ActionDispatcher::addFilter() is deprecated. This is only available for backwards compatibility with DispatchFilters - /Users/mverdun/Projets/ma-gestion/development/mbail/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php, line: 61 You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php.
CAKE/Http/ActionDispatcher.php:61
ActionDispatcher::addFilter() is deprecated. This is only available for backwards compatibility with DispatchFilters - /Users/mverdun/Projets/ma-gestion/development/mbail/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php, line: 61 You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php.
CAKE/Routing/Filter/RoutingFilter.php:59
ServerRequest::addParams() is deprecated. Use withParam() or withAttribute("params", $params) instead. - /Users/mverdun/Projets/ma-gestion/development/mbail/vendor/cakephp/cakephp/src/Routing/Filter/RoutingFilter.php, line: 59 You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php.
Other
ROOT/webroot/index.php:35
ServerRequest::createFromGlobals() is deprecated. Use Cake\Http\ServerRequestFactory instead. - /Users/mverdun/Projets/ma-gestion/development/mbail/webroot/index.php, line: 35 You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php.
ROOT/vendor/composer/ClassLoader.php:444
Use Cake\Http\Response instead of Cake\Network\Response. - /Users/mverdun/Projets/ma-gestion/development/mbail/vendor/composer/ClassLoader.php, line: 444 You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php.
ROOT/webroot/index.php:36
Dispatcher is deprecated. You should update your application to use the Http\Server implementation instead. - /Users/mverdun/Projets/ma-gestion/development/mbail/webroot/index.php, line: 36 You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php.

Is it going to be fixed by the upgrade to Cake 4.x ? Or do we need to investigate on those too?
Thanks for your help.
Kitcat


#2

See my reply here:


#3

thanks for answering!
Even though I read your previous reply I did not clearly understood if I had something to do for those deprecations warning.
I am migrating steps by steps my app but the “Cake” and “Others” section is still appearing.

Still looking for an answer on those.


#4

Read through https://book.cakephp.org/3.0/en/development/dispatch-filters.html

You have to realize a major update isn’t just a run of composer to update vendor, but many actual files in the app also. I’d backup everything before doing changes.


#5

Thank you for your answer.
I can realize that easily : I have (successfully) upgrade my app from 2.6 to 3.0 two years ago.
What I am missing here is that: do we need to install a full skeleton for 3.6 and move our src files or can we upgrade the app and change some files?
I am trying the second way.
I can understant that we also nee to copy files suche as index.php bootstrap.php app.php from the skeleton and the manually adapt theses files to our application.
Where the complete list to “copy and adapt” can be found?
Thank you for your attention.

Kitcat711


#6

Here is the list you need to upgrade from 3.x to 3.6.x

I did for one application, and it’s long work, there is many files to changes, many methods to update, even the route file has been reviewed but when it’s done, cake 3.6.x it’s faster than all previous versions :wink:


#7

Thanks for your anwser.
I found that actually, my “deprecations” are older: from 3.2 to 3.3 I need to implement the middleware class.
I am following that:
https://book.cakephp.org/3.0/en/development/application.html#adding-http-stack

Tthat still does not work at all though. no logs, just a 500 error.
#keepgoing forward


#8

I’ve got same issue the first times. So I opened a new project and made a diff on all files in config between 3.6 and 3.x :roll_eyes:

It’s tough work but it worth it!! Don’t hesitate to ask for help if you need.

Good luck :wink:


#9

I did the same as @Speudyland That is the safest way to do.


#10

OK.
When you said “all files in config” you mean onlfy files in the config directory or other “configuration files” too?


#11

Yes only files in conf folder.

For the src folder, you will have to change methods, for instance

Before:

 $this->Security->config('unlockedActions',[$this->request->params['action']]);

Now 3.6.x

$this->Security->setConfig('unlockedActions',[$this->request->getParam('action')]);

#12

Thanks to all of your for your help
I made it trhough the Middleware Class and I am changing the methods according to the migration guides.