Index-pagination error

Hi,

in each Controller I set a viewVariable like this:

 $this->set('menuID', $this->product->navigation_id);  

I have checked the content, it is an integer. And I used to do it with some different releases 4.x

In release 5.1,12 it is working, but if I insert “$this→set(‘menuID’, 3) inside the Appcontroller an error occured with all index.php.
Cake\View\View::get(): Argument #1 ($var) must be of type string, int given, called in C:\laragon\www\la_version_8\vendor\cakephp\cakephp\src\View\Helper\PaginatorHelper.php

I can live without this line in the Appcontroller, but I am interessted to know, if anyone knows the reason for this. Kind regards

Klaus

The error you are getting is not directly from the line you’ve quoted, it’s inside the PaginatorHelper. You need to follow the stack trace backwards to find where this get call is originating from, so that you can understand how the parameter is wrong. It seems that $this->product->navigation_id is most likely also an integer, leading me to suspect that you have made other changes as well as just adding this one line.