Needs review
Project:
Business Rules
Version:
8.x-1.x-dev
Component:
Dependent fields
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Jun 2018 at 20:56 UTC
Updated:
23 Aug 2022 at 11:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tavib47 commentedI suggest trying to get the value of the parent field from the entity if the parent field value is empty, but I don't think this is the best idea. I attach the patch which fixes my issue, but it may break something else.
Comment #3
yseki commentedI guess the best approach would be to check if the field was rendered on the form before performing the validation test. I will check it on the next opportunity.
Comment #4
tavib47 commentedUpdated the patch to work with beta1 version.
Comment #5
tavib47 commentedComment #6
tavib47 commentedAnd now the patch without undefined variable error.
Comment #7
littlepixiez commented#6 worked for me, but the reason my parent entity value is empty is because I'm trying to modify this module to work with Paragraphs. :) Continuing my hacking... thanks for the patch! :D
Comment #8
tavib47 commentedUpdated the patch to work with the latest dev version
Comment #9
rosinegrean commentedComment #10
colanComment #11
pcambraI've been testing this on my fork over https://www.drupal.org/project/dependent_fields and I think the code needs to be on validateReferenceableEntities as well as in getReferenceableEntities.
I've pulled the entity from config for getting the parent values in a common way, let's see if this is a correct approach.