Errors when `hook_views_pre_view` is altering items per page

Created on 15 May 2023, over 1 year ago
Updated 13 September 2024, 2 months ago

Problem/Motivation

Modules may (`viewsreference` and `viewfield` do) include `$view->setItemsPerPage` in `hook_views_pre_view`, these hooks are run within `$view->preExecute()`. In order to get a view results of all possible filters, we set `$view->setItemsPerPage(0)` before we run `$view->preExecute()`, but we should run it after that.

Steps to reproduce

Add view to content with `viewsreference` or `viewfield` modules and override "Items per page"
setting. You will get ether "Illegal choice" error, wrong or no results, some exposed filters will not show up.

Proposed resolution

Run `$view->setItemsPerPage(0)` after `$view->preExecute()`.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡±πŸ‡»Latvia mansspams

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024