Hi all,
FYI after installing this module on the latest Drupal 9.0.5 I'm not able to display /admin/people/switch-user-list page:

Drupal\Component\Serialization\Exception\InvalidDataTypeException: /var/www/site/web/modules/contrib/userswitch/userswitch.links.action.yml: Duplicate key "userswitch.user.user_list" detected at line 6. in Drupal\Core\Discovery\YamlDiscovery->decode() (line 24 of core/lib/Drupal/Core/Discovery/YamlDiscovery.php).
CommentFileSizeAuthor
#2 userswitch.patch393 bytesla vague illuminee

Issue fork userswitch-3169065

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

Bohus Ulrych created an issue. See original summary.

la vague illuminee’s picture

StatusFileSize
new393 bytes

This patch works for me

bohus ulrych’s picture

Yes, this patch works well - tested with 9.0.7

ptitb’s picture

Patch worked as expected! Would be nice if this could be committed to release.

nimoatwoodway’s picture

+1 Patch works - tested with 9.0.7.

Also fixed in https://www.drupal.org/project/userswitch/issues/3087885

j_s’s picture

Status: Active » Reviewed & tested by the community

I can also confirm that this patch worked. On normal install, the site white screens when trying to get to People and makes this module unusable. The site returns to normal functionality and the module provides the expected outcome with the change in the patch. Thanks!

nicolas bouteille’s picture

+1 thanks [@Guillaume Aveline@] :)

avpaderno’s picture

Version: 8.x-1.9 » 8.x-1.x-dev
avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
   title: 'Switch User'
   appears_on:
     - entity.user_role.collection
-userswitch.user.user_list:
-  title: Switch User
-  route_name: userswitch.user.user_list
   description: 'Manage user List.'
   parent: system.admin
   weight: 4

An action doesn't use a parent value nor a weight.
Either the action must appear on a single route, or it must appear in two routes. In both the cases, removing only a route name and a title isn't sufficient.

avpaderno’s picture

Title: Duplicate key "userswitch.user.user_list" detected at line 6. » The userswitch.user.user_list key is used twice in userswitch.links.action.yml
nessunluogo’s picture

Using both last dev or last stable version (right now 8.x-1.9) on Drupal 9.3.8, I get this error on EVERY PAGES with both admin, authenticated or anonymous user.

Patch solved the issue.

darrick made their first commit to this issue’s fork.

astringer’s picture

If you end up on this page: the patch from this issue Add an entity operation instead of a user list, solves this bug, AND it's a much better solution from a user experience perspective. And I also believe it solves the route issue in #9.

nessunluogo’s picture

1 year later... better late than never...

The right link in @astringer's post, with the solution to this issue too, should be Add an entity operation instead of a user list

avpaderno’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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