- ๐บ๐ธUnited States smustgrave
Only open thread
This is a plugin, should we override the ::create method from the parent and inject the entity-type manager and load the user that way instead of using the User singleton?
You mentioned it may not be worth the effort and for a small change that path would require a change record, trigger_error (I would imagine), and then tests.
Just my thought.
- Status changed to Needs work
almost 2 years ago 11:20am 21 February 2023 - ๐ฌ๐งUnited Kingdom alexpott ๐ช๐บ๐
This is actually a bug fix as it is correctly changing the title from the user's account to the display name.
I wonder what this change means for argument's summary name field... in UserViewsData we do:
$data['users_field_data']['uid']['argument'] += [ 'name table' => 'users_field_data', 'name field' => 'name', 'empty field name' => \Drupal::config('user.settings')->get('anonymous'), ];
But now this argument is using the display name which might have nothing to do with account name. I think we need to address this inconsistency if we change to display name here. FWIW off the top of my head I have no idea what summary queries do :)
- ๐ฎ๐ณIndia sahil.goyal
sahil.goyal โ made their first commit to this issueโs fork.
- last update
over 1 year ago 29,283 pass - ๐ฎ๐ณIndia sahil.goyal
Updated the plugin to use dependency injection for the entity-type manager instead of the global singleton
\Drupal\user\Entity\User::load()
. Instantiate the plugin with the entity-type manager, and modified the execute() method to load the user entity using the injected entity-type manager. - Status changed to Needs review
over 1 year ago 4:16am 19 April 2023 - Status changed to Needs work
over 1 year ago 10:49pm 24 April 2023 - ๐บ๐ธUnited States smustgrave
Now I believe this will need to default to NULL and trigger_error when the Entity Type Manager isn't passed in.
Should have test coverage I believe too.
#32 still needs an answer also.