[Bug 42697] New: Home library and current library filters can filter incorrectly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Bug ID: 42697 Summary: Home library and current library filters can filter incorrectly Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com To recreate: 1. Create two branches in Koha a. Bearville ( code: BEA ) b. Beachville ( code: BCH ) 2. Find a record and create some items for the BCH branch 3. Now on the record detail page, click Show filters 4. Filter by the Bearville branch ( which should have no items ) for Current library or Home library 5. Notice it filters out everything except the Beachville items -- 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=42697 Kristi Krueger <kkrueger@cuyahogalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kkrueger@cuyahogalibrary.or | |g -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=42697 --- Comment #1 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 200029 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200029&action=edit Bug 42697: Fix mapping in coded_values To test: 1. Create two branches in Koha a. Bearville ( code: BEA ) b. Beachville ( code: BCH ) 2. Find a record and create some items for the BCH branch 3. Now on the record detail page, click Show filters 4. Filter by the Bearville branch ( which should have no items ) for Current library or Home library 5. Notice it filters out everything except the Beachville items 6. APPLY PATCH, restart_all 7. Try filter again for both Home and Holding library. Ensure filter works correctly. 8. Try searching and ordering by both Home and Holding library, ensuring that all works. -- 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=42697 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | -- 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=42697 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Kristi Krueger <kkrueger@cuyahogalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #2 from Kristi Krueger <kkrueger@cuyahogalibrary.org> --- Since I am testing in a sandbox, the patch is already applied, so I could not do step 5. But, since this bug affected our libraries, I am familiar with how the problem presents. I followed the other steps, though, and filtering by Current and Home library is filtering as expected for Bearville (BEA) and Beachville (BCH). Filtering by Bearville for both Current and Home does not show results for Beachville. I will mark this signed off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- No, that's not correct. If you search for "bea" in the global search you do not longer see items from Bearchville. I also expect some Cypress tests to fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- There are also other occurrences of coded_values using "library" that would have needed to be adjusted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- Hum, it's fixed if I revert commit 4fcff9db9eccff65caf5bc53ad3cccb7be070695 Bug 39011: Apply the pre-process to column filters However it is supposed to fix what you, Lucas, have reported on bug 39011 comment 17. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #5)
Hum, it's fixed if I revert commit 4fcff9db9eccff65caf5bc53ad3cccb7be070695 Bug 39011: Apply the pre-process to column filters
However it is supposed to fix what you, Lucas, have reported on bug 39011 comment 17.
I've tried to recreate the problem it is supposed to fix but I don't (if I revert the commit). Can you confirm? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #7 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #6)
(In reply to Jonathan Druart from comment #5)
Hum, it's fixed if I revert commit 4fcff9db9eccff65caf5bc53ad3cccb7be070695 Bug 39011: Apply the pre-process to column filters
However it is supposed to fix what you, Lucas, have reported on bug 39011 comment 17.
I've tried to recreate the problem it is supposed to fix but I don't (if I revert the commit). Can you confirm?
I reverted the commit you mentioned: Bug 39011: Apply the pre-process to column filters It does not fix the problem reported here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200029|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #8 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 200550 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200550&action=edit Bug 42697: Fix mapping in coded_values To test: 1. Create two branches in Koha a. Bearville ( code: BEA ) b. Beachville ( code: BCH ) 2. Find a record and create some items for the BCH branch 3. Now on the record detail page, click Show filters 4. Filter by the Bearville branch ( which should have no items ) for Current library or Home library 5. Notice it filters out everything except the Beachville items 6. APPLY PATCH, restart_all 7. Try filter again for both Home and Holding library. Ensure filter works correctly. 8. Try searching and ordering by both Home and Holding library, ensuring that all works. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #9 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #4)
There are also other occurrences of coded_values using "library" that would have needed to be adjusted.
Do you mean in circ/pendingbookings.tt and members/holdshistory.tt, since we don't "filter" on those pages I don't think we need to update? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #3)
No, that's not correct. If you search for "bea" in the global search you do not longer see items from Bearchville. I also expect some Cypress tests to fail.
I uploaded a new patch that works better with global search. Yes, KohaTable/Holdings_spec.ts is now failing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200550|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200724 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200724&action=edit Bug 42697: Add Cypress tests Patch from commit 1d0eb85 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #12 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200725 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200725&action=edit Bug 42697: Revert "Bug 39011: Apply the pre-process to column filters" This reverts commit 4fcff9db9eccff65caf5bc53ad3cccb7be070695. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #13 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #10)
(In reply to Jonathan Druart from comment #3)
No, that's not correct. If you search for "bea" in the global search you do not longer see items from Bearchville. I also expect some Cypress tests to fail.
I uploaded a new patch that works better with global search.
Yes, KohaTable/Holdings_spec.ts is now failing.
I am pretty sure that the bug is in datatables.js. Please have a look at the revert patch I've just attached, apply it and make sure the new js file is fetched by the browser (use a private window). For me it does fix the problem :) However I think I understood the problem from bug 39011 comment 17 (that this commit was trying to fix). And I think the correct fix is to have a dropdown list for all the columns linked with coded values (what you suggested on bug 39011 comment 17!) I would like to highlight bug 39011 comment 19: ``` I have not tested it a lot, I am a bit hesitant to change the core of our datatable code without providing Cypress tests. But unfortunately I don't have time right now to provide them. ``` This is from me... Time should not be a reason to not provide tests. Any changes to datatables.js MUST be covered by tests ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |david@davidnind.com --- Comment #14 from David Nind <david@davidnind.com> --- With Jonathan's patches, things work as expected (I reproduced the problem using the steps in the bug description). However: 1. There are qa script errors.[1] 2. The tests don't pass.[2] [1] qa script errors ==================== qa Tag v25.05.00-1 found in /kohadevbox/koha — checking out branch main in /kohadevbox/qa-test-tools Already on 'main' Your branch is up to date with 'origin/main'. testing 2 commit(s) (applied to 51bdab1 'ee Bug 42078: Allow vendor ID searche') Processing files [RUNNING] koha-tmpl/intranet-tmpl/prog/js/datatables.js [RUNNING] t/cypress/integration/KohaTable/Holdings_spec.ts [FAIL] t/cypress/integration/KohaTable/Holdings_spec.ts [PASS] koha-tmpl/intranet-tmpl/prog/js/datatables.js Result: [PASS] koha-tmpl/intranet-tmpl/prog/js/datatables.js [FAIL] t/cypress/integration/KohaTable/Holdings_spec.ts FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl t/cypress/integration/KohaTable/Holdings_spec.ts` Processing additional checks PASS! * Was this bug sponsored by anyone? [2] Test failures ================= cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts It looks like this is your first time using Cypress: 12.17.4 ✔ Verified Cypress! /var/lib/koha/kohadev/.cache/Cypress/12.17.4/Cypress Opening Cypress... DevTools listening on ws://127.0.0.1:45693/devtools/browser/73074415-5af0-487e-b74a-a16d9fbee77d [5178:0620/200635.676563:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported. Missing baseUrl in compilerOptions. tsconfig-paths will be skipped ================================================================================ (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 12.17.4 │ │ Browser: Electron 106 (headless) │ │ Node Version: v20.20.2 (/usr/bin/node) │ │ Specs: 1 found (Holdings_spec.ts) │ │ Searched: t/cypress/integration/KohaTable/Holdings_spec.ts │ │ Experiments: experimentalStudio=true │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: Holdings_spec.ts (1 of 1) catalogue/detail/holdings_table with items ✓ Correctly init the table (7012ms) ✓ Show filters (11636ms) ✓ Filters by code and description (25237ms) Error: Duplicate ID at /kohadevbox/koha/t/cypress/plugins/dist/api-client.cjs.js:308:55 at processTicksAndRejections (node:internal/process/task_queues:95:5) 1) Filters by code and description - BEA/Bearville vs BCH/Beachville catalogue/detail/holdings_table without items ✓ Do not display the table (2579ms) 4 passing (53s) 1 failing 1) catalogue/detail/holdings_table with items Filters by code and description - BEA/Bearville vs BCH/Beachville: CypressError: `cy.task('insertObject')` failed with the following error:
Error: Duplicate ID
https://on.cypress.io/api/task at <unknown> (http://koha:8081/__cypress/runner/cypress_runner.js:134597:70) at tryCatcher (http://koha:8081/__cypress/runner/cypress_runner.js:1807:23) at Promise._settlePromiseFromHandler (http://koha:8081/__cypress/runner/cypress_runner.js:1519:31) at Promise._settlePromise (http://koha:8081/__cypress/runner/cypress_runner.js:1576:18) at Promise._settlePromise0 (http://koha:8081/__cypress/runner/cypress_runner.js:1621:10) at Promise._settlePromises (http://koha:8081/__cypress/runner/cypress_runner.js:1697:18) at _drainQueueStep (http://koha:8081/__cypress/runner/cypress_runner.js:2407:12) at _drainQueue (http://koha:8081/__cypress/runner/cypress_runner.js:2400:9) at Async._drainQueues (http://koha:8081/__cypress/runner/cypress_runner.js:2416:5) at Async.drainQueues (http://koha:8081/__cypress/runner/cypress_runner.js:2286:14) From Your Spec Code: at Context.eval (webpack://koha/./t/cypress/integration/KohaTable/Holdings_spec.ts:294:22) From Node.js Internals: Error: Error: Duplicate ID at HttpClient.<anonymous> (/kohadevbox/koha/t/cypress/plugins/dist/api-client.cjs.js:324:50) at step (/kohadevbox/koha/t/cypress/plugins/dist/api-client.cjs.js:191:23) at Object.<anonymous> (/kohadevbox/koha/t/cypress/plugins/dist/api-client.cjs.js:132:20) at asyncGeneratorStep (/kohadevbox/koha/t/cypress/plugins/dist/api-client.cjs.js:11:28) at _next (/kohadevbox/koha/t/cypress/plugins/dist/api-client.cjs.js:29:17) at processTicksAndRejections (node:internal/process/task_queues:95:5) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 5 │ │ Passing: 4 │ │ Failing: 1 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 1 │ │ Video: true │ │ Duration: 52 seconds │ │ Spec Ran: Holdings_spec.ts │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Screenshots) - /kohadevbox/koha/t/cypress/screenshots/Holdings_spec.ts/cataloguedetailholdings_ (1280x720) table with items -- Filters by code and description - BEABearville vs BCHBeachvi lle (failed).png (Video) - Started compressing: Compressing to 32 CRF - Finished compressing: 3 seconds - Video output: /kohadevbox/koha/t/cypress/videos/Holdings_spec.ts.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✖ Holdings_spec.ts 00:52 5 4 1 - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✖ 1 of 1 failed (100%) 00:52 5 4 1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #15 from Jonathan Druart <jonathan.druart@gmail.com> ---
Error: Duplicate ID
This is certainly because you have the libraries BEA and BCH in the DB. Please delete them before running the tests. It's not ideal but how Cypress tests work (for us). We should not crash if the data already exist, but it's not trivial and not directly related to this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200724|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #16 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200818&action=edit Bug 42697: Add Cypress tests Patch from commit f456b04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200725|0 |1 is obsolete| | Attachment #200818|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #17 from David Nind <david@davidnind.com> --- Created attachment 200819 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200819&action=edit Bug 42697: Revert "Bug 39011: Apply the pre-process to column filters" This reverts commit 4fcff9db9eccff65caf5bc53ad3cccb7be070695. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #18 from David Nind <david@davidnind.com> --- Created attachment 200820 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200820&action=edit Bug 42697: Add Cypress tests Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42697 --- Comment #19 from David Nind <david@davidnind.com> --- (In reply to Jonathan Druart from comment #15)
Error: Duplicate ID
This is certainly because you have the libraries BEA and BCH in the DB. Please delete them before running the tests. It's not ideal but how Cypress tests work (for us). We should not crash if the data already exist, but it's not trivial and not directly related to this patch.
That was indeed the case! Tests now pass. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org