DivisionByZero error when sorting webforms by "Results" as a non-admin user

Created on 4 March 2024, 4 months ago

Problem/Motivation

There seems to be some kind of a problem regarding the current getLimit having possible return value of 'FALSE' and that messes up the paging divisions when user is non-admin user. At the same time I noticed that the current paging could be moved around to inside the load method to actually add paging after the user has counted the webforms the user actually has a access to.

Steps to reproduce

  1. Create new Drupal 10 install and add Webforms 6.2.x to it
  2. Edit permissions for user role "Content editor" by adding following to that role:
    • Access the webform overview page
    • Create webforms
    • Edit own webform
  3. Create new user and add role "Content editor" for it.
  4. Log out as admin and log in as "Content editor" -user
  5. Navigate to `/admin/structure/webform` and click "Results" tab, error should pop up, and since you are non-admin it is regular Drupal error page. `The website encountered an unexpected error. Try again later.` but logging out and logging in as a admin shows the error `DivisionByZero...`
  6. Try to add some webforms to notice that the same happens.

Proposed resolution

  • Add simplified getLimit method.
  • Add paging after the entity count is correct and user has access to all webforms the system is paging.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

6.2

Component

User interface

Created by

🇫🇮Finland konstara Helsinki

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024