Refactor Drupal\system\Plugin\views\field\BulkForm to support a select form as well

Created on 12 December 2016, over 7 years ago
Updated 30 January 2023, over 1 year ago

Problem/Motivation

The media library needs a field handler to select one or more items from a view. That is to be introduced in #2834729: [META] Roadmap to stabilize Media Library β†’ . Since a selection component is similar to a bulk form, but not exactly the same, it makes sense to refactor bulk forms to share their common implementation with select forms.

Proposed resolution

1. Extract some methods from the BulkForm to a base class and use it in BulkForm.
2. Change id generation in bulk forms so Ajax operations are also supported.

Remaining tasks

TBD

User interface changes

None.

API changes

The bulk form element IDs are changed because they are not unique if there is an Ajax action on the form. The current bulk form identifiers are increasing numeric items, which when an Ajax reload happens would not necessarily be the same anymore. $bulk_form_key becomes a unique identifier based on entity type, entity id, entity revision and language. This is important also if you want to reference a specific revision and/or language of an entity.

Data model changes

None.

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
SystemΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡©πŸ‡ͺGermany webflo

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.69.0 2024