When on the manage items page the following error occurs:

Strict warning: Only variables should be passed by reference in theme_node_gallery_api_sort_items_form() (line 232 of [..]node_gallery/theme/theme.inc).

This is because the result of a function (file_view() in this case) is being passed directly to drupal_render. The result of file_view() needs to be assigned to a variable first and that variable passed into drupal_render().

EDIT
The same also happens in theme_node_gallery_api_manage_items_form() around line 52.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

clipps’s picture

I encountered the same issue on the manage page and also on the upload new item tab.

llehotsky’s picture

Same issue here. Appears also in beta-3 release.

I am relatively newbie to Drupal, so correct me if I'm wrong. Solved by putting
file_view((object) $file, 'node_gallery_api_admin_thumbnail') from drupal_render(file_view((object) $file, 'node_gallery_api_admin_thumbnail')); into separate variable and only then rendering it, as suggested in the original post.

Hence code on line 59 of theme.inc changed from

$row[] = drupal_render(file_view((object) $file, 'node_gallery_api_admin_thumbnail'));

to

$file_view_object = file_view((object) $file, 'node_gallery_api_admin_thumbnail');
$row[] = drupal_render($file_view_object);

Same principle applies to row 232, with the exception that variable has to be outside of array.

zero2one’s picture

Status: Active » Needs review
FileSize
1.25 KB

I created a patch that fixes the strict warnings.

zengenuity’s picture

Status: Needs review » Fixed

Looks good. Committed. http://drupalcode.org/project/node_gallery.git/commit/c8b8697

Thanks for the patch!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Update to mention same error in theme_node_gallery_api_manage_items_form()