- Issue created by @emulamba
- Status changed to Needs work
11 months ago 11:06am 8 March 2024 The Needs Review Queue Bot → tested this issue.
While you are making the above changes, we recommend that you convert this patch to a merge request → . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)
- Status changed to Postponed: needs info
11 months ago 1:11pm 8 March 2024 This does not meet the requirements of a critical issue.
views_bulk_operations is in the stack trace. Is this reproducible without views_bulk_operations?
- 🇮🇳India saurabh rawat
saurabh rawat → made their first commit to this issue’s fork.
- 🇮🇳India saurabh rawat
saurabh rawat → changed the visibility of the branch 3426603-divisionbyzeroerror-division-by to hidden.
- 🇮🇳India saurabh rawat
saurabh rawat → changed the visibility of the branch 3426603-divisionbyzeroerror-pager to hidden.
- Merge request !7152adding condition for pager in case limit is zero → (Open) created by saurabh rawat
- Status changed to Needs review
10 months ago 8:25am 22 March 2024 - Status changed to Postponed: needs info
10 months ago 1:25pm 22 March 2024 - 🇺🇸United States smustgrave
Was previously tagged for steps to reproduce which are still needed.
What research was done? How come that value is getting set to 0? Putting a check like this could mask a larger problem.
- 🇺🇸United States fizcs3 Omaha, Nebraska; USA
I've just come across a similar issue...
For me, was in Layout Builder, "Add Block" of a predefined View display block, and accidentally entered "00" (instead of "99") into the "items per block" field and clicked the Update button. Nothing happened and it kept me on the Configure Block modal. Turns out it threw a similar error to the system log when I looked there, which my trace starts with:DivisionByZeroError: Division by zero in Drupal\Core\Pager\Pager->setTotalPages() (line 78 of /var/www/html/web/core/lib/Drupal/Core/Pager/Pager.php) #0 /var/www/html/web/core/lib/Drupal/Core/Pager/Pager.php(51): Drupal\Core\Pager\Pager->setTotalPages('5', '00') #1 /var/www/html/web/core/lib/Drupal/Core/Pager/PagerManager.php(56): Drupal\Core\Pager\Pager->__construct('5', '00', 0) #2 /var/www/html/web/core/modules/views/src/Plugin/views/pager/SqlBase.php(333): Drupal\Core\Pager\PagerManager->createPager('5', '00', 0) #3 /var/www/html/web/core/modules/views/src/Plugin/views/query/Sql.php(1551): Drupal\views\Plugin\views\pager\SqlBase->updatePageInfo() #4 /var/www/html/web/core/modules/views/src/ViewExecutable.php(1441): Drupal\views\Plugin\views\query\Sql->execute(Object(Drupal\views\ViewExecutable)) #5 /var/www/html/web/core/modules/views/src/ViewExecutable.php(1469): Drupal\views\ViewExecutable->execute(NULL) ...
The above patch makes sense to me, which contains a very reasonable validation of the $limit variable to assure it isn't zero.
I applied the patch to D10.2.5 and fixes my issue, of user error causing an unnecessarily bad system error. - Status changed to Closed: outdated
6 days ago 11:43am 24 January 2025 - 🇳🇱Netherlands johnv
This is outdated and solved elsewhere.
On the views pager setting pop-up, setting the 'Items per page' to 0 (help text 'Enter 0 for no limit.') makes that NO pager is instantiated.
So the problem does not occur, since the code is not reached.