I'm receiving the following warning in my Omega subtheme when I go to the front page.

Warning: Invalid argument supplied for foreach() in omega_preprocess_page() (line 257 of themes/omega/omega/omega.theme)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ExTexan created an issue. See original summary.

himerus’s picture

I've found this issue finally. Working on it.

  • himerus committed 2e31b27 on 8.x-5.x
    Issue #2710941: Errors on theme settings page
    
himerus’s picture

Status: Active » Fixed
FileSize
3.75 KB

I think I've got this fixed in latest commit. The attached patch should solve those errors.

Status: Fixed » Closed (fixed)

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

satoj’s picture

Title: Errors on theme settings page » Warning on theme all fornt page
Priority: Critical » Normal
Issue summary: View changes
Issue tags: +theme
Related issues: +#2697599: Omega theme file starts warning to be shown on front page

It is already reported, and a closed problem seems to recur.

I added such a code and avoid the problem.

--- omega.theme	2017-01-19 16:20:54.000000000 +0900
+++ omega.theme	2017-01-19 16:21:17.000000000 +0900
@@ -254,6 +254,9 @@
     // duplciate the #id into a class for better use with Omega.gs
     $altered_group_id = str_replace("_", "-", $group_id);
     $region_classes[$group_id][] = $altered_group_id . '-layout';
+    if (is_null($groupRegions)) {
+      return;
+    }
     foreach($groupRegions as $region_id => $region_info) {
       $altered_region_id = str_replace("_", "-", $region_id);
satoj’s picture

satoj’s picture

mfgr’s picture

After all this, I'm still left with one warning on all pages of my new fresh Drupal 8 website:

Notice: Undefined index: regions in omega_preprocess_page() (line 261 of themes\omega\omega\omega.theme).

omega_preprocess_page(Array, 'page', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 462)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 88)
__TwigTemplate_0153823a6ef9fd576d1dc31f20a92fbff426861879872595b8a76155120cb840->doDisplay(Array, Array) (Line: 381)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 355)
Twig_Template->display(Array) (Line: 366)
Twig_Template->render(Array) (Line: 64)
twig_render_template('themes/custom/february/templates/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
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: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
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: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Countach’s picture

#9 - Still having this issue (version alpha7)

ExTexan’s picture

Title: Warning on theme all fornt page » Errors on theme settings page