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

Created on 7 August 2020, about 4 years ago
Updated 7 November 2023, 12 months 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 about 17 hours 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.

  • The Needs Review Queue Bot โ†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada Liam Morland Ontario, CA ๐Ÿ‡จ๐Ÿ‡ฆ

    Liam Morland โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 12 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada Liam Morland Ontario, CA ๐Ÿ‡จ๐Ÿ‡ฆ

    I have created an issue fork with the patch from #16 rebased onto 11.x. I am not seeing the button to create a merge request.

  • @liam-morland opened merge request.
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Seems fine to make this consistent with the node edit form ๐Ÿ‘

  • Status changed to Needs work 12 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Ignore the yellow circle the autocomplete field seems real small and doesn't expand. Can we make it a little longer.

    Added before screenshot to the IS waiting on after.

Production build 0.71.5 2024