Remove raw DB queries in AssignOwnerNode::buildConfigurationForm() and always use autocomplete

Created on 7 August 2020, over 4 years ago
Updated 7 November 2023, about 1 year ago

Problem/Motivation

Drupal\node\Plugin\Action\AssignOwnerNode::buildConfigurationForm() does direct DB queries against {users} and friends to figure out if it should use an autocomplete or a select to pick the user you're targeting in the action.

As @berdir pointed out at #2830504-45: AssignOwnerNode allows assigning to anonymous users due to misspelling of key #selection_settings โ†’

Other places don't do this either, the node edit form is always an autocomplete, so why bother with this?

Steps to reproduce

Open core/modules/node/src/Plugin/Action/AssignOwnerNode.php and scroll down to buildConfigurationForm().

Proposed resolution

Kill that conditional and always use an autocomplete.

Remaining tasks

  1. Do it.
  2. Remove weird user creation mess in testAssignOwnerNodeActionConfiguration()
  3. Reviews / refinements.
  4. RTBC.
  5. Commit.

User interface changes

Username for AssignOwnerNode configuration form will always be an autocomplete, even on sites with less than 200 users.

Before

After

TBD

API changes

N/A

Data model changes

N/A

Release notes snippet

TBD.

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Node systemย  โ†’

Last updated 6 days ago

No maintainer
Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States dww

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs screenshots

    The change alters the user interface, so before and after screenshots should be added to document the UI change. Make sure to capture the relevant region only. Use a tool such as Aviary on Windows or Skitch on Mac OS X.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024