item_file() function in version 1.3

Hi, I've just upgraded to v1.3 and have encountered an error that I'm having a hard time resolving.

The first appears (?) to be related to changes in the way Omeka loops items (noted in changelog Fix for ticket #787). This in particular is causing a fatal error where it previously worked:

echo item_file('fullsize uri')

The full code I'm using is below, but the source of the error seems to be the item_file() line.

function deco_display_awkward_gallery(){
		//this loops the most recent featured items
		$items = get_items(array('featured'=>true, 'recent'=>true,'type'=>'Still Image'), 10);
		if ($items!=null)

			$index = 0;
			while ($file = loop_files_for_item()):
			    if ($file->hasThumbnail()):
			    //this makes sure the loop grabs only the first image for the item
			        if ($index == 0):
		    	       echo '<div><img src="'.item_file('fullsize uri').'"/>';

			echo '<div class="showcase-caption">';
			echo /*Item Title and Link*/'<h3>'.link_to_item().'</h3>';
			echo /*Item Description Excerpt*/'<p>'.item('Dublin Core', 'Description',array('snippet'=>190));
			echo /*Link to Item*/ link_to_item(' ...more ').'</p></div></div>';

        	echo'<div><img src="'.WEB_ROOT.'/themes/deco/images/emptyslideshow.png" alt="Oops" /><div class="showcase-caption"><h3>UH OH!</h3><br/><p>There are no featured items right now. You should turn off "Display Slideshow" in the theme settings until you have some.</p></div></div>';

Thanks -- Erin

Can you post the specific error that you're getting?

well, here is the big list of errors.

I can't say I've been able to make much sense of it other than to narrow down the source by process of elimination.

but maybe all you need is...


Route display is not defined

Yes, that's very helpful.

You've discovered a bug in the item_file helper, but it's actually unrelated to the Ticket #787 changes you mentioned above.

I've created a ticket in our issue tracker for this bug. You can get details or keep updated on the status of the issue there.

It should be a quick fix, but I can't make any claims at this moment about if/when a fix would make it to an official release.

As a workaround, you can replace your call to item_file with:


Thanks very much John, that did the trick.

Will this method continue to work in future versions of Omeka, with or without the fix to item_file()?

One other related question: will it work with older versions of Omeka?

Yes and yes. getWebPath() has been around since before Omeka 1.0, and should continue to work for the foreseeable future.

great, thanks!