Bug 41071 - Registers not correctly populated / selected when changing branches
Summary: Registers not correctly populated / selected when changing branches
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Nick Clemens (kidclamp)
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 38664
Blocks:
  Show dependency treegraph
 
Reported: 2025-10-22 13:46 UTC by Nick Clemens (kidclamp)
Modified: 2025-10-24 13:59 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 41071: Fix missing space in cash register classes (2.54 KB, patch)
2025-10-22 13:51 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 41071: Fix missing space in cash register classes (2.59 KB, patch)
2025-10-22 13:54 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 41071: Fix missing space in cash register classes (2.66 KB, patch)
2025-10-23 08:49 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-10-22 13:46:54 UTC
To recreate:
1 - Enable UseCashRegisters system preference
2 - Create three registers for three different branches
3 - Make each register the default
4 - Click on username in top right
5 - Select 'Set library and cash register'
6 - Choose on of the three branches
7 - Note the dropdown does not populate with the default
8 - Note no registers can be selected
Comment 1 Nick Clemens (kidclamp) 2025-10-22 13:51:20 UTC
Created attachment 188296 [details] [review]
Bug 41071: Fix missing space in cash register classes

It seems we dropped a space somewhere so the class for default registers had become:
   "{Branchcode}default" instead of "{Branchcode} default"
This broke the JS for selecting

To test:
1 - Enable UseCashRegisters system preference
2 - Create three registers for three different branches
3 - Make each register the default
4 - Click on username in top right
5 - Select 'Set library and cash register'
6 - Choose on of the three branches
7 - Note the dropdown does not populate with the default
8 - Note no registers can be selected
9 - Apply patch
10 - Reload the page
11 - Change libraries and verify all works as expected

Current status: Needs Signoff
Comment 2 Nick Clemens (kidclamp) 2025-10-22 13:52:42 UTC
This is tricky - tidy removes the spaces, I had to commit the patch with --no-verify
Comment 3 Nick Clemens (kidclamp) 2025-10-22 13:54:52 UTC
Created attachment 188297 [details] [review]
Bug 41071: Fix missing space in cash register classes

It seems we dropped a space somewhere so the class for default registers had become:
   "{Branchcode}default" instead of "{Branchcode} default"
This broke the JS for selecting

To test:
1 - Enable UseCashRegisters system preference
2 - Create three registers for three different branches
3 - Make each register the default
4 - Click on username in top right
5 - Select 'Set library and cash register'
6 - Choose on of the three branches
7 - Note the dropdown does not populate with the default
8 - Note no registers can be selected
9 - Apply patch
10 - Reload the page
11 - Change libraries and verify all works as expected
Comment 4 Nick Clemens (kidclamp) 2025-10-22 13:55:27 UTC
I changed to adding the space in TT, it's kind of ugly, but maybe better? Moving to QA as trivial and to get attention
Comment 5 Jonathan Druart 2025-10-23 08:47:47 UTC
(In reply to Nick Clemens (kidclamp) from comment #4)
> I changed to adding the space in TT, it's kind of ugly, but maybe better?
> Moving to QA as trivial and to get attention

This is the correct way to force a space now.
Comment 6 Jonathan Druart 2025-10-23 08:49:33 UTC
There is one thing: if you go to the form and there is a default, it's not selected automatically. I guess it is not regression from bug 38664 and it was an existing bug.
Comment 7 Jonathan Druart 2025-10-23 08:49:51 UTC
Created attachment 188308 [details] [review]
Bug 41071: Fix missing space in cash register classes

It seems we dropped a space somewhere so the class for default registers had become:
   "{Branchcode}default" instead of "{Branchcode} default"
This broke the JS for selecting

To test:
1 - Enable UseCashRegisters system preference
2 - Create three registers for three different branches
3 - Make each register the default
4 - Click on username in top right
5 - Select 'Set library and cash register'
6 - Choose on of the three branches
7 - Note the dropdown does not populate with the default
8 - Note no registers can be selected
9 - Apply patch
10 - Reload the page
11 - Change libraries and verify all works as expected

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Lucas Gass (lukeg) 2025-10-24 13:59:15 UTC
Nice work everyone!

Pushed to main for 25.11