Problem

The problem is that when you are using a taxonomy term reference field with select2boxes multiple values widget inside a paragraph field having multiple values, when you add another paragraph item, the new taxonomy term reference field added will take the values from the previous one.

Steps to reproduce

  • Install the paragraphs contrib module
  • Create a new paragraph bundle and add a new taxonomy term reference field to it, with multiple values and the widget "Select2 boxes (Multiple values)"
  • Add the newly created paragraph to a content type as field and enable the unlimited values option for it.
  • When creating a new content, add some values to the previously created field and then add another paragraph item. The second paragraphs item field added should have the same values as the previous field.

Solution

For this we need to change the keys of the "initValues" array by adding the parent field to the identifier so that the jQuery selector will differentiate the fields.

Comments

mihai11 created an issue. See original summary.

mihai11’s picture

Here is the patch for this.

mihai11’s picture

Status: Active » Needs review
matsbla’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks for reporting the issue and the patch.

Can you link to what contrib project you are referring to?

bbu23’s picture

@matsbla I don't understand your question. What do you mean by linking the contrib project that he's referring to?

matsbla’s picture

There is nothing in core named "paragraphs bundle", so I guess it is from a contributed module? The steps to reproduce need to explain what modules you have installed

matsbla’s picture

What do you mean by linking the contrib project that he's referring to?

Add a link to the module providing the "paragraphe field"

bbu23’s picture

Sure, got it now. Will update the description.

bbu23’s picture

Issue summary: View changes
bbu23’s picture

@matsbla I updated the description, let me know if it's clear or if you need something else.

bbu23’s picture

Status: Postponed (maintainer needs more info) » Needs review
valentine94’s picture

Patch looks reasonable to me. + 1 RTBC

  • matsbla committed 627a526 on 8.x-1.x authored by mihai11
    Issue #3100860 by mihai11, bbu23, Valentine94: Select2boxes multiple...
matsbla’s picture

Status: Needs review » Fixed

Okay, great, thanks!

Status: Fixed » Closed (fixed)

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