Images not displaying after upgrade

Hi all. I just upgraded my site (appalachiantrailhistory.org) to 3.2.1 and when I did the images in the archive are no longer displaying. They do appear on the Browse page, but when I navigate to the individual item pages they are not there. I’m guessing there is a tick box I missed, but wanted to see if anyone knew otherwise. Thanks.

Looks like there’s an error on line 91 of your theme’s items/show.php file. Maybe a messed up <?php tag, but that’s just a guess from the error message.

Unless you also edited the theme as part of the upgrade, this might not really be related to the 3.2.1 upgrade, but could come from moving or updating servers or things like that.

Thanks John. Reclaim Hosting recently updated PHP to 8.1 and that’s when the trouble started. I then upgraded Omeka to 3.2.1 and everything works except that one issue. Do you think I need to dig into the theme?

I think you’ll need to look at that file, yeah. It’s probably something that was harmless in an older PHP version that now on the newer PHP is causing an error that’s stopping the page from completely rendering.

The problematic file should be themes/Appalachian-Trail-Histories-Theme/items/show.php within your installation. There’s an error getting thrown on line 91 of that file: it’s complaining about the text php so I would hazard a guess that there might be something like <? php on that line when it should be <?php, or something along those lines. You could share the contents of that line and a few surrounding ones here; it should be pretty clear what the issue is when looking at the code.

Switching to another theme should work also but then you wouldn’t have your custom design.

Is this the errant code?

    <div id="itemfiles" class="large-6 columns">
        <!-- <h3><?php //echo __('Files'); ?></h3> -->
        <?php if ($text = metadata('item', array('Item Type Metadata', 'Text'))): ?>
            <p><?php echo $text; ?></p>
          </div>
        <?php else: ?>
        <div class="element-text" style="float:right;"><?php echo files_for_item(
            array('imageSize'=>'fullsize','linkToFile'=>true,'linkToMetadata'=>false),//options
            array('class'=>'file-image'),
            null);
    endif; ?></div>
    </div>

I don’t think so.

From what you can see on the page, the problematic code looks like it should be around where the theme is trying to print the identifier of the item (the last thing printed before the error is a comment and the Identifier label).

You also could paste in the whole file if you’re having trouble locating the problem area.

<?php echo head(array(
    'title' => metadata('item', array('Dublin Core', 'Title')),
    'bodyclass' => 'items show',
)); ?>
<div class="row">
  <div class="large-12 columns">
    <div class="row">
      <div class="large-12 columns paginationrow">

            <ul class="pagination" role="navigation" aria-label="Pagination">
              <div class="medium-2 columns paginationrow" >
                <li style="float: left;" class="pagination-previous"><?php echo link_to_previous_item_show(); ?></li>
              </div>
                <div class="medium-2 columns paginationrow">
                <li style="float:right;" id="pagination-next"><?php echo link_to_next_item_show(); ?></li>
              </div>
            </ul>
      </div>
      </div>

    <div class="row">
        <div class="large-12 columns">
            <div class="page-header"><h1><?php echo metadata($item,array('Dublin Core', 'Title')); ?></h1></div>
        </div>
    </div>
    <div class="row">
        <div class="large-6 columns">
            <!-- Item Description -->
            <div class="row">
                <div class="large-12 columns">
                    <h4><i class="fa fa-thumb-tack"></i> Description: </h4>
                    <?php if ($itemDescription = metadata($item,array('Dublin Core','Description'))): ?>
                        <p class="lead"><?php echo $itemDescription; ?></p>
                    <?php else: ?>

                        <p class="alert">No description recorded yet.</p>
                    <?php endif; ?>
                </div>
            </div>

            <!-- Item Collection Information (if available) -->
            <?php if (get_collection_for_item($item)): ?>
            <div class="row"><div class="large-12 columns">
                <div id="collection" class="element">
                    <h4 style="display:inline"><?php echo __('Collection'); ?>: </h4>
                    <h4 style="display:inline"><?php echo link_to_collection_for_item(); ?></h4>
                </div>
            </div></div>
            <?php endif; ?>

            <div class="row"><div class="large-12 columns"><hr /></div></div>

            <div class="row">
                <div class="large-4 columns">
                <!-- Item Date Information -->
                    <h4><i class="fa fa-calendar"></i> Date: </h4>
                    <?php if ($itemDate = metadata($item,array('Dublin Core','Date'))): // TODO: create a date format function...?>
                        <div><?php echo $itemDate; ?></div>
                    <?php else: ?>
                        <div>None recorded.</div>
                    <?php endif; ?>
                </div>
                <div class="large-4 columns">
                <!-- Item Creator Information -->
                    <h4><i class="fa fa-user"></i> Creator: </h4>
                    <div>
                    <?php if ($itemCreator = metadata($item,array('Dublin Core','Creator'))): ?>
                        <?php echo $itemCreator; ?>
                    <?php else: ?>
                        None recorded.
                    <?php endif; ?>
                    </div>
                </div>
                <!-- Subject -->
                <div class="large-4 columns">
                     <h4><i class="fa fa-book"></i><?php echo __(' Subject'); ?></h4>
                    <?php if ($itemCreator = metadata($item,array('Dublin Core','Subject'))): ?>
                        <?php echo $itemCreator; ?>
                    <?php else: ?>
                        None recorded.
                    <?php endif; ?>
                </div>
            </div>
            <div class="row"><hr />

                <!-- Identifier -->
                <!-- <div class="large-4 columns">
                    <h4><i class="fa fa-bookmark"></i><?php echo __(' Identifier'); ?></h4>
                    <?php //if ($itemCreator = metadata($item,array('Dublin Core','Identifier'))): ?>
                        <?php //echo $itemCreator; ?>
                    <?php// else: ?>
                        None recorded.
                    <?php //endif; ?>
                </div> -->
                <!-- Contributor -->
                <div class="large-6 columns">
                    <h4><i class="fa fa-university"></i><?php echo __(' Contributor'); ?></h4>
                    <?php if ($itemCreator = metadata($item,array('Dublin Core','Contributor'))): ?>
                        <?php echo $itemCreator; ?>
                    <?php else: ?>
                        None recorded.
                    <?php endif; ?>
                </div>
                <div class="large-6 columns">
                  <h4><i class="fa fa-picture-o"></i><?php echo __(' Format'); ?></h4>
                  <?php if ($format = metadata($item, array('Dublin Core', 'Format'))): ?>
                    <?php echo $format; ?>
                  <?php else: ?>
                    None recorded.
                  <?php endif; ?>
                </div>
            </div>
            <!-- If the item belongs to a collection, the following creates a link to that collection. -->
            <div class="row"><hr />
            <div class="large-12 columns">
            <!-- Item Recipient Information (if available) -->
              <h4><i class="fa fa-archive"></i> Source: </h4>
                <div>
                <?php if ($itemCreator = metadata($item,array('Dublin Core','Source'))): ?>
                    <?php echo $itemCreator; ?>
                <?php else: ?>
                    None recorded.
                <?php endif; ?>
                </div>
              </div>
            </div>

            <!-- The following prints a list of all tags associated with the item -->
            <div class="row"><hr />
                <div class="large-12 columns">

                    <h4><i class="fa fa-tags"></i> Tags</h4>
                    <div class="tags well well-small">
                        <?php if (tag_string($item) != null) {
                            echo tag_string($item); }
                            else {
                            echo 'No tags recorded for this item.';
                            }
                        ?>
                    </div>
                </div>
            </div>
            <div class="row"><hr />
                <!-- Rights -->
                    <div class="large-12 columns">
                        <h4><i class="fa fa-copyright"></i><?php echo __(' Rights'); ?></h4>
                        <?php if ($itemCreator = metadata($item,array('Dublin Core','Rights'))): ?>
                            <?php echo $itemCreator; ?>
                        <?php else: ?>
                            None recorded.
                        <?php endif; ?>
                    </div>
            </div>


             <div class="row"><hr />
                <div class="large-12 columns">

                    <!-- The following prints a citation for this item. -->
                    <h4><i class="fa fa-retweet"></i> <?php echo __('Citation'); ?></h4>
                    <div class="element-text"><?php echo metadata($item,'citation',array('no_escape' => true)); ?></div>
                </div>
            </div>
            <div class="row">
                <div class="large-12 columns">
                    <?php fire_plugin_hook('public_items_show', array('view' => $this, 'item' => $item)); ?>
                </div>
            </div>
        </div>
        <!-- The following returns all of the files associated with an item. -->
        <div id="itemfiles" class="large-6 columns">
            <!-- <h3><?php //echo __('Files'); ?></h3> -->
            <?php if ($text = metadata('item', array('Item Type Metadata', 'Text'))): ?>
                <p><?php echo $text; ?></p>
              </div>
            <?php else: ?>
            <div class="element-text" style="float:right;"><?php echo files_for_item(
                array('imageSize'=>'fullsize','linkToFile'=>true,'linkToMetadata'=>false),//options
                array('class'=>'file-image'),
                null);
        endif; ?></div>
        </div>
    </div>
    <div class="row">
      <div class="large-12 columns paginationrow-bottom">

            <ul class="pagination" role="navigation" aria-label="Pagination">
              <div class="medium-2 columns paginationrow" >
                <li style="float: left;" class="pagination-previous"><?php echo link_to_previous_item_show(); ?></li>
              </div>
                <div class="medium-2 columns paginationrow">
                <li style="float:right;" id="pagination-next"><?php echo link_to_next_item_show(); ?></li>
              </div>
            </ul>
      </div>
      </div>
</div>
</div>
<!-- end primary -->

<?php echo foot(); ?>

Hmmm, there’s nothing really obvious here, but the problem maybe just didn’t copy-paste over properly.

The line 91 that’s in the error message is in the middle of this section:

                <!-- Identifier -->
                <!-- <div class="large-4 columns">
                    <h4><i class="fa fa-bookmark"></i><?php echo __(' Identifier'); ?></h4>
                    <?php //if ($itemCreator = metadata($item,array('Dublin Core','Identifier'))): ?>
                        <?php //echo $itemCreator; ?>
                    <?php// else: ?>
                        None recorded.
                    <?php //endif; ?>
                </div> -->

You have this part commented out anyway so even though it’s running it’s not showing on the page, so the simplest option is probably just to delete all those lines, the 9 lines I excerpted above.

Thanks John! I appreciate the help.

You’re welcome, Mills. Looks like the problem is fixed now.