• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pagination problem 4.0.4

#2
Just a brief update on this one...

I find this problem appears to be a fallout of an issue discussed in one of my other posts regarding (manual) pagination in 4.0.4:

The system's Model.php paginate() function invokes an instance of the Pager service in a NON-SHARED mode (which seems to be a mistaken choice (?)).

When invoked in this manner, it appears that call/s to the Pager's store() routine see different parameters to what the Model's instance of store() has just set: store() is invoked by Model's paginate() and also, a moment later, in the Pager's makeLinks() routine. When these two calls see different parameters, it causes the links that are generated by makeLinks() - which would appear to be typically called immediately after the paginate() function if one is doing manual pagination() - to be fished (it looses which page is current).

So, to fix this problem, I've found that the system's Pager.php (mentioned in the post above) should be left as it was... and that the source of the hiccup is actually in paginate() in Model.php, which should simply have:
Code:
$pager = \Config\Services::pager(null, null, false);
changed to:
Code:
$pager = \Config\Services::pager(null, null, true);

Can someone please confirm this, or, alternatively explain why the Model's paginate() uses a non-shared instance of the pager service (and then also how best to get CI's manual pagination to work in 4.0.4)?

Thanks.

Additional note: there is already the $group parameter that 'separates' calls to the store() routine.
Reply


Messages In This Thread
Pagination problem 4.0.4 - by Gary - 08-30-2020, 03:07 PM
RE: Pagination problem 4.0.4 - by Gary - 09-05-2020, 02:18 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.