- last update
about 1 year ago Patch Failed to Apply - Issue created by @ross-zch
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).
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.
Add patch to check if $field_values_location
is array in ConditionalFieldsFormHelper.php
Needs review
4.0
Code