Warning: Undefined array key for states

Created on 4 May 2023, over 1 year ago

Problem/Motivation

I've four states and three transitions. Getting four errors like below with missing array key.

Warning: Undefined array key "" in webform_workflows_element_element_form_after_build() (line 262 of modules\contrib\webform_workflows_element\webform_workflows_element.module).

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States crutch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @crutch
  • First commit to issue fork.
  • @ranjit1032002 opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Ranjit1032002

    Created MR!10 for the issue mentioned, please review.
    Thank you.

  • 🇺🇸United States crutch

    Thanks Ranjit. Still getting warning with patch.

    Warning: Undefined array key "" in webform_workflows_element_element_form_after_build() (line 262 of modules\contrib\webform_workflows_element\webform_workflows_element.module).
    
    webform_workflows_element_element_form_after_build(Array, Object)
    call_user_func_array('webform_workflows_element_element_form_after_build', Array) (Line: 1083)
    Drupal\Core\Form\FormBuilder->doBuildForm('webform_submission_event_request_add_form', Array, Object) (Line: 579)
    Drupal\Core\Form\FormBuilder->processForm('webform_submission_event_request_add_form', Array, Object) (Line: 325)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
    Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'add') (Line: 1250)
    Drupal\webform\Entity\Webform->getSubmissionForm() (Line: 77)
    Drupal\webform\Controller\WebformEntityController->addForm(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    ...
  • Hi. I've not used this patch as $options could be non-empty but still not have [''] as a key, so the issue would continue. I've committed a change to dev to resolve this, could this please be checked in your environments? (I can't recreate this issue myself sadly).

  • 🇺🇸United States crutch

    Thank you, sorry for delayed response. Using current dev and getting the same result but it's reporting line 263 now

    Warning: Undefined array key "" in webform_workflows_element_element_form_after_build() (line 263 of modules\contrib\webform_workflows_element\webform_workflows_element.module).
    
    webform_workflows_element_element_form_after_build(Array, Object)
    call_user_func_array('webform_workflows_element_element_form_after_build', Array) (Line: 1083)
    Drupal\Core\Form\FormBuilder->doBuildForm('webform_submission_event_request_node_7926_add_form', Array, Object) (Line: 579)
    Drupal\Core\Form\FormBuilder->processForm('webform_submission_event_request_node_7926_add_form', Array, Object) (Line: 325)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
    Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'add') (Line: 1257)
    Drupal\webform\Entity\Webform->getSubmissionForm(Array) (Line: 112)
    Drupal\webform\Element\Webform::preRenderWebformElement(Array)
    call_user_func_array(Array, Array) (Line: 101)
    Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
    Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array) (Line: 479)
  • 🇷🇸Serbia botanic_spark

    Hi, I am also getting the warning, even with latest dev version.

  • 🇷🇸Serbia botanic_spark

    I think the issue is solved with update to the operator.

  • Status changed to RTBC about 1 year ago
  • 🇮🇳India keshavv India

    Confirmed that there is no further warnings. We can merge #10 patch.

  • Status changed to Fixed about 2 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024