- Issue created by @lammensj
- 🇩🇪Germany jurgenhaas Gottmadingen
This sounds like an interesting improvement. I wonder, while being on it, if there are other properties too, that we may want to change at the same time.
- 🇧🇪Belgium lammensj
It depends a bit on how flexible you want it to be. If you search for "function set" on this page: https://api.drupal.org/api/drupal/core%21modules%21views%21src%21ViewExe..., you'll get a list of all the items you can alter/set before executing the View.
For now, I'm just limiting it to the arguments (already there) and the items per page.
- 🇧🇪Belgium lammensj
However... Testing the change now... When I set the items per page on the View-object, it works when it's rendered initially. But the second page just loads the amount of items that is configured in the View itself...
- 🇩🇪Germany jurgenhaas Gottmadingen
Left a couple of comments in the MR.
When I set the items per page on the View-object, it works when it's rendered initially. But the second page just loads the amount of items that is configured in the View itself.
That's strange. Maybe we could check in the views block plugin and check how they've done it there.
- 🇧🇪Belgium lammensj
I've implemented your remarks, thank you for the feedback.
Regarding the items being returned for the second "page", I believe it's an issue coming from Views Infinite Scroll. I'll link the ticket. But this shouldn't stop this particular feature request.
- 🇧🇪Belgium lammensj
For reference, this is how the Views Block plugin is overriding the items_per_page config item: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/views.... The ECA Action is doing the same thing.
- 🇩🇪Germany jurgenhaas Gottmadingen
The MR looks great. We probably need a update hook so that existing models will be updated for the new config property.
Having said that, the default value of the items_per_page should probably be an empty string, not NULL.
Following your comment #7, does that mean that it works correctly if Views Infinite Scroll is disabled?