I have a site that uses both the Paragraphs and Field Collection modules. I have a Field Collection inside a Paragraph type that I want to show or hide with another Paragraph field, but instead the Collection is always shown no matter what. Conditional Fields works with all other fields inside Paragraphs, but not Field Collections.

conditional_fields_element_after_build() calls conditional_fields_load_dependencies using the entity type and bundle names from the $element variable; on field collections, the entity type in that variable is always field_collection_item.

The _load_dependencies function seems to compare it to the entity_type field in the field_config_instance table, which has an entity_type of paragraphs_item. All other field types seem to correctly have the entity type the field is attached to there, but field collections mistakenly list the entity type they are.

This is probably a bug in Field Collection of some sort, but I'm posting it here because I lack the expertise and vocabulary to tell those people what they should be doing. If someone will confirm for me that the bug is theirs and help me concisely describe what they're doing wrong, I'll gladly move the issue over to their queue.

Comments

dqd’s picture

Version: 7.x-3.0-alpha1 » 7.x-3.x-dev
Status: Active » Closed (outdated)

Thanks for the report and all the efforts in here. But due to inactivity in this issue for some years and because of the upcoming EOL of Drupal 7, I will close this issue on the way cleaning up the issue queue.

Feel free to re-open as "Needs review" if you found a solution or have a patch to be reported to help others.