A lot of Notice: Undefined offset: 0 in conditional_fields_evaluate_dependency() notices get reported when using conditional fields with select elements.

The attached patch makes those notices go away without changing the actual behaviour of the method.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

legolasbo created an issue. See original summary.

colan’s picture

Status: Needs review » Needs work
+++ b/conditional_fields.api.inc
@@ -606,12 +606,20 @@ function conditional_fields_evaluate_dependency($context, $values, $options) {
+        $dependency_values = array(array($key => $dependency_value));

We're supposed to be using the short array syntax nowadays.

Baysaa’s picture

Reroll for alpha-4. Uses short array syntax and applies cleanly.

Baysaa’s picture

Status: Needs work » Needs review
colan’s picture

Status: Needs review » Postponed (maintainer needs more info)

This looks like a duplicate of #2893597: Notice: Uninitialized string offset. Is there anything missing, or can we mark it as such?

legolasbo’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Closing this since there hasn't been an update in over 6 months.

firfin’s picture