Problem/Motivation

With Drupal 9.4.4 and alinks 2.0.0, each installed by composer, freshly installed but not yet configured, the following warning was given on page /admin/config/content/alinks. Warning persists after cron run, cache flush, adding config options, etc.

Full log message:

Warning: foreach() argument must be of type array|object, null given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 113 of /core/lib/Drupal/Core/Render/Element/Checkboxes.php)
#0 /core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 /core/lib/Drupal/Core/Render/Element/Checkboxes.php(113): _drupal_error_handler()
#2 [internal function]: Drupal\Core\Render\Element\Checkboxes::valueCallback()
#3 /core/lib/Drupal/Core/Form/FormBuilder.php(1282): call_user_func_array()
#4 /core/lib/Drupal/Core/Form/FormBuilder.php(1000): Drupal\Core\Form\FormBuilder->handleInputElement()
#5 /core/lib/Drupal/Core/Form/FormBuilder.php(1070): Drupal\Core\Form\FormBuilder->doBuildForm()
#6 /core/lib/Drupal/Core/Form/FormBuilder.php(1070): Drupal\Core\Form\FormBuilder->doBuildForm()
#7 /core/lib/Drupal/Core/Form/FormBuilder.php(574): Drupal\Core\Form\FormBuilder->doBuildForm()
#8 /core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm()
#9 /core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#10 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#11 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#12 /core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#14 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#15 /vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#17 /core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#18 /core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#19 /core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#20 /core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#21 /core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
#22 /core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#23 /core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#24 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#25 /core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#26 /index.php(19): Drupal\Core\DrupalKernel->handle()
#27 {main}

CommentFileSizeAuthor
#3 3301334-3.patch561 bytesdspachos

Comments

higherform created an issue. See original summary.

dspachos’s picture

Working on a patch

dspachos’s picture

StatusFileSize
new561 bytes
dspachos’s picture

Status: Active » Needs review
higherform’s picture

Hey thanks for crafting a patch. I am not sure how to test this as I already configured alinks which got rid of the error. I guess it would take standing up a fresh Drupal instance + fresh alinks install to test?

dspachos’s picture

Hi @higherform! Yeah, that's right you can test in a fresh instance of Drupal + alinks. Since you reported this, I believe you already have an instance/setup to test it (?)

higherform’s picture

@dspachos -

I got a local dev copy of D9.4.5 running, installed and enabled alinks 2.0.0 (without your patch), and was able to duplicate the warning message on that copy as well.

Applied patch, warning does not appear to be occuring. I think that fixed it.

Thanks