Comment 2 for bug 1723977

Revision history for this message
Mike Rylander (mrylander) wrote :

Jason,

This comment will just be informational ... I'll be looking at the details of the WHERE clauses you captured soon.

The differences between staff and public queries in the CTE are intentional. Specifically, we don't want the patron (non-staff) defaults to be used in staff searches, which do things like exclude hidden org units and non-opac_visible statuses. The stored proc will only return one row ever, so the simplest possible change to turn a patron search CTE into a staff search CTE (though, perhaps less self-documenting...) is to just avoid including the output of that function in the array we're building.

The WHERE clauses are also intentionally different. The opac clause basically says "you have to have at least one of an luri at an appropriate org, a trancendent[sic] source, or a copy matching the requirements of both the default filters (general visibility) and the user-requested filters (org, copy location, status, etc). The staff filters, on the other hand, have no defaults, and should only filter bibs out of a result set based on the staff user's requested filtering (inclusive filter on org, luri owner, status, etc), OR the lack of either any entries for the record on the asset.copy_vis_attr_cache table (no holdings) or luri orgs.