Bug 39561

Summary: Users with only editcatalogue: fast_cataloging cannot easily add an item if a duplicate is found
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CatalogingAssignee: Nick Clemens (kidclamp) <nick>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: holly, m.de.rooy, phil
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 39561: Allow users with fast_cataloging to continue after duplicate is found
Bug 39561: Allow users with fast_cataloging to continue after duplicate is found

Description Nick Clemens (kidclamp) 2025-04-04 09:10:52 UTC
To recreate:
1 - Create or choose a borrower and grant permissions:
    catalogus
    circulate
    borrowers: list_borrowers
    editcatalogue: fast_cataloguing
2 - Log in as that patron
3 - Search for another borrower and go to checkout screen
4 - Enter random string as barcode to checkout
5 - Item is not found, click to fast catalogue
6 - In the editor type into 245$a 'Perl best practices' - or another title that exists in your system
7 - Get a notice of duplicate with options:
    Yes: View existing items
    No, save as new record
8 - Both options take you to the record details page and you cannot add an item
Comment 1 Nick Clemens (kidclamp) 2025-04-04 09:52:59 UTC
Created attachment 180623 [details] [review]
Bug 39561: Allow users with fast_cataloging to continue after duplicate is found

This patch adds the fast_cataloging permission to those checked when a duplicate is found

Additionally, the barcode was missing from the duplicate check and is now added to be passed forward

To test:
 1 - Create or choose a borrower and grant permissions:
     catalogue
     circulate
     borrowers: list_borrowers
     editcatalogue: fast_cataloguing
 2 - Log in as that patron
 3 - Search for another borrower and go to checkout screen
 4 - Enter random string as barcode to checkout
 5 - Item is not found, click to fast catalogue
 6 - In the editor type into 245$a 'Perl best practices' - or another title that exists in your system
 7 - Get a notice of duplicate with options:
     Yes: View existing items
     No, save as new record
 8 - Clicking 'Yes' will take you to the record details page - you cannot add an item because record is not FA framework
 9 - You can click 'back' to return to the messages
10 - Clicking 'No' will create a new record and take you to the details page - you can add an item (Edit->manage items)
     but barcode has been dropped
11 - Apply patch
12 - Repeate 3-6
13 - You now get options:
     Yes: View existing items (you cannot add items to an existing record)
     No, save as new record
14 - 'Yes' will take you to details view
15 - Click back
16 - 'No' will take you to the edit items screen and populate the barcode
17 - Saving the item should return you to patron and issue item
18 - Repeat again with a staff patron with full permissions and confirm saying 'Yes' completes the fast catalogin workflow as expected
Comment 2 Nick Clemens (kidclamp) 2025-04-04 09:54:16 UTC
This could use another improvement - I am not sure the correct behavior when a duplicate is found but user can only fast catalogue - should they always add a new record? They cannot add items to existing records, so should we just skip the check?
Comment 3 Phil Ringnalda 2025-04-04 21:01:53 UTC
According to me in bug 37702, we shouldn't skip the check, we should check only for duplicate fast add records, since in that case can do something with the knowledge that they were creating a record that looks like a duplicate of another fast add.
Comment 4 Nick Clemens (kidclamp) 2025-04-09 10:35:59 UTC
*** Bug 37702 has been marked as a duplicate of this bug. ***
Comment 5 Nick Clemens (kidclamp) 2025-04-09 10:42:11 UTC
(In reply to Phil Ringnalda from comment #3)
> According to me in bug 37702, we shouldn't skip the check, we should check
> only for duplicate fast add records, since in that case can do something
> with the knowledge that they were creating a record that looks like a
> duplicate of another fast add.

Made 37702 a duplicate here and added 39590 to improve handling of duplicates. This bug should still be able to move forward
Comment 6 Phil Ringnalda 2025-04-11 18:09:41 UTC
Created attachment 180886 [details] [review]
Bug 39561: Allow users with fast_cataloging to continue after duplicate is found

This patch adds the fast_cataloging permission to those checked when a duplicate is found

Additionally, the barcode was missing from the duplicate check and is now added to be passed forward

To test:
 1 - Create or choose a borrower and grant permissions:
     catalogue
     circulate
     borrowers: list_borrowers
     editcatalogue: fast_cataloguing
 2 - Log in as that patron
 3 - Search for another borrower and go to checkout screen
 4 - Enter random string as barcode to checkout
 5 - Item is not found, click to fast catalogue
 6 - In the editor type into 245$a 'Perl best practices' - or another title that exists in your system
 7 - Get a notice of duplicate with options:
     Yes: View existing items
     No, save as new record
 8 - Clicking 'Yes' will take you to the record details page - you cannot add an item because record is not FA framework
 9 - You can click 'back' to return to the messages
10 - Clicking 'No' will create a new record and take you to the details page - you can add an item (Edit->manage items)
     but barcode has been dropped
11 - Apply patch
12 - Repeate 3-6
13 - You now get options:
     Yes: View existing items (you cannot add items to an existing record)
     No, save as new record
14 - 'Yes' will take you to details view
15 - Click back
16 - 'No' will take you to the edit items screen and populate the barcode
17 - Saving the item should return you to patron and issue item
18 - Repeat again with a staff patron with full permissions and confirm saying 'Yes' completes the fast catalogin workflow as expected

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>