Problem/Motivation

Right now this module only allows appending (for multi-value fields) or replacing (for single-value fields). It would be nice to present the following options instead:

  1. Append
  2. Replace
  3. Remove
  4. Clear

"Append" and "Remove" would only be shown for multi-value fields. "Remove" would take whatever term(s) were selected and remove them and only them from the node.

If "Clear" was selected, then the field for selecting terms becomes hidden as it's not relevant.

This feature would really expand the usefulness of the module. It would allow for the following scenario we encounter often: Deciding to create a new taxonomy vocabulary and field. We need to "move" terms from one reference field to the other. So we need to both remove the term from one field and add to another.

Note the project detail page on Drupal.org lists this as a TODO: "Allow appending or fully setting values to multi-value term fields."

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

We'll now have a fieldset around each field on the selection form. Each fieldset will contain a new "actions" input along with the existing term assignment select drop-down or autocomplete. Here's a screenshot:

New interface showing fieldsets for each term reference field and new actions radio buttons.

API changes

Data model changes

CommentFileSizeAuthor
#5 new_assignment_interface.jpg373.37 KBbkosborne
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

bkosborne created an issue. See original summary.

bkosborne’s picture

Issue summary: View changes
fjgarlin’s picture

Version: 8.x-1.x-dev » 2.x-dev

bkosborne’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new373.37 KB

Okay, ready for review!

fjgarlin’s picture

Status: Needs review » Needs work

This is a great feature! Thanks for also adding tests for it.

I just left some cosmetic feedback on the MR.

bkosborne’s picture

Status: Needs work » Needs review

Agreed we should be consistent! I converted all the local vars to snake case. I do use camelCase for everything most of the time out of habit, but I think the module already was using snake_case, so I switched to using that.

Thanks for the quick reviews!

fjgarlin’s picture

Status: Needs review » Reviewed & tested by the community

This is looking really good. The new/extra tests give so much confidence in the changes too. RTBC.

I'm going to do a local test and then merge after that.

  • fjgarlin committed 54d2b785 on 2.x authored by bkosborne
    Issue #3532102 by bkosborne, fjgarlin: Support additional actions:...
fjgarlin’s picture

Status: Reviewed & tested by the community » Fixed

This is now merged. Thanks so much!

fjgarlin’s picture

I created the tag 2.0.0 with this change, making the first 2.x release with D11 support.
https://www.drupal.org/project/bulk_edit_terms/releases/2.0.0

Status: Fixed » Closed (fixed)

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