Hi, I am trying to get an illustration for Exhibit
$page = $pages[0];
$data = exhibit_builder_page_attachment(1,0,$page);
if($data['file']) {
$img_url = file_display_url($data['file']);
}
When I'm not logged as administrator, I am unable to get $img_url.
Now, going down in exhibit_builder_page_attachment() method
function exhibit_builder_page_attachment($entryIndex = 1, $fallbackFileIndex = 0, $exhibitPage = null)
{
if (!$exhibitPage) {
$exhibitPage = get_current_record('exhibit_page');
}
$entries = $exhibitPage->ExhibitPageEntry;
if (!isset($entries[$entryIndex])) {
return null;
}
$entry = $entries[$entryIndex];
$item = null;
$file = null;
$file_specified = false;
$caption = null;
if (($item = $entry->Item)) {
if (($file = $entry->File)) {
$file_specified = true;
} else if (isset($item->Files[$fallbackFileIndex])) {
$file = $item->Files[$fallbackFileIndex];
}
} else {
// If there's no item, nothing is attached.
return null;
}
$caption = $entry->caption;
return compact(array('item', 'file', 'file_specified', 'caption'));
}
In exhibitPageFunction.php
I found that I am able to retrieve
$entry = $entries[$entryIndex];
But $entry->Item and $entry->File return NULL when I'm not logged as administrator, very strange ?
Any Idea