Problem/Motivation

An error is thrown when adding a date field as a dependency on a select list field. I have also reproduced the error when date field has a dependency on bool fields.

Error: Cannot use object of type Drupal\Core\Datetime\DrupalDateTime as array in Drupal\conditional_fields\ConditionalFieldsFormHelper::formValidate() (line 748 of modules/contrib/conditional_fields/src/ConditionalFieldsFormHelper.php).

Steps to reproduce

1. Create a new paragraph type, add an optional date (date only) field and a select list field
2. Add a dependency to make the date field controlled by the select list - invisible depending on value
3. Enable the paragraph on a node, then create node with the paragraph and choose the select list option that causes the date field to turn invisible
4. Save the page.

Proposed resolution

Add patch to check if $field_values_location is array in ConditionalFieldsFormHelper.php

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ross-zch created an issue. See original summary.

ross-zch’s picture

Component: User interface » Code
fastangel’s picture

StatusFileSize
new2.28 KB

I attach patch compatible with last version

benstallings made their first commit to this issue’s fork.