February 2018

Warning: Invalid argument supplied for foreach() in theme_links() (line 1810 of /includes/theme.inc).

When you get this Warning with a sub-theme change this text in template.php (https://www.drupal.org/project/responsive/issues/1820574)

In Theme:

if (isset($vars['main_menu'])) { $vars['main_menu_links'] = $vars['main_menu']; $vars['main_menu'] = theme('links__system_main_menu', array( 'links' => $vars['main_menu_links'], 'attributes' => array( 'class' => array('links', 'main-menu', 'clearfix'), ), 'heading' => array( 'text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'), ) )); } else { $vars['main_menu'] = FALSE; }

In the sub theme change to:

if (isset($vars['main_menu_links'])) { $vars['main_menu'] = theme('links__system_main_menu', array( 'links' => $vars['main_menu_links'], 'attributes' => array( 'class' => array('links', 'main-menu', 'clearfix'), ), 'heading' => array( 'text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'), ) )); }

Composer could not find a composer.json file in /home/<user>

I havebeen trying to update Composer and I kept coming up with this error.  After fighting this issue for about 20 minutes, checking various references on Google and being totally confused (as my understanding of Composer is not that great) I came to an easy fix.  Apparently Composer looks for composer.json file  in the directory you are in.  Next it checks your home directory and then uses that in it's error reporting.  This is good for sending you in the wrong direction, but now understanding this everthing makes total sense, and that is to make sure you update composer from within the code of the site, otherwise the composer.json file is not available and without it, composer is unable to update.

 

Tags: