Pagination by sort gives me the error:
strpos() expects parameter 1 to be string, int given
Tested with: Cakephp 4.4.7, php 7.4
CORE\src\Datasource\Paging\NumericPaginator.php line 607
Can you post your ->paginate()
method? It should look like this:
$this->paginate($query, ['order' => ['MyTable.name' => 'asc']])
or if you use the controller property something like this
class ArticlesController extends AppController
{
public $paginate = [
'order' => [
'MyTable.name' => 'asc'
]
];
}
See Pagination - 4.x
Order type was missing in my code:
'order' => ['MyTable.name']