I have the warning when opening the status page admin/reports below. I am not sure if it is caused by other modules or not. Can you help examining this? Thanks.
Warning: Invalid argument supplied for foreach() in Drupal\system\Element\StatusReportPage::preRenderGeneralInfo() (line 42 of core/modules/system/src/Element/StatusReportPage.php).
Drupal\system\Element\StatusReportPage::preRenderGeneralInfo(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedThe problem here is that for some reason the section of system_requirements() that sets that cron key has not set #description to be an array.
Comment #3
cilefen CreditAttribution: cilefen commentedComment #4
danghoaiphuc CreditAttribution: danghoaiphuc as a volunteer commentedThanks Celifen. Do you have any suggested solution for this warning?
Comment #5
Alex Andrascu CreditAttribution: Alex Andrascu at Intellix commentedConfirmed. Getting this on Drupal core 8.3.2
Comment #6
rpmarchitecture CreditAttribution: rpmarchitecture as a volunteer commentedI can confirm the same error initially with 8.3.2, and persists after upgrading core to 8.3.3 and 8.3.4. Everything else on the site appears in order and functioning properly. Any ideas to try to resolve?
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer and commentedI am having the same problem too and I can not figure it out:
Warning: Invalid argument supplied for foreach() in Drupal\system\Element\StatusReportPage::preRenderGeneralInfo() (line 42 of core/modules/system/src/Element/StatusReportPage.php).
Drupal\system\Element\StatusReportPage::preRenderGeneralInfo(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->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: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment #8
mogio_hh CreditAttribution: mogio_hh commentedhere u go:
https://www.drupal.org/node/2899396#comment-12199012
Comment #10
rpmarchitecture CreditAttribution: rpmarchitecture commentedThe patch does not seem to work for me. Can you describe what you are doing with the patch?
Comment #11
wnymathguy CreditAttribution: wnymathguy commentedJust wanted to chime in here. I get the
"Warning: Invalid argument supplied for foreach() in Drupal\system\Element\StatusReportPage::preRenderGeneralInfo() (line 42 of core/modules/system/src/Element/StatusReportPage.php)."
message on /admin/reports/status and I'm in Drupal Version 8.3.7
HOWEVER, I get it in my https version of my site not my http version. The main difference is the https site has Ubercart installed. The rest of the modules are close to identical. Would more info from me help anybody diagnose it? I'm a newbie here so don't know what is relevant.
Comment #12
hugronaphor CreditAttribution: hugronaphor as a volunteer and at Acrosto for Acrosto commentedOne of the reason would be that some of your modules are defining the requirements without a specific key(e.g:
$requirements[] = [...];
).By specifying a key the error will be gone (e.g:
$requirements['mymodule_compoonent'] = [...];
)Comment #15
romreactor CreditAttribution: romreactor as a volunteer commentedHello,
I attempted this patch on my Drupal 8.4.0 version since this issue has reappeared. However, I completely got a broken StatusReportPage.
Please take a look at this error message that I am receiving after updating to Drupal 8.4 from Drupal 8.3.7 and applying the patch to my error listed as Warning below..
The website encountered an unexpected error. Please try again later.
ParseError: syntax error, unexpected '}' in Composer\Autoload\includeFile() (line 57 of core/modules/system/src/Element/StatusReportPage.php).
I reverted the file to its previous version before this patch attempt, however on my report status I still receive this Warning message and am unable to update my Drupal database.
Warning: Invalid argument supplied for foreach() in Drupal\system\Element\StatusReportPage::preRenderGeneralInfo() (line 42 of core/modules/system/src/Element/StatusReportPage.php).
Drupal\system\Element\StatusReportPage::preRenderGeneralInfo(Array)
call_user_func(Array, Array) (Line: 378)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 576)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 108)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment #16
ShannonMcG CreditAttribution: ShannonMcG as a volunteer commentedThanks to hugronaphor's comment #12, I found two places in the Ubercart module installed on my site that had used "$requirements[]" without a key. I added a key and the errors went away.
I'm running Drupal Version 8.5.3 and Ubercart 8.x-4.0-alpha5.
Problem code:
Fixed code:
Comment #17
bjaxelsen CreditAttribution: bjaxelsen commentedI think this is related, I need to add an empty description key in uc_store_requirements to make error message on status page go away:
Comment #18
yosia_ken CreditAttribution: yosia_ken as a volunteer commented#17 works!
Comment #19
Graham Leach CreditAttribution: Graham Leach commentedHello Everyone.
Bjorn, great work - but just a little light on context and details, IMHO...
For those of us who are not Drupal Core Team, Engineers or even Developers, I have written a more extensive article about this fix on my website - along with dozens of other D6, D7 and D8 fixes - in vernacular I believe is more in tune with the needs and communication requirements of regular people.
Here you go: https://bit.ly/2XNvvAV
Graham Leach
Comment #22
rubbeng CreditAttribution: rubbeng commentedComment #23
pameeela CreditAttribution: pameeela commentedI'm going to close this since numerous comments indicate this was an issue with custom or contrib module code. Comments #12, #16, #17 and #19 contain useful tips for how to fix it.