Error : Only variables should be passed by reference I get this error Strict warning:


  Only variables should be passed by reference in include() (line 20 of
  ...)


Can anybody see what is wrong here? 

&lt;section id="fixed-navbar"&gt;
  &lt;nav class="navbar navbar-default navbar-static-top" role="navigation"&gt;
    &lt;div class="container"&gt;
      &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
      &lt;div class="navbar-header"&gt;
        &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-nav"&gt;
          &lt;span class="sr-only"&gt;&lt;?php print t('Toggle navigation'); ?&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;/button&gt;
        &lt;a class="navbar-brand" rel="home" href="&lt;?php print url('&lt;front&gt;'); ?&gt;" title="&lt;?php print variable_get('site_name', ''); ?&gt;"&gt;
          &lt;?php print isset($logo) &amp;&amp; $logo ? theme('image', array('path' =&gt; $logo)) : '&lt;h3&gt;' . variable_get('site_name', '') . '&lt;/h3&gt;'; ?&gt;
        &lt;/a&gt;
      &lt;/div&gt;

      &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
      &lt;div class="collapse navbar-collapse" id="main-nav"&gt;
        &lt;ul class="nav navbar-nav  navbar-right"&gt;
          &lt;?php print drupal_render(menu_tree_output(menu_tree_all_data('menu-top-menu'))); ?&gt;
        &lt;/ul&gt;
      &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
    &lt;/div&gt;&lt;!-- /.container --&gt;
  &lt;/nav&gt;

&lt;/section&gt;
The error is because you're trying to directly pass menu_tree_output() function return value to drupal_render() function. Which is not allowed because drupal_render() accepts $element as call by reference. When accepting arguments as call by reference those must be passed as variable (preferred).

So your code should look like below:

&lt;nav&gt;
  &lt;div class="container"&gt;
    &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
    &lt;div class="collapse navbar-collapse" id="main-nav"&gt;
      &lt;ul class="nav navbar-nav navbar-right"&gt;
        &lt;?php $menu_output = menu_tree_output(menu_tree_all_data('menu-top-menu')); ?&gt;
        &lt;?php print drupal_render($menu_output); ?&gt;
      &lt;/ul&gt;
    &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
  &lt;/div&gt;&lt;!-- /.container --&gt;
&lt;/nav&gt;