https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35052 --- Comment #21 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 205613 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205613&action=edit Bug 35052: Pass the searching patron into build_query_compat for OpacHiddenItemsExceptions Adds patron => $patron to both existing build_query_compat call sites in opac/opac-search.pl, using the $patron variable already in scope (set at line 132, before either call). This is what QueryBuilder::_resolve_opac_hidden_items_rules (added earlier in this series) needs to check OpacHiddenItemsExceptions against the searching patron's category. For an anonymous OPAC session $patron is undef (Koha::Patrons->find(undef) returns undef without querying - see Koha::Objects::find), which is handled safely: _resolve_opac_hidden_items_rules only dereferences $patron inside an "if ($patron && ...)" check, so anonymous sessions correctly fall through to having the hidden-items filter applied, never exempted. No automated test - opac-search.pl is a CGI script, not a module. Full verification is the end-to-end test (next commit) plus the KTD manual test plan documented there. Test plan: 1) perl -c opac/opac-search.pl 2) Reports "opac/opac-search.pl syntax OK" -- You are receiving this mail because: You are watching all bug changes.