collectiveaccess / pawtucket2

Pawtucket Improved
GNU General Public License v3.0
85 stars 76 forks source link

Collection facet not showing top level #94

Closed Monica-Wood closed 9 months ago

Monica-Wood commented 9 months ago

I have a dev system with both providence and pawtucket on the newest dev/php8 (pulled today).

It's set up with the ca_objects_x_collections_hierarchy_enabled.

The following facet is set in both providence and pawtucket under ca_objects

    collection_facet = {
            type = authority,
            table = ca_collections,
            relationship_table = ca_objects_x_collections,
            restrict_to_types = [],
            restrict_to_relationship_types = [],

            group_mode = alphabetical,

            label_singular = _("collection"),
            label_plural = _("collections")
        },

In providence it shows all levels of the hierarchy (collection, series etc) even if it's not the direct parent, and if I restrict_to_types = [collection] then it will only show the top level... this is what I am after.

but in Pawtucket, it will only show the immediate collection related to the object and if I was the restrict to collection type, then only top level collections directly related to the object will show.

Is there something in indexing causing this, or have I found a bug?

Thank you. Monica

collectiveaccess commented 9 months ago

I'd make sure you don't have the dontExpandTypesHierarchically option set. That would cause the behavior you're seeing.

I just tried your facet configuration on a working site with a deep collection hierarchy and archival items (and dontExpandTypesHierarchically for the facet not set), and it's showing top level collections when restricted.

Monica-Wood commented 9 months ago

I have the facet set up exactly as you see here. When I was playing to try and get it working I had tried the group_mode = hierarchical. And I had the dontExpandTypesHierarchically set for a bit to see what it would do, But I didn't want the hierarchy selector so removed it again. I'll try clearing caches again in case, but thought I had browse cache set to 0.

EDIT: I have cleared caches and checked configuration. dontExpandTypesHierarchically is commented out in the browseType: ca_objects block.

I do have it enabled in the browseType: ca_collections block, but tested with this commented out too and nothing changed. (after clearing caches, but cache_timeout is set to 0). I am unsure what to do now.

@collectiveaccess: Next update: I changed the install to use the default theme and added the collection facet above to this. It still does the same thing, only shows the immediate parent collection, not the top level (unless the top level is the immediate parent). Can you confirm this is working for you on the current commit please?