Needs work
Project:
Conditional Fields
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2021 at 16:16 UTC
Updated:
22 Jan 2026 at 17:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hmendes commentedHello!
I was unable to reproduce your error. Could you provide more steps to reproduce the problem?
Comment #3
maxwellkeeble commentedI have the same issue on a form, but in my case the "controlled by" field is an entity reference select element (which is set up to allow one value only) that references a custom entity (not a node).
Could it be that the "states_handler_entity_reference_autocomplete" plugins is hard-wired just for nodes, even though it indicates it should be for generic entities?
The error is:
Comment #4
drclaw commentedSo this is a bit of a weird one and requires some specific conditions to trigger the error:
You can recreate the issue on any node type by setting the control field to "Authored By (uid)" and setting the "when the control field" dropdown to "has value...". Then load the node add/edit form and you should see it.
The root cause of the issue is actually the first item in the list. The field_cardinality value is only set for FieldStorageConfig fields (e.g. fields created via "Manage Fields"), but not for BaseFieldDefinitions. The fix is simple enough: we just need to also check base field definitions for the dependee field. Patch attached!
Comment #6
nagy.balint commentedOn one of our sites where content entity builder was used to create a base field on an entity, we got the undefined index as in the title.
The patch #4 fixes the issue.
Comment #7
joaopauloc.dev commentedPatch #4 worked for me.
My setup.
Drupal 11.2
Conditional fields 4@alpha
Address 2.0.4.
My address field(country, state and location visible) is visible when a certain condition is true, but after i added this condition i could see that error on form of my custom entity. Also, the address field is inside a field group.
With the patch the warning disapear.