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)
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

JeroenT created an issue. See original summary.

jeroent’s picture

Status: Active » Needs review

MR1 Fixes the notice for me.

phily’s picture

Thanks, 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.

ladybug_3777’s picture

Patch on comment #4 worked for me on Drupal 9.1.10

ladybug_3777’s picture

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

jeroent’s picture

Status: Needs review » Reviewed & tested by the community

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

  • JeroenT committed c72a735 on 8.x-1.x
    Issue #3205541 by PhilY: Notice: Undefined index: allow_destination in...
jeroent’s picture

Status: Reviewed & tested by the community » Fixed

Merged to 8.x-1.x. Thanks!

jeroent’s picture

Status: Fixed » Closed (fixed)

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