I got this deprecation warning after upgrading to CakePHP 4.4
"PaginatorComponent is deprecated, use a Cake\Datasource\Pagination\NumericPaginator instance directly"
I thought that meant I had to run the CakePHP 4 upgrade tool and it would fix it but no.
Simple Fix
Remove this line from your Controllers
$this->loadComponent('Paginator'); // remove this line from all your code
![](https://toggen.com.au/wp-content/uploads/2022/08/image-3-1024x196.png)
![](https://toggen.com.au/wp-content/uploads/2022/08/image-1024x352.png)
Running the Upgrade Tool is Good Idea
I did run the upgrade tool and the cakephp43
rector rules did some nice changes. For example using the cakephp43 rules got rid of getTableLocator() and replaced it with fetchTable()
![](https://toggen.com.au/wp-content/uploads/2022/08/image-4.png)
![](https://toggen.com.au/wp-content/uploads/2022/08/image-1-1024x127.png)
Check each new Version’s Migration Guide
Be sure to check the migration guide for each version you upgrade to: https://book.cakephp.org/4/en/appendices/4-4-migration-guide.html
Installing and Using the CakePHP 4 Upgrade Tool
https://book.cakephp.org/4/en/appendices/4-0-upgrade-guide.html#upgrade-tool-use
0 Comments