- Issue created by @drale01
- 🇪🇸Spain fjgarlin
The module shows
Selected terms will be added.
because it's not checking for existing values already there.If you want to work on a MR for this, the key part to modify would be here: https://git.drupalcode.org/project/bulk_edit_terms/-/blob/8.x-1.x/src/Fo...
- 🇧🇦Bosnia and Herzegovina drale01 Sarajevo
It seems like this patch will address the issue.
It retrieves the taxonomy terms already assigned to nodes, compares them with the terms that are about to be assigned, and removes any duplications. - 🇪🇸Spain fjgarlin
Did you try dumping what's on
$node->get($name)->getValue()
and$value
in the line where I pointed it?You can try doing this to debug in line 199:
dd($value, $node->get($name)->getValue()); $value = array_merge($value, $node->get($name)->getValue());
Maybe we can have an easier solution than the suggested patch.
- 🇧🇦Bosnia and Herzegovina drale01 Sarajevo
Comment 🐛 Duplicated entry of taxonomy terms Active
Interesting, I'll try to find easier solution. Thanks @fjgarlin - 🇧🇦Bosnia and Herzegovina drale01 Sarajevo
Easier way to prevent duplicate entry terms
- Status changed to Needs review
over 1 year ago 3:07pm 15 December 2023 - 🇪🇸Spain fjgarlin
Thanks, this approach looks cleaner.
Can you try the version I made in MR4? The patch URL would be this: https://git.drupalcode.org/project/bulk_edit_terms/-/merge_requests/4/di...
It's almost the same but slightly simpler, but I haven't tested it, so if you can that'd be great.
-
fjgarlin →
committed d56fc78a on 8.x-1.x
Issue #3408721 by fjgarlin, drale01: Duplicated entry of taxonomy terms
-
fjgarlin →
committed d56fc78a on 8.x-1.x
- Status changed to Fixed
over 1 year ago 8:37am 18 December 2023 - 🇪🇸Spain fjgarlin
I merged the MR, thanks for reporting, work on a fix and testing. Fixed.
Automatically closed - issue fixed for 2 weeks with no activity.