Visiting /admin/people/login-and-logout-redirect-per-role without any config leads to the following error:
Notice: Undefined index: allow_destination in Drupal\login_redirect_per_role\Form\RedirectURLSettingsForm->buildForm() (line 165 of modules/contrib/login_redirect_per_role/src/Form/RedirectURLSettingsForm.php).
Drupal\login_redirect_per_role\Form\RedirectURLSettingsForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('redirect_url_admin_settings', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
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: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
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: 706)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments
Comment #3
jeroentMR1 Fixes the notice for me.
Comment #4
philyThanks, that works for me too using Drupal 8.9.14 and Login And Logout Redirect Per Role 8.x-1.7
Attached patch is for anyone wishing it.
Comment #5
ladybug_3777 commentedPatch on comment #4 worked for me on Drupal 9.1.10
Comment #6
ladybug_3777 commentedAnother note to add - If you install Drupal 9 with the standard install I found out that User 1 does not have the Administrator role assigned.
See this link for more details: https://www.drupal.org/node/2913822
Because of this I thought the module did not work after setting up a rule for the administrator role. I had to actually turn on administrator rights for user 1 (/user/1/edit) in order for the redirect to work properly.
Comment #7
jeroentThe patch is also available from the merge request (https://git.drupalcode.org/project/login_redirect_per_role/-/merge_reque...).
Since @ladybug_3777 mentioned that the patch is working in #5. I'm marking this issue as RTBC.
The issue mentioned in #6 is unrelated to this module. I think something went wrong when installing your site. When using the standard profile the role should be added to user 1 (https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/profiles/sta...).
If you can reproduce that error, I would suggest creating a separate issue in the core issue queue.
Comment #9
jeroentMerged to 8.x-1.x. Thanks!
Comment #10
jeroent