[Bug 44010] New: Improve enforcement of record locking
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Bug ID: 44010 Summary: Improve enforcement of record locking Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: jacob.omara@openfifth.co.uk Reporter: jacob.omara@openfifth.co.uk QA Contact: andrew@bywatersolutions.com CC: m.de.rooy@rijksmuseum.nl Depends on: 42625 Target Milestone: --- Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42625 [Bug 42625] Allow records to be locked for editing based on library & group -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44011 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44011 [Bug 44011] Add ability to change record source via MARC mod template -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #1 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210637 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210637&action=edit Bug 44010: Skip locked records in batch record modification -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #2 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210638 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210638&action=edit Bug 44010: Add tests for batch update lock permissions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #3 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210639 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210639&action=edit Bug 44010: Skip locked records when committing an import batch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #4 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210640 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210640&action=edit Bug 44010: Add tests for locked records in BatchCommitRecords -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #5 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210641 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210641&action=edit Bug 44010: (QA follow-up) Disable locked record actions in Edit menu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #6 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210642 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210642&action=edit Bug 44010: (QA follow-up) Add tests for locked record Edit menu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #7 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210643 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210643&action=edit Bug 44010: (QA follow-up) Import items onto locked records -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #8 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210644 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210644&action=edit Bug 44010: (QA follow-up) Add items to locked records in batch update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #9 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210645 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210645&action=edit Bug 44010: (QA follow-up) Update MARCImportCommitBatch.t for num_locked -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Jacob O'Mara <jacob.omara@openfifth.co.uk> 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=44010 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement extends release notes| |and refines the locking of | |bibliographic records. | |Locked biblio records can | |no longer be edited via | |batch modification or | |record import and overlay. | |New items can be created on | |locked biblios via either | |batch record modification | |or record import and | |overlay. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement extends |This enhancement extends release notes|and refines the locking of |and refines the locking of |bibliographic records. |bibliographic records. |Locked biblio records can |Locked biblio records can |no longer be edited via |no longer be edited via |batch modification or |batch modification or |record import and overlay. |record import and overlay. |New items can be created on |New items can be created on |locked biblios via either |locked biblios via either |batch record modification |batch record modification |or record import and |or record import and |overlay. |overlay. | | | |When a user with | |records_batchmod permission | |but without | |edit_locked_records | |permission performs a batch | |modification on a group of | |records containing one or | |more locked records, the | |locked records that were | |not modified are noted in | |the background job details. --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Test plan: 1. Create a record source that locks records for editing 2. Update a biblio to the source you created (via API or database update) 3. Log in as a user without edit_locked_records permission 4. Confirm edit actions are disabled when viewing your locked record 5. Attempt a batch modification including the locked record, confirm the record is not modified 6. Attempt a batch modification of the locked record using a template that creates items via 952 fields, confirm items are created but the biblio is not edited 7. Attempt to edit your locked record via record import and overlay, confirm it is blocked 8.Attempt to add items to your record via record import and overlay with 952 fields. Confirm items are created but the biblio is not updated 9. Log in as a user with edit_locked_records permission 10. Confirm edit actions are not disabled, record can be edited solo, in batch mod, and via import and overlay -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Comma delimited| |CLAMS list of Sponsors| | Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210637|0 |1 is obsolete| | Attachment #210638|0 |1 is obsolete| | Attachment #210639|0 |1 is obsolete| | Attachment #210640|0 |1 is obsolete| | Attachment #210641|0 |1 is obsolete| | Attachment #210642|0 |1 is obsolete| | Attachment #210643|0 |1 is obsolete| | Attachment #210644|0 |1 is obsolete| | Attachment #210645|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=44010 --- Comment #11 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210699 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210699&action=edit Bug 44010: Skip locked records in batch record modification Test plan: 1. Apply all patches and restart Plack 2. Administration > Record sources > New record source. Enter a name, leave "Can be edited" unchecked and save. Assign it to a bibliographic record, e.g. in koha-mysql: UPDATE biblio_metadata SET record_source_id = <id> WHERE biblionumber = <biblionumber> 3. Cataloging > MARC modification templates. Create template A with one action that adds a 500$a. Create template B with actions that add 952$a and 952$b (a branchcode) and 952$y (an item type) 4. Log in as a cataloguer with edit_catalogue, edit_items, records_batchmod, stage_marc_import and manage_staged_marc but not edit_locked_records 5. On the record, Edit > "Edit record", "Modify record using template", "Replace record via Z39.50/SRU" and "Delete record" are disabled with the tooltip "This record is locked". New > "New item" still opens the item editor 6. Cataloging > Batch record modification > "Enter a list of record numbers". Enter the biblionumber, pick template A, continue and modify. The job reports "has not been modified. Its record source is locked and you do not have permission to edit it". The record has no new 500 7. Repeat step 6 with template B. The job reports "Items were added to bibliographic record ..., but the record itself has not been modified". The record has one new item 8. Export the record as MARC. Change the 245$a and add a 952 with $a, $b, $y and an unused barcode in $p. Cataloging > Stage records for import. Upload the file, pick a matching rule that matches the record (e.g. on 999$c), stage, then import the batch with "Replace existing record" for matches 9. The import report shows "Number of records not overlaid because their record source is locked: 1". The record keeps its title and has the new item 10. Log in as a user with edit_locked_records and repeat steps 5 to 7. "Edit record", "Modify record using template" and "Replace record via Z39.50/SRU" are enabled ("Delete record" stays disabled while the record has items) and the batch job modifies the record 11. Run: prove t/db_dependent/ImportBatch.t t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblio.t 12. Run: yarn cypress run --spec t/cypress/integration/LockedRecordToolbar_spec.ts Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #12 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210700 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210700&action=edit Bug 44010: Add tests for batch update lock permissions Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #13 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210701 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210701&action=edit Bug 44010: Skip locked records when committing an import batch Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #14 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210702&action=edit Bug 44010: Add tests for locked records in BatchCommitRecords Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #15 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210703 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210703&action=edit Bug 44010: (QA follow-up) Disable locked record actions in Edit menu Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #16 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210704 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210704&action=edit Bug 44010: (QA follow-up) Add tests for locked record Edit menu Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #17 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210705 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210705&action=edit Bug 44010: (QA follow-up) Import items onto locked records Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #18 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210706 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210706&action=edit Bug 44010: (QA follow-up) Add items to locked records in batch update Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #19 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210707 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210707&action=edit Bug 44010: (QA follow-up) Update MARCImportCommitBatch.t for num_locked BatchCommitRecords now returns a seventh value, the number of records skipped because they are locked. The mocked return values in MARCImportCommitBatch.t only supplied six, so $num_locked was undef and the job raised 'uninitialized value' warnings, failing Test::NoWarnings. This patch adds the seventh value to the existing mocks and adds a case covering a batch where some records are skipped as locked. Test plan: 1. prove t/db_dependent/Koha/BackgroundJob/MARCImportCommitBatch.t 2. All tests pass, with no warnings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_26_11_candidate Target Milestone|--- |26.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Miranda Nero <mnero@oslri.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mnero@oslri.net -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #20 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k --- Comment #21 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi all, a few non-blocker nits up for follow-ups when convenient, if you agree: #1 No tests for adding items to locked records Two QA follow-ups make Koha still add new items to a locked record during import and batch modification. No test checks this, so it could break without any test failing. #2 Outdated documentation BatchCommitRecords now returns 7 values, but its POD still lists 6. 1) In C4/ImportBatch.pm, compare the POD above 'sub BatchCommitRecords' (6 values) with its 'return' (7 values) #3 Same lock check written three times The "is this record locked for this user?" check is copied in the import code, the batch modification job and the 'Edit' menu. If one copy changes and the others don't, they'll disagree. 1) git grep -n 'source_allows_editing' -- C4 Koha koha-tmpl 2) Note the same check in C4/ImportBatch.pm, Koha/BackgroundJob/BatchUpdateBiblio.pm and cat-toolbar.inc Potential candidate for DRY. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement extends |Locked bibliographic release notes|and refines the locking of |records are now skipped by |bibliographic records. |batch record modification |Locked biblio records can |and by record import and |no longer be edited via |overlay, unless the user |batch modification or |has `editcatalogue > |record import and overlay. |edit_locked_records`. New |New items can be created on |items can still be added to |locked biblios via either |locked records through both |batch record modification |tools, and skipped records |or record import and |are reported in the job |overlay. |details or import report. | | |When a user with |**Upgrade notes** |records_batchmod permission |- Existing sites: batch |but without |modifications and import |edit_locked_records |overlays that used to |permission performs a batch |change locked records now |modification on a group of |skip them, unless the user |records containing one or |has `editcatalogue > |more locked records, the |edit_locked_records`. |locked records that were | |not modified are noted in | |the background job details. | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|Locked bibliographic |This enhancement extends release notes|records are now skipped by |and refines the locking of |batch record modification |bibliographic records. |and by record import and |Locked biblio records can |overlay, unless the user |no longer be edited via |has `editcatalogue > |batch modification or |edit_locked_records`. New |record import and overlay. |items can still be added to |New items can be created on |locked records through both |locked biblios via either |tools, and skipped records |batch record modification |are reported in the job |or record import and |details or import report. |overlay. | | |**Upgrade notes** |When a user with |- Existing sites: batch |records_batchmod permission |modifications and import |but without |overlays that used to |edit_locked_records |change locked records now |permission performs a batch |skip them, unless the user |modification on a group of |has `editcatalogue > |records containing one or |edit_locked_records`. |more locked records, the | |locked records that were | |not modified are noted in | |the background job details. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 --- Comment #22 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Hello, On 18 November I ran a bulk update of the "Text to go in release notes" field on bugs in the 26.11 range, to fill in missing notes using a consistent template. A mistake in that run also overwrote the release note you had written on this bug. That was not intended, and I am sorry for the noise. I have restored your original text from the bug history, so the field is exactly as you wrote it. Nothing else on this bug was changed. Thank you for writing the note. Martin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44010 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |lucas@bywatersolutions.com --- Comment #23 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement, no 26.05.x backport. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org