- 🇯🇵Japan tyler36 Osaka
Confirmed fix on Drupal
10.1
.## Test
1. Install "user_redirect"
1. Enable module via drush:drush en user_redirect
1. Log in as administror, error appears1. Logout
1. Install patch MR!2
1. Log in as administrator, error no longer displays.
1. Disabling patch causes error to re-appear. - 🇳🇬Nigeria chike Nigeria
I had a redirect set for 'Login' and none set for 'Logout' then I tried logging out and got this error,
ArgumentCountError: Too few arguments to function Drupal\user_redirect\UserRedirect::__construct(), 3 passed in /home/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 6 expected in Drupal\user_redirect\UserRedirect->__construct() (line 80 of /home/public_html/modules/contrib/user_redirect/src/UserRedirect.php).
I applied this patch and the error was solved.
Thanks very much for the patch and the module. I am getting the following PHP warnings after login as admin from /user/login. I tried the fixes and it seems to work on core 10.1.5.
Warning: Undefined array key "authenticated" in Drupal\user_redirect\UserRedirect->prepareDestination() (line 83 of /code/web/modules/contrib/user_redirect/src/UserRedirect.php)
Warning: Trying to access array offset on value of type null in Drupal\user_redirect\UserRedirect->prepareDestination() (line 83 of /code/web/modules/contrib/user_redirect/src/UserRedirect.php)I created a patch on 2.0.0 to see if this patch can be applied properly since composer doesn't see 2.0.x which has the fixes.
Problem 1
- Root composer.json requires drupal/user_redirect default, found drupal/user_redirect[dev-1.0.x, 1.0.0, 1.0.1, 1.0.2, 1.0.x-dev (alias of dev-1.0.x), 2.0.0] but it does not match the constraint.- Status changed to Closed: outdated
9 months ago 1:52pm 28 July 2024 - 🇮🇳India vipin.mittal18 Greater Noida
In order to support multiple roles for the user, numerous changes have been made in the code that resolve this issue and it is no longer necessary to apply these code fixes.
- Status changed to Needs review
29 days ago 9:22am 31 March 2025 - 🇫🇷France tostinni
This issue still exists on newly created role for user_redirect 2.0.0
- 🇮🇳India vipin.mittal18 Greater Noida
Hello @tostinni,
Could you please confirm if you are able to replicate the issue from https://www.drupal.org/project/user_redirect/releases/2.0.x-dev → as I am planning to have another release with Drupal 11 compatible.
- 🇫🇷France tostinni
Hi @vipin.mittal18,
I tried 2.0.x-dev but the redirection wasn't happening. Reverting back to 2.0.0 with this patch got me back the expected behavior.
Is there a missing hook_upgrade for dev version ?$ composer require 'drupal/user_redirect:2.0.x-dev@dev' ./composer.json has been updated Running composer update drupal/user_redirect Gathering patches for root package. Loading composer repositories with package information Updating dependencies Lock file operations: 0 installs, 1 update, 0 removals - Upgrading drupal/user_redirect (2.0.0 => dev-2.0.x c0ec60b) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 0 removals - Syncing drupal/user_redirect (dev-2.0.x c0ec60b) into cache Gathering patches for root package. Gathering patches for dependencies. This might take a minute. - Removing drupal/user_redirect (2.0.0) - Installing drupal/user_redirect (dev-2.0.x c0ec60b): Cloning c0ec60b195 from cache