- Issue created by @guenole
- First commit to issue fork.
Hi @guenole,
I have updated the code you pushed to fix the current issue. The array_slice method had a problem, but it is now working properly.prefer #MR !2 for the fix
If a user has only the "access webform overview" permission, when he try to access to webform overview page /admin/structure/webform the module trigger a php error :
DivisionByZeroError: Division by zero in Drupal\Core\Pager\Pager->setTotalPages() (line 78 of core/lib/Drupal/Core/Pager/Pager.php).
Drupal\Core\Pager\Pager->__construct(0, , 0) (Line: 56)
Drupal\Core\Pager\PagerManager->createPager(0, ) (Line: 105)
Drupal\domain_access_webform\DomainWebformEntityListBuilder->getEntityIds() (Line: 644)
Drupal\webform\WebformEntityListBuilder->load() (Line: 241)
Drupal\Core\Entity\EntityListBuilder->render() (Line: 171)
Drupal\webform\WebformEntityListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('webform')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I major use cases, the users do not only have this permission but it could happen.
Do not try to build the pager with pager.manager service if the $limit variable is set to FALSE and let the webform module render an empty page.
Active
1.0
Code
Hi @guenole,
I have updated the code you pushed to fix the current issue. The array_slice method had a problem, but it is now working properly.
prefer #MR !2 for the fix