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
Comments
Comment #2
beunerd CreditAttribution: beunerd commentedComment #3
renaudcuny CreditAttribution: renaudcuny at OSCE: Organization for Security and Co-operation in Europe commentedDear beuner,
I confirm I have the exact same issue.
Comment #4
kittysunshineSame issue here, except with "Interaction with other dependencies" set to "AND."
Comment #5
bkhandruk CreditAttribution: bkhandruk commentedComment #6
bkhandruk CreditAttribution: bkhandruk commentedAdded a check for options.
Comment #7
kittysunshinePatch applied cleanly and it cleared up the error for us. Thank you!
Comment #8
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedWas fixed in the last release(2017-Apr-07). Can someone check it, please?
Comment #9
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedComment #11
g0blin79 CreditAttribution: g0blin79 at bmeme commentedNot 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).
Comment #12
Jehu CreditAttribution: Jehu commentedi can confirm @g0blin79, your patch fixes the problem for now (#11).
Please open this issue again @Maintainers
Comment #13
nikolabintev CreditAttribution: nikolabintev commented#11 works for me. @g0blin79 Thanks for the patch. @OlgaRabodzei the issue should be opened again.
Comment #14
joycelam CreditAttribution: joycelam at LimoenGroen commentedAfter downloading & using this module, this bug was still there. Patch from #11 solved it, though. Thanks!
Comment #15
useernamee CreditAttribution: useernamee as a volunteer commentedI applied the patch (#11) and it fixed the issue.
Thanks!
Comment #16
Tech720 CreditAttribution: Tech720 commentedCan the patch in #11 be applied to the latest release, or just the dev version?
Comment #17
beunerd CreditAttribution: beunerd commentedAgreed. Thank you all!
Comment #18
firfin CreditAttribution: firfin commentedThe patch is applied to latest DEV version. Now we just wait for a new alphe release (or use the dev)