maiconpinto / cakephp-adminlte-theme

CakePHP AdminLTE Theme
http://maiconpinto.github.io/cakephp-adminlte-theme/
MIT License
172 stars 111 forks source link

Deprecation notices cake 37 #86

Closed dcoturel closed 5 years ago

dcoturel commented 5 years ago

Motivation

I have a CakePHP 3 website running AdminLTE. Recently upgraded to 3.7 version of the framework, and this deprecation notices appeared in my controller test cases:

Deprecated Error: FormHelper::input() is deprecated. Use FormHelper::control() instead. - C:\xampp\htdocs\idscentral\vendor\maiconpinto\cakephp-adminlte-theme\src\View\Helper\FormHelper.php, line: 94
 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. in [C:\xampp\htdocs\idscentral\vendor\cakephp\cakephp\src\Core\functions.php, line 311]
Deprecated Error: Accessing `webroot` as a property will be removed in 4.0.0. Use request->getAttribute("webroot") instead. - C:\xampp\htdocs\idscentral\vendor\maiconpinto\cakephp-adminlte-theme\src\Template\Layout\collapsed.ctp, line: 97
 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. in [C:\xampp\htdocs\idscentral\vendor\cakephp\cakephp\src\Core\functions.php, line 311]
Deprecated Error: Accessing `url` as a property will be removed in 4.0.0. Use request->getPath() instead. - C:\xampp\htdocs\idscentral\vendor\maiconpinto\cakephp-adminlte-theme\src\Template\Layout\collapsed.ctp, line: 97
 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. in [C:\xampp\htdocs\idscentral\vendor\cakephp\cakephp\src\Core\functions.php, line 311]

Resolution strategy

For the first of the deprecation notices, I chose to: 1) Use the recommended method in the input() method 2) Mark input() for deprecation, in order to move the deprecation notices to the template files

For the second and third notices, I just replaced old calls with the recommended ones.