Bug in the COinS Plugin?!

Hello,

is this a bug?

I inserted the following plugin hook in the items/browse.php page of my theme.

<?php echo plugin_append_to_items_browse_each();  ?>

The following line of code in the file plugins.php of the COinS folder seems to imply that the Plugin can be attached to this hook.

<?php add_plugin_hook('public_append_to_items_browse_each', 'coins'); ?>

However I always get the following error when I fire a search within the Omeka-Frontend that yields 0 results.

An item has not been set to be displayed on this theme page! Please see Omeka documentation for details.

When I deactivate the COinS Plugin or when I remove the plugin-hook in the items/browse.php file, everything works fine.

Best regards, Matthias Einbrodt

My best guess is that the theme is not assigning a current item before the hook fires. COinS will use the item() function to look up the information, but if there is no current item, item() will return that error.

You might check whether item() works in the place where you are firing that hook.

Hi,

wouldn't it be a bit strange to assign a current item on the browse page where usually more than one item is displayed?

I thought the COinS Plugin offers the functionality to display a COin for every item that is displayed on the browse page.

Best regards, Matthias

A browse page for a normal theme should already be calling the hook you mention here.

You don't have to or want to specify one current item for the browse page. But, the hook is meant to be called from within the part of the page that's looping through the items. That loop normally sets each in turn as the "current" item, so plugins can access it.

What it sounds like is happening here is that you added that hook somewhere outside the looping portion of the browse page, where there would be no current item for the plugin to work with.

I'd first check to make sure it's not already there, because it normally is.

Hi John,

thank you for your remark about putting the plugin hook into the item-loop.

Now everything works like it should.

Best regards, Matthias