Problem/Motivation

It's not possible to map a checkboxes to an Entity Reference field with cardinality unlimted. This seems to be a simple logic error in the MappingSteps.php. If the field is not repeatable, it only allows mapping to a FieldIntance where ->isMultiple() is false when in fact its perfectly valid to have this:

Screenshot of checkboxes field in gather content

Map to an Entity Reference field for a taxonomy with cardinality unlimited.

Steps to reproduce

  1. Create a Taxonomy 'Themes'
  2. Create a GC checkboxes field 'Themes'
  3. Create an entity reference field to Themes from a content type with cardinality unlimited
  4. Go to mapping and attempt to map; No mapping options available

Proposed resolution

Patch coming

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Comments

scott_euser created an issue. See original summary.

scott_euser’s picture

Assigned: scott_euser » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new619 bytes
gdeni’s picture

Assigned: Unassigned » gdeni
StatusFileSize
new572 bytes

Thank you for reporting the issue! I think it would be better to add an extra condition to the else section to check the field type instead of removing it.

If we remove the else section, it will be possible to map single value Drupal fields with repeatable GatherContent fields, that may cause errors or unexpected behaviours.

I would rather check if the field is a text field, as currently only text fields can be repeatable in GatherContent. This way, checkbox fields (and all other non-text fields) could be mapped as before, but text fields only with the same cardinality.

Patch is attached, do you think this could work?

scott_euser’s picture

That looks good to me, thanks!

  • gdeni committed 00a132b on 8.x-5.x authored by scott_euser
    Issue #3200954 by scott_euser, gdeni: Mapping steps unnecessarily...
gdeni’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Then, I'm making a new release that contains the bug fixes you reported.

gdeni’s picture

Assigned: gdeni » Unassigned
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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