Problem/Motivation
Context user profile causes an error when the block configuration screen is loaded. The block is not rendered.
Warning: Invalid argument supplied for foreach() in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 100 of
/Sites/gold50/web/core/lib/Drupal/Core/Render/Element/Checkboxes.php) #0 /Sites/gold50/web/core/includes/bootstrap.inc(600):
_drupal_error_handler_real(2, 'Invalid argumen...', '/...', 100, Array)
#1 /Sites/gold50/web/core/lib/Drupal/Core/Render/Element/Checkboxes.php(100): _drupal_error_handler(2, 'Invalid argumen...', '/...', 100,
Array)
#2 [internal function]: Drupal\Core\Render\Element\Checkboxes::valueCallback(Array, false, Object(Drupal\Core\Form\FormState))
#3 /Sites/gold50/web/core/lib/Drupal/Core/Form/FormBuilder.php(1278): call_user_func_array(Array, Array)
#4 /Sites/gold50/web/core/lib/Drupal/Core/Form/FormBuilder.php(1001): Drupal\Core\Form\FormBuilder->handleInputElement('block_form', Array,
Object(Drupal\Core\Form\FormState))
#5 /Sites/gold50/web/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('block_form', Array,
Object(Drupal\Core\Form\FormState))
#6 /Sites/gold50/web/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('block_form', Array,
Object(Drupal\Core\Form\FormState))
#7 /Sites/gold50/web/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('block_form', Array,
Object(Drupal\Core\Form\FormState))
#8 /Sites/gold50/web/core/lib/Drupal/Core/Form/FormBuilder.php(575): Drupal\Core\Form\FormBuilder->doBuildForm('block_form', Array,
Object(Drupal\Core\Form\FormState))
#9 /Sites/gold50/web/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm('block_form', Array,
Object(Drupal\Core\Form\FormState))
#10 /Sites/gold50/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(61): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\block\BlockForm),
Object(Drupal\Core\Form\FormState))
#11 /Sites/gold50/web/core/modules/block/src/Controller/BlockAddController.php(27):
Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\block\Entity\Block))
#12 [internal function]: Drupal\block\Controller\BlockAddController->blockAddConfigureForm('g50_gold_price_...', 'gold50')
#13 /Sites/gold50/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#14 /Sites/gold50/web/core/lib/Drupal/Core/Render/Renderer.php(573):
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#15 /Sites/gold50/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124):
Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#16 /Sites/gold50/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97):
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#17 /Sites/gold50/vendor/symfony/http-kernel/HttpKernel.php(151):
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#18 /Sites/gold50/vendor/symfony/http-kernel/HttpKernel.php(68):
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#19 /Sites/gold50/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57):
Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /Sites/gold50/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47):
Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /Sites/gold50/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106):
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /Sites/gold50/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85):
Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /Sites/gold50/web/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(287):
Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /Sites/gold50/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47):
Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /Sites/gold50/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52):
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /Sites/gold50/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23):
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /Sites/gold50/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1,
true)
#28 /Sites/gold50/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#29 {main}.
Steps to reproduce
1. install context 4.0.0
2. Attempt to enable a block
An error is reported. The block is not displayed (probably related to https://www.drupal.org/project/context/issues/3225763)
Proposed resolution
Apply a default to the form for user profile
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| context-profiledefault-ddd-ddd.patch | 828 bytes | interlated |
Comments
Comment #2
paulocsThis issue was fixed here #3225677: Warning: foreach() argument must be of type array|object
Comment #3
paulocsComment #4
paulocsComment #5
john_b commentedMay save others a few hours:
A custom block (perhaps any block) placed while the error was showing does not display.
Neither will that block placement work even after the module has been updated, until the broken block placement has been removed for the theme in question, then re-instated.
Comment #6
saccard commentedThanks John_B this was indeed helpful.