[Bug 34594] New: Incorrect table name in OpacHiddenItems causes searches to fail or details not to display
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 Bug ID: 34594 Summary: Incorrect table name in OpacHiddenItems causes searches to fail or details not to display Change sponsored?: --- Product: Koha Version: 22.11 Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: wizzyrea@gmail.com QA Contact: testopia@bugs.koha-community.org Example case: Library put damage: [1,2] and searches failed with the following error: [2023/08/22 14:19:05] [WARN] No method count found for Koha::Items DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.damage' in 'where clause' at /usr/share/koha/lib/Koha/Objects.pm line 578 It would be so nice to fix this so that invalid configurations are ignored, or the preference could check upon save to verify the values input are valid. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|22.11 |Main Component|OPAC |System Administration Assignee|oleonard@myacpl.org |koha-bugs@lists.koha-commun | |ity.org CC| |gmcharlt@gmail.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- I have been thinking for a while that having a "validate" step when saving system configurations would be amazing. Think we'd need some UI work to surface the validation failures though. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 --- Comment #2 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 195103 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195103&action=edit Example of message If we could use this to show it, prevent the save? We could do a check with regex(?) if everything left of the : is an item field? Also maybe check the casing and could fix it or warn specifically about that? then we could check that the everything right of the : had [] and there was a , if there were spaces? Ideally, we'd also be able to have it check that the contents were correct/existed in the system? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Yeah, we could put something there about a syspref not saving. We probably wouldn't want to show the details there though. I notice there's a "Message Log" at the bottom though where we could potentially include the details? Looking at the output coming back from /svc/config/systempreferences, it seems like we get a 200 response and an empty JSON object response of {}, so we could leverage that... This could also be a good opportunity to move away from /svc/config/systempreferences and over to the REST API too... although I guess it might be hard to jam it into the REST model we've been using... and we haven't finalised any RPC endpoint structures yet... -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 --- Comment #4 from babar junaid <babarjunaid1122@gmail.com> --- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34594 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org