https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594

--- Comment #4 from babar junaid <[email protected]> ---
Created attachment 210878
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210878&action=edit
Bug 34594: Ignore OpacHiddenItems fields that are not items columns

Bug 34594: Ignore OpacHiddenItems fields that are not items columns

A field name in OpacHiddenItems that is not an items column (a typo such
as "locaton:" or "damage:") made Koha::Item->hidden_in_opac die with
"The method Koha::Item->locaton is not covered by tests!", so the OPAC
detail page of every record with items was an error page, and made
Koha::Items->filter_by_visible_in_opac send "me.locaton" to the database,
so OPAC searches failed with "Unknown column".

Both now skip such a field and write a warning to the log naming it; the
other rules still apply. Validating the preference when it is saved, as
discussed on this bug, would still be welcome and can build on this.

Test plan:
1. Set OpacHiddenItems to:
     locaton: [STAFF]
2. Open any record with items in the OPAC: error page. Search the OPAC:
   the search fails.
3. Apply the patch, restart Plack.
4. Repeat 2: both work; the log has
   "OpacHiddenItems: 'locaton' is not an items column, ignoring it".
5. Set OpacHiddenItems to
     locaton: [STAFF]
     itype: [BK]
   and check BK items are still hidden in the OPAC.
6. prove t/db_dependent/Koha/Item.t t/db_dependent/Koha/Items.t

Sponsored-by: Koha Solutions

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to