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)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Road Kill created an issue. See original summary.

mluzitano’s picture

Status: Active » Needs review
FileSize
957 bytes

Added 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

mluzitano’s picture

Status: Needs review » Needs work

I just realized that my patch resolves the error message, but does not resolve the access denied issue. I'll work on that part today.

Danny Englander’s picture

Issue summary: View changes
mluzitano’s picture

Status: Needs work » Needs review

I'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.

Danny Englander’s picture

Title: Update Access Denied » Access denied error after update
Status: Needs review » Reviewed & tested by the community

I 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.

gifthorse’s picture

ysamoylenko’s picture

Hello 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.

  • ysamoylenko committed 5552313 on 8.x-2.x authored by mluzitano
    Issue #3056303 by mluzitano, Road Kill, Danny Englander, ysamoylenko:...
ysamoylenko’s picture

Status: Reviewed & tested by the community » Fixed

The patch was committed.
Thanks, everyone for your participation in resolving the issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.