After adding a new reaction rule, when I try to add an ation I get warnings on the second action configuration form page.

    Warning: Invalid argument supplied for foreach() in Drupal\rules\Form\Expression\ActionForm->submitForm() (line 122 of modules/rules/src/Form/Expression/ActionForm.php).

    Drupal\rules\Form\Expression\ActionForm->submitForm(Array, Object) Drupal\rules\Form\AddExpressionForm->validateForm(Array, Object) call_user_func_array(Array, Array) Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'rules_expression_add') Drupal\Core\Form\FormValidator->validateForm('rules_expression_add', Array, Object) Drupal\Core\Form\FormBuilder->processForm('rules_expression_add', Array, Object) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() call_user_func_array(Object, Array) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) Stack\StackedHttpKernel->handle(Object, 1, 1) Drupal\Core\DrupalKernel->handle(Object)
    Strict warning: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Drupal\rules\Form\Expression\ActionForm::submitFirstStep() should not be called statically in Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (line 116 of core/lib/Drupal/Core/Form/FormSubmitter.php).

    Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) Drupal\Core\Form\FormBuilder->processForm('rules_expression_add', Array, Object) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() call_user_func_array(Object, Array) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) Stack\StackedHttpKernel->handle(Object, 1, 1) Drupal\Core\DrupalKernel->handle(Object) 

Comments

fago created an issue. See original summary.

fago’s picture

klausi’s picture

Cogax opened a PR for this at https://github.com/fago/rules/pull/380

Cogax’s picture

Assigned: Unassigned » Cogax
Cogax’s picture

Status: Active » Needs review

It would be helpful if someone can review my PR. I'm unsure if I'm doing it right.

Cogax’s picture

Assigned: Cogax » Unassigned

  • klausi committed c0df4f4 on authored by Cogax
    Issue #2659806 by Cogax, klausi: Fixed PHP warnings when adding an...
klausi’s picture

Status: Needs review » Fixed

Merged with improved comments, thanks!

Status: Fixed » Closed (fixed)

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