Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After updating to 8.2.81 I am getting access denied for the registration page with the following errors:
Warning: Invalid argument supplied for foreach() in Drupal\multiple_registration\Controller\MultipleRegistrationController->access() (line 88 of modules/contrib/multiple_registration/src/Controller/MultipleRegistrationController.php).
Drupal\multiple_registration\Controller\MultipleRegistrationController->access(Object)
call_user_func_array(Array, Array) (Line: 75)
Drupal\Core\Access\CustomAccessCheck->access(Object, Object, Object)
call_user_func_array(Array, Array) (Line: 159)
Drupal\Core\Access\AccessManager->performCheck('access_check.custom', Object) (Line: 135)
Drupal\Core\Access\AccessManager->check(Object, Object, Object, 1) (Line: 112)
Drupal\Core\Access\AccessManager->checkRequest(Object, Object, 1) (Line: 109)
Drupal\Core\Routing\AccessAwareRouter->checkAccess(Object) (Line: 94)
Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 115)
Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object, 'kernel.request', Object)
call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment | File | Size | Author |
---|---|---|---|
#2 | pages_white_list_defensive_code-3056303-2.patch | 957 bytes | mluzitano |
Comments
Comment #2
mluzitano CreditAttribution: mluzitano at Kanopi Studios commentedAdded an is_array check. To validate:
1. Install the latest 2.x of this module.
2. Clear cache
3. Go to the /user/login page
4. Note the error at line 88
5. Apply the patch
6. Clear cache
7. Go to the /user/login page again
8. Note the error is gone
Comment #3
mluzitano CreditAttribution: mluzitano at Kanopi Studios commentedI just realized that my patch resolves the error message, but does not resolve the access denied issue. I'll work on that part today.
Comment #4
Danny EnglanderComment #5
mluzitano CreditAttribution: mluzitano at Kanopi Studios commentedI've dug in more on this issue, and I feel now that the patch I made in #2 is valid. Here's the situation: the latest version of Multiple Registration has new access settings, which need to be configured before this module can be used. These settings can be found at this path, and you'll notice there's a message at the top about the need to configure access: /admin/config/people/multiple_registration
In the meantime, though, I think removing this error message is still valid, as it doesn't itself lead one to the solution. If we want to make this even clearer, I suggest we put the notice either on every page of the admin or maybe even on the front-end as well, but to me both are out of the scope of this issue.
Please review my patch to at least resolve the PHP Warning.
tl;dr: @road-kill you can solve the issue on your site by simply defining those access settings at the link in my first paragraph.
Comment #6
Danny EnglanderI have tested the patch in #2 above and the error no longer appears after the patch has been applied.
As @mluzitano mentions above, I did need to set / associate roles at
/admin/config/people/multiple_registration > Multiple Registration pages access settings
. Once this was done, I was able to access multiple registration page reg forms.Comment #7
gifthorse CreditAttribution: gifthorse commentedComment #8
ysamoylenko CreditAttribution: ysamoylenko at EPAM Systems commentedHello everyone.
Yes, you are right, you need to configure multiple registration whitelist settings.
It is related to the issue:
https://www.drupal.org/sa-contrib-2019-048
@mluzitano, thank you for your patch. It will be committed and included in the next module release.
Comment #10
ysamoylenko CreditAttribution: ysamoylenko at EPAM Systems commentedThe patch was committed.
Thanks, everyone for your participation in resolving the issue.