Written by James McDonald

August 3, 2022

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

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()

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

Submit a Comment

Your email address will not be published.

You May Also Like…

CakePHP4 Tutorial Videos

So I have been using CakePHP since 2015 and have now started to try and solidify my learning by making Youtube Videos....

Electron & React

So I have been using timer apps from the App Store on my Mac to time parts that I run on Zoom. I was using Tempus but...