current item variable has not been set to this view

I am trying to get an Exhibit to work. It adds pages and maintains the page hierarchy fine with text entries and thumbnails for hompage and themepages but when you "attach an Item" to any theme/story page and then try to view the page it displays the Error:


    A current item variable has not been set to this view.

#0 [internal function]: Omeka_View_Helper_GetCurrentRecord->getCurrentRecord('item', true)
#1 /opt/omeka-exhibitTest/application/libraries/Zend/View/Abstract.php(350): call_user_func_array(Array, Array)
#2 /opt/omeka-exhibitTest/application/libraries/globals.php(1791): Zend_View_Abstract->__call('getCurrentRecor...', Array)
#3 /opt/omeka-exhibitTest/application/libraries/globals.php(1791): Omeka_View->getCurrentRecord('item', true)
#4 /opt/omeka-exhibitTest/plugins/Coins/CoinsPlugin.php(28): get_current_record('item')
#5 [internal function]: CoinsPlugin->hookPublicItemsShow(Array)
#6 /opt/omeka-exhibitTest/application/libraries/Omeka/Plugin/Broker.php(157): call_user_func(Array, Array)
#7 /opt/omeka-exhibitTest/application/libraries/globals.php(188): Omeka_Plugin_Broker->callHook('public_items_sh...', Array)
#8 /opt/omeka-exhibitTest/application/libraries/globals.php(204): fire_plugin_hook('public_items_sh...', Array)
#9 /opt/omeka-exhibitTest/plugins/ExhibitBuilder/views/shared/exhibit_layouts/dpla-story-page/layout.php(13): get_plugin_hook_output('public_items_sh...', Array)
#10 /opt/omeka-exhibitTest/plugins/ExhibitBuilder/helpers/ExhibitFunctions.php(408): include('/opt/omeka-exhi...')
#11 /opt/omeka-exhibitTest/themes/dpla/exhibit-builder/exhibits/show.php(50): exhibit_builder_render_exhibit_page()
#12 /opt/omeka-exhibitTest/application/libraries/Omeka/View.php(117): include('/opt/omeka-exhi...')
#13 /opt/omeka-exhibitTest/application/libraries/Zend/View/Abstract.php(888): Omeka_View->_run('/opt/omeka-exhi...')
#14 /opt/omeka-exhibitTest/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(900): Zend_View_Abstract->render('exhibits/show.p...')
#15 /opt/omeka-exhibitTest/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(921): Zend_Controller_Action_Helper_ViewRenderer->renderScript('exhibits/show.p...', NULL)
#16 /opt/omeka-exhibitTest/application/libraries/Zend/Controller/Action.php(212): Zend_Controller_Action_Helper_ViewRenderer->render('show', NULL, false)
#17 /opt/omeka-exhibitTest/plugins/ExhibitBuilder/controllers/ExhibitsController.php(160): Zend_Controller_Action->render('show')
#18 /opt/omeka-exhibitTest/plugins/ExhibitBuilder/controllers/ExhibitsController.php(129): ExhibitBuilder_ExhibitsController->renderExhibit(Array)
#19 /opt/omeka-exhibitTest/application/libraries/Zend/Controller/Action.php(516): ExhibitBuilder_ExhibitsController->showAction()
#20 /opt/omeka-exhibitTest/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('showAction')
#21 /opt/omeka-exhibitTest/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#22 /opt/omeka-exhibitTest/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#23 /opt/omeka-exhibitTest/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#24 /opt/omeka-exhibitTest/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#25 /opt/omeka-exhibitTest/index.php(23): Omeka_Application->run()
#26 {main}

Browser Firefox 39.0 - primary
Omeka 2.0
PHP 5.5.26 (apache2handler)
OS Linux 2.6.32-504.23.4.el6.x86_64 x86_64
MySQL Server 5.5.44
MySQL Client mysqlnd 5.0.11-dev
Apache Apache
Coins 2.0
CsvImport 2.0-dev
DocsViewer 2.0
Dropbox 0.7
DublinCoreExtended 2.0
ExhibitBuilder 2.0.2
GoogleAnalytics 2.0
Html5Media 2.0
LcSuggest 2.0
Lcsh 1.1
OpenSeadragon 0.3.1
SimplePages 2.0
SimpleVocab 2.0
Zoomit 2.0
DPLA 2.0 (current)
Seasons 2.0
Thanks, Roy 2.0

I have spent several days searching this site and any other location search engines would send me. While similar issues have been found they usually don't pertain because of lack of "plugin" and such. The database looks fine except the exhibit_page_entries has NULLs in all file_ID fields - but changing this has no positive effect.

Any help or good places to look will be greatly appreciated.

It looks like your custom "dpla-story-page" layout has a call on line 13 to what I'm guessing is the "public_items_show" hook.

The plugins that attach to that hook (the Coins plugin, at least) understandably are looking for a current Item, as would exist on the items show page. You either need to remove the call to the hook if it was unintended, or do something like calling set_current_record to set the current Item before the hook runs.

I found the code section I think you are referring to in each of the layout.php files for the different pages - while each looks similar to:

<!-- dpla-story-page/layout.php -->
<?php if (count(dpla_get_exhibitpage_entries()) > 0): ?>
    <div class="slide-Container">
        <div class="slidegallery flexslider">
            <?php $items = dpla_get_exhibitpage_entries(); ?>
            <ul class="slides <?= count($items) == 1 ? "single-slide" : ""?>">

                <?php foreach ($items as $item): ?>
                    <li data-thumb="<?=$item['file_uri_square'] ?>" class="flexslider-slide">
                        <div class="plugin-content">
                            $unique_id = "itemDetailsBox_".hash("md4", exhibit_builder_exhibit_item_uri($item['item']));
                            if ($media = get_plugin_hook_output('public_items_show', array('view' => get_view(), 'item' => $item['item']))) {
                                echo $media;
                            } else {
                                echo files_for_item(array(), array('class'=>'item-file'), $item['item']);
                            <span data-id="<?=$unique_id?>" class="show-item-details cboxElement"><span>i</span></span>

                        <div class="caption">

                        <div class="overlay">
                            <div id="<?=$unique_id?>">
                                <div class="inline_content">
                                        <?php echo metadata_table($item); ?>

                <?php endforeach; ?>


<?php endif; ?>

I am really new at changing the omeka coding itself so I might have a series of basic questions before the end.

So by adding something like
set_current_record($itemC, $item['item'], $setPreviousRecord = false)
Prior to the IF call with the hook and making the change within that IF. I should not need to have to use this new "item" throughout the loop - if I understand it correctly.

I'm not sure you want that get_specific_plugin_hook_output line at all. What that looks like it's doing is trying to account for another plugin that is supposed to print some nicer output for the item. But, since you have Coins activated, every item is going to have some output there, and you'll never get the normal display of files.

Basically, that layout looks like it's only intended to work in a pretty specific setup, and probably one without the Coins plugin activated, at least.

This is a very specific 3rd party layout for displaying exhibits in a specific consistent layout. It is the DPLA exhibitions as seen at

If it is not using CoinS at all perhaps I can turn off CoinS and try it. Would deactivating CoinS remove the CoinS data from the database??

Deactivating plugins never removes things from the database, and Coins doesn't store anything in the database anyway.

It worked to deactivate the CoinS plugin. Just as long as they don't need any of the functionality of CoinS this will work. So for now I'm back in business - Thanks very much for the insight and help. I might keep poking at this as time permits to see if I can get it working with CoinS - it is one of the first plugins people request.

Thanks again.

The problem is really with that layout.

What it's doing is making the assumption that anything using that hook will be something you want to show in the exhibit instead of the "regular" view. Probably that's supposed to be the OpenSeadragon plugin or some other similar plugin that does some kind of media view, judging from the variable name.

That layout will have to change if it's going to work alongside Coins, if I'm reading it correctly.