- 🇺🇸United States pookmish
The suggested patch in #5 does not work in Drupal 10 due to symfony's ->get() method on the input bag. The input bag now requires the returned data to be a scalar (string, number, boolean, etc). But switching to use the ->all() method further breaks due to the Drupal core's view loads the pager via this line in PagerParameters. The patch mentioned in #6 and 7 does not help because it uses the same ->get() method and throws the same error, just in a different place.
- 🇮🇹Italy Noemi Milan
The patch is working fine with 9.5.11, but the total count is not correct, since it returns the items per page + 1.
Does it make sense to use
$view->total_rows
to populate thecount
property inmeta
? - 🇺🇸United States pookmish
I correct myself in #8 (unless it was some dependency update I needed). I've attached the patch that works for me with Drupal 10.1.4.
@noemi, I wasn't able to reproduce your incorrect count. If I set `?page[limit]=5` the returned number in the meta is 5. What could be more helpful is to have a "total" returned as well. But I wasn't able to find a quick solution for that.
- 🇮🇹Italy Noemi Milan
@pookmish I realized the problem with the count is not directly related to this issue, but the use of an offset.
In short, the total count is equal to the count + the offset and maybe this is the expected behavior. - last update
10 months ago 6 pass