Search button not working on item view page

We are using the Centerrow theme. We have noticed that the search button, a magnifying glass icon, does not work when you view an item. It works fine on every other page, but on the page where the Dublin Core fields display, the search icon does not respond. When I mouse over the search icon the cursor turns into a pointing hand so it recognizes the icon as a link of some kind, but nothing happens when I click on the icon.

I’ve looked in Github for Centerrow and do not see anything about this. I also printed out the View page source for pages where the seacrh icon works and where it does not, and the only difference I see is a coupel of extra css pages on the item view page. I looked at those and don’t see anything that might affect the search icon function.

Has anyone see this kind of behavior before? I don’t know where else to look.

Thanks,
Jack

What versions of Omeka Classic and CenterRow are you running? And on which browser(s) are you having this issue?

Hi Mega,

I see the problem using Chome, Edge and Firefox.

Omeka Classic v2.6.1
Centerrow v1.2
Php v7.0.27
Apache v2.4.27

Thanks,
Jack

To be clear, the pages where you’re experiencing this error are item pages like this one - where the url includes item/#. Does it work for you when you view the page I linked?

Yes, an item page like the one at your link. I do get a search field when I click on the magnifying glass icon on that page. I notice this is a basic search (just one field). The search icon on our Omeka brings up a more complex search - choice of keyword, Boolean or exact; and choice of item, file or collection; plus a link for advanced search. Don’t know if that could be making a difference.

Thanks,
Jack

More like this page then? With the advanced site-wide search turned on in the theme configuration.

Do you have an active link we could look at?

http://libarchstor2.uah.edu/omeka-2.6.1/items/show/511

http://libarchstor2.uah.edu/omeka-2.6.1/items/show/453

Ah, I see the problem. Because your site primarily displays PDFs, the lack of the normal image viewer breaks the theme’s javascript. That’s an oversight on our part. I’ll make a fix to the theme, but in the meantime, replace the contents of your /js/items-show.js with the following:

(function($) {
    $(document).ready(function(){
        var itemFilesNav = $("#itemfiles-nav");
        if (itemFilesNav.length > 0) {
            var inContainer = itemFilesNav.Chocolat({
            imageSize: "default",
            loop: true,
            container: "#itemfiles",
            }).data("chocolat");
        
            inContainer.api().open()
            inContainer.api().getElem("overlay").off("click.chocolat");
        } 
    
        $(document).off("keydown.chocolat").on("keydown.chocolat", function(e) {
            if (inContainer.api().get("initialized")) {
                if (e.keyCode == 37) {
                    inContainer.api().prev()
                }
                else if (e.keyCode == 39) {
                    inContainer.api().next()
                }
            }
        });

        $(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange", function() {
            if ((inContainer.api().get("fullscreenOpen")) && ($("#itemfiles").hasClass("chocolat-in-fullscreen") == false)) {
                $("#itemfiles").addClass("chocolat-in-fullscreen");
            } else {
                $("#itemfiles").removeClass("chocolat-in-fullscreen");
            }
        });
    });
})(jQuery)

Thanks! I made the change to the file. It now works using Edge, but not Firefox or Chrome. I will tell the staff to use the Edge browser for now.

Jack

It should be fine across the browsers… Make sure you’ve cleared cache or hard refreshed when testing on Firefox/Chrome.

Note: you’re also having a JS error coming from the Neatline Features plugin… it doesn’t seem to be affecting this specifically but if you’re not using it you might want to uninstall or deactivate it.

You’re right - clearing the cache did it. Thanks!
Jack

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.