I have a simple dependency set up between a boolean field (dependee) and a short text field (dependent). In the node form the relationship appears to work just fine (checking or unchecking the box shows/hides the dependent field, respectively). But when I save the form, I get a series of these errors:

Notice: Uninitialized string offset: 0 in conditional_fields_evaluate_dependency() (line 660 of modules/conditional_fields/conditional_fields.api.inc).
conditional_fields_evaluate_dependency('edit', Array, Array) (Line: 473)
conditional_fields_evaluate_dependencies(Array, Array, Object) (Line: 358)
conditional_fields_dependent_validate(Array, Object, Array)
call_user_func_array('conditional_fields_dependent_validate', Array) (Line: 277)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 235)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'node_blog_post_edit_form') (Line: 119)
Drupal\Core\Form\FormValidator->validateForm('node_blog_post_edit_form', Array, Object) (Line: 571)
Drupal\Core\Form\FormBuilder->processForm('node_blog_post_edit_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('node_blog_post_edit_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Regarding the configuration...

- dependent field is "Visible"
- when the dependee "is Checked"
- interaction with other dependencies: "OR"
- all other options left untouched

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

beuner created an issue. See original summary.

beunerd’s picture

Issue summary: View changes
renaudcuny’s picture

Dear beuner,
I confirm I have the exact same issue.

kittysunshine’s picture

Same issue here, except with "Interaction with other dependencies" set to "AND."

bkhandruk’s picture

Assigned: Unassigned » bkhandruk
bkhandruk’s picture

kittysunshine’s picture

Status: Needs review » Reviewed & tested by the community

Patch applied cleanly and it cleared up the error for us. Thank you!

OlgaRabodzei’s picture

Status: Reviewed & tested by the community » Closed (cannot reproduce)

Was fixed in the last release(2017-Apr-07). Can someone check it, please?

OlgaRabodzei’s picture

Status: Closed (cannot reproduce) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

g0blin79’s picture

Not fixed for me.
I'm using 1.x-dev version updated 05/05/2017, but the error still remains.

I changed the same code in the patch at #6 and now it seems to work well. But the patch needs to be recreated because the line numbers are changed.

Here the new patch for the new release (as I said: same code, different lines).

Jehu’s picture

i can confirm @g0blin79, your patch fixes the problem for now (#11).
Please open this issue again @Maintainers

nikolabintev’s picture

#11 works for me. @g0blin79 Thanks for the patch. @OlgaRabodzei the issue should be opened again.

joycelam’s picture

After downloading & using this module, this bug was still there. Patch from #11 solved it, though. Thanks!

useernamee’s picture

I applied the patch (#11) and it fixed the issue.
Thanks!

Tech720’s picture

Can the patch in #11 be applied to the latest release, or just the dev version?

beunerd’s picture

Agreed. Thank you all!

firfin’s picture

The patch is applied to latest DEV version. Now we just wait for a new alphe release (or use the dev)