I installed Open Restaurant based on Drupal 7.x.

As soon as I insert any menu item into create categories, I get this warning:

Strict warning: Only variables should be passed by reference in sizzle_preprocess_views_view__content__menus__all_menus() (line 69 of /web/htdocs/xxxxxxxxxxx/home/profiles/restaurant/themes/sizzle/includes/menu.inc).

I checked the line and I got this code:

// Render the category and add it to template.
$variables['term'] = drupal_render(taxonomy_term_view($term, $view_mode));

I don't know how to improve this, in order to solve the issue. Writing to the group that made Open Restaurant I didn't got any answer. Hence my post here.

  • 1
    Issues found in existing modules are offtopic here, but since you are trying to fix it yourself, you are in gray area... I posted an answer, but make sure it'll be in their issue queue, too, OK? – Mołot Dec 28 '15 at 11:17

drupal_render takes reference. taxonomy_term_view($term, $view_mode) is not a variable, so you shouldn't use it in places where reference is needed - because if something takes reference, it will try to update what it got, and it's impossible with a function. So to fix this, you need to create variable, then store result of taxonomy_term_view in it, and pass that variable to drupal_render.

Then, create patch file nd post it in their issue queue for everybody to see.

  • Following your suggestion, I did in this way, the error didn't show up anylogner and I got not any issue with the template. - $variables['term'] = drupal_render(taxonomy_term_view($term, $view_mode)); + $just_variable = taxonomy_term_view($term, $view_mode); + $variables['term'] = drupal_render($just_variable); – Tormy Van Cool Dec 28 '15 at 12:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.