Bug 38211 - New bibliographic record in non-default framework opens in default on first edit
Summary: New bibliographic record in non-default framework opens in default on first edit
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical
Assignee: Jonathan Druart
QA Contact: Emily Lamancusa (emlam)
URL:
Keywords:
Depends on: 37947 38076
Blocks:
  Show dependency treegraph
 
Reported: 2024-10-18 19:41 UTC by Phil Ringnalda
Modified: 2024-10-25 13:58 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.05
Circulation function:


Attachments
Bug 38211: frameworkcode must be set before read (1.79 KB, patch)
2024-10-21 09:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38211: frameworkcode must be set before read (1.84 KB, patch)
2024-10-21 13:15 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 38211: frameworkcode must be set before read (1.92 KB, patch)
2024-10-21 14:37 UTC, Emily Lamancusa (emlam)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Ringnalda 2024-10-18 19:41:56 UTC
Seems unlikely, but it does.

Prior to the patch from bug 37947, there was the unnoticed bug 38168 - if you created a biblio in the framework SR and then edited it again, the Settings menu would say you were in the Audio Cassettes, CDs framework, but the fields and tags would say you were in Default (easy check in MARC21 is that 001 and 003 are hidden in frameworks other than Default, so if you see them in the editor you are in Default). With the patch from bug 37947, the first time you edit a newly-created record, the editor opens in Default and the Settings menu says it is in Default, then every time after that the editor opens in the correct framework and the Settings menu agrees.

Steps to reproduce:
1. Cataloging - New record -> Audio Cassettes, CDs
2. Fill in the required fields and save
3. Switch to 'Normal', Edit - Edit record
4. Note that 001 and 003 are visible, and the Settings menu has a checkmark by Default
5. Click the browser Back button, then Edit - Edit record
6. Note that 001 and 003 are not visible, and the Settings menu has a checkmark by Audio Cassettes, CDs
Comment 1 Phil Ringnalda 2024-10-18 19:50:27 UTC
Actually, let's call that major.

Since I was looking for it and looking for the once-only thing, I wasn't saving the record on the first opening of the editor, but in general it's not obvious that you've opened a record in a framework other than the one it should have, so you'll just save it, moving it from the framework it had into the Default framework, which can be a cause of dataloss depending on your frameworks.
Comment 2 Jonathan Druart 2024-10-21 09:55:38 UTC
Created attachment 173019 [details] [review]
Bug 38211: frameworkcode must be set before read

It's a stupid global variable, we MUST have this init line BEFORE we
read it!

Test plan:
See the other bugs linked with this one, confirm the test plan for all
of them still pass.

Test plan for this specific bug report:
1. Cataloging - New record -> Audio Cassettes, CDs
2. Fill in the required fields and save
3. Switch to 'Normal', Edit - Edit record
4. Note that 001 and 003 are not visible, and the Settings menu has a checkmark by Audio Cassettes, CDs
5. Click the browser Back button, then Edit - Edit record
6. Note that 001 and 003 are not visible, and the Settings menu has a checkmark by Audio Cassettes, CDs
Comment 3 Brendan Lawlor 2024-10-21 13:15:17 UTC
Created attachment 173048 [details] [review]
Bug 38211: frameworkcode must be set before read

It's a stupid global variable, we MUST have this init line BEFORE we
read it!

Test plan:
See the other bugs linked with this one, confirm the test plan for all
of them still pass.

Test plan for this specific bug report:
1. Cataloging - New record -> Audio Cassettes, CDs
2. Fill in the required fields and save
3. Switch to 'Normal', Edit - Edit record
4. Note that 001 and 003 are not visible, and the Settings menu has a checkmark by Audio Cassettes, CDs
5. Click the browser Back button, then Edit - Edit record
6. Note that 001 and 003 are not visible, and the Settings menu has a checkmark by Audio Cassettes, CDs

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 4 Emily Lamancusa (emlam) 2024-10-21 14:37:21 UTC
Created attachment 173053 [details] [review]
Bug 38211: frameworkcode must be set before read

It's a stupid global variable, we MUST have this init line BEFORE we
read it!

Test plan:
See the other bugs linked with this one, confirm the test plan for all
of them still pass.

Test plan for this specific bug report:
1. Cataloging - New record -> Audio Cassettes, CDs
2. Fill in the required fields and save
3. Switch to 'Normal', Edit - Edit record
4. Note that 001 and 003 are not visible, and the Settings menu has a checkmark by Audio Cassettes, CDs
5. Click the browser Back button, then Edit - Edit record
6. Note that 001 and 003 are not visible, and the Settings menu has a checkmark by Audio Cassettes, CDs

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 5 Emily Lamancusa (emlam) 2024-10-21 14:39:02 UTC
Oof...this script and its globals. Thanks, Jonathan! Passing QA (also tidied inline)
Comment 6 Katrin Fischer 2024-10-22 09:30:24 UTC
Thanks for the quick work here, Jonathan, Brendan and Emily!
Comment 7 Katrin Fischer 2024-10-22 10:10:13 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 8 Lucas Gass (lukeg) 2024-10-23 22:49:59 UTC
Backported to 24.05.x for upcoming 24.05.05
Comment 9 Fridolin Somers 2024-10-25 13:58:33 UTC
Depends on Bug 37947 and 38076 not in 23.11.x