When I set in a field a taxonomy (with his bundle) and a content (with his bundle) only nodes are returning in the search result.

Actually it does work normally as a normal field but as a paragraph.

When is using this field as a paragraph the AJAX that changes the queries get missing and just get selected Content and change it to Taxonomy Term don't work. My thought could be the AJAX miss the ID when the Paragraph inject / include this field.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killua99 created an issue. See original summary.

killua99’s picture

Status: Active » Needs review
FileSize
2.85 KB

Actually I found the issue.

Was all in the javascript on change attribute. The logic works well but the naming confection isn't modular or that dynamic tho

This is my first approach on how to solve this issue.

The selector is looking for a select name=something but it doesn't work with inline form like paragraphs where the field name will be paragraph[paragraph_entity][field_name] so from there it start failing.

I did a first thought on how to solve via class and not naming fields. Will be hard to know if any other module on the whild have differents names but class.

The module could build the class and made them more reliable than a field name.

jibran’s picture

Status: Needs review » Needs work

Have you tried this JS with mutli value field?

killua99’s picture

Yes and it fails.

It was my first thoughts on how to solve the issue adding a class selector. Still it need to figure out the form_state and add the delta from somewhere.

jibran’s picture

Title: Taxonomies and Nodes don play nice with Paragraphs » DER widget doesn't work with Paragraphs
Status: Needs work » Needs review
Issue tags: +JavaScriptTest
FileSize
3.11 KB
3.54 KB

How about this? Let me add some tests for this as well.

jibran’s picture

jibran’s picture

larowlan’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php
@@ -78,6 +79,7 @@ class DynamicEntityReferenceWidget extends EntityReferenceAutocompleteWidget {
+    $js_class = Html::cleanCssIdentifier("dynamic-entity-reference-{$items->getName()}[$delta][target_type]");

nice

  • jibran committed 13c856b on 8.x-1.x
    Issue #2698065 by jibran, killua99, larowlan: DER widget doesn't work...

  • jibran committed e540348 on 8.x-1.x
    Issue #2698065 by jibran, killua99, larowlan: DER widget doesn't work...
jibran’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @larowlan for the review.

Status: Fixed » Closed (fixed)

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