Open akalata opened 5 years ago
Warning: count(): Parameter must be an array or an object that implements Countable in Drupal\Core\Render\Element\Radios::processRadios() (line 56 of core/lib/Drupal/Core/Render/Element/Radios.php). Drupal\Core\Render\Element\Radios::processRadios(Array, Object, Array) call_user_func_array(Array, Array) (Line: 997) Drupal\Core\Form\FormBuilder->doBuildForm('rng_event_settings', Array, Object) (Line: 1060) Drupal\Core\Form\FormBuilder->doBuildForm('rng_event_settings', Array, Object) (Line: 1060) Drupal\Core\Form\FormBuilder->doBuildForm('rng_event_settings', Array, Object) (Line: 1060) Drupal\Core\Form\FormBuilder->doBuildForm('rng_event_settings', Array, Object) (Line: 1060) Drupal\Core\Form\FormBuilder->doBuildForm('rng_event_settings', Array, Object) (Line: 1060) Drupal\Core\Form\FormBuilder->doBuildForm('rng_event_settings', Array, Object) (Line: 1060) Drupal\Core\Form\FormBuilder->doBuildForm('rng_event_settings', Array, Object) (Line: 561) Drupal\Core\Form\FormBuilder->processForm('rng_event_settings', Array, Object) (Line: 318) Drupal\Core\Form\FormBuilder->buildForm('rng_event_settings', Object) (Line: 93) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582) 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}() (Line: 151) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 44) Drupal\bat_api\StackMiddleware\BatApiMiddleware->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: 44) Drupal\services\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 665) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
This is caused by $element['unlimited_number']['#options'] being NULL in UnlimitedNumber->processUnlimitedNumber(), when $element['unlimited_number']['#type'] => 'radios' requires a countable result (as of PHP 7.2).
$element['unlimited_number']['#options']
UnlimitedNumber->processUnlimitedNumber()
$element['unlimited_number']['#type'] => 'radios'
See https://github.com/dpi/rng/issues/177 for a similar error in a related project.
Committed in 9cc930be
This is caused by
$element['unlimited_number']['#options']
being NULL inUnlimitedNumber->processUnlimitedNumber()
, when$element['unlimited_number']['#type'] => 'radios'
requires a countable result (as of PHP 7.2).See https://github.com/dpi/rng/issues/177 for a similar error in a related project.