Bug 39038 - CollapseFieldsPatronAddForm - Collapsing "Non-patron guarantor" section also collapses the "Patron guarantor" section
Summary: CollapseFieldsPatronAddForm - Collapsing "Non-patron guarantor" section also ...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-05 13:06 UTC by Nick Clemens (kidclamp)
Modified: 2025-02-21 15:44 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the add patron form when using the CollapseFieldsPatronAddForm system preference to collapse sections of the form. If the "Non-patron guarantor" option was selected it was also collapsing the "Patron guarantor" section.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39038: Grep for exacpt matches for collapsed fields (6.71 KB, patch)
2025-02-05 13:10 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39038: Grep for exact matches for collapsed fields (6.81 KB, patch)
2025-02-05 20:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 39038: Grep for exact matches for collapsed fields (6.62 KB, patch)
2025-02-14 14:41 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39038: Grep for exact matches for collapsed fields (6.71 KB, patch)
2025-02-21 07:53 UTC, Marcel de Rooy
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-02-05 13:06:38 UTC

    
Comment 1 Nick Clemens (kidclamp) 2025-02-05 13:07:54 UTC
When selecting 'Non-patron guarantor' in CollapsedFieldsPatronAddForm the guarantor form is collapsed too. This is because we are doing a grep for the string and one contains the other
Comment 2 Nick Clemens (kidclamp) 2025-02-05 13:10:52 UTC
Created attachment 177532 [details] [review]
Bug 39038: Grep for exacpt matches for collapsed fields

This patch splits the preference into a list in TT and then uses
grep to find exact matches for each field

To test:
1 - Edit CollapsedFieldsPatronAddForm preference and check Non-patron guarantor
    and a few otehr fields, not Guarantor though
2 - Go to add a patron that can have a guarantor
3 - Note bot h guarantor fields are collapsed
4 - Apply patch, reload
5 - Note only expected fields are collapsed
6 - Confirm other fields continue to work as expected
Comment 3 David Nind 2025-02-05 20:14:37 UTC
Created attachment 177554 [details] [review]
Bug 39038: Grep for exact matches for collapsed fields

This patch splits the CollapseFieldsPatronAddForm system preference
into a list in the template and then uses grep to find exact matches
for each field.

Test plan:
1. Edit CollapseFieldsPatronAddForm system preference and
   check the Non-patron guarantor and a few other fields, but
   not Guarantor.
2. Go to add a patron that can have a guarantor.
3. Note both guarantor fields are collapsed.
4. Apply patch, reload/
5. Note only expected fields are collapsed.
6. Confirm other fields continue to work as expected.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-02-05 20:23:53 UTC
I edited the commit message to use the correct system preference name, and fixed some spelling mistakes 8-)

I've also created bug 39047. If you select the "Patron messaging preferences" option for the CollapseFieldsPatronAddForm system preference, when adding or editing patrons the collapsed section displays a progress spinner and "Loading new messaging defaults". (This is not related to this bug, as it did this before this patch.)
Comment 5 Nick Clemens (kidclamp) 2025-02-14 14:41:57 UTC
Created attachment 178097 [details] [review]
Bug 39038: Grep for exact matches for collapsed fields

This patch splits the CollapseFieldsPatronAddForm system preference
into a list in the template and then uses grep to find exact matches
for each field.

Test plan:
1. Edit CollapseFieldsPatronAddForm system preference and
   check the Non-patron guarantor and a few other fields, but
   not Guarantor.
2. Go to add a patron that can have a guarantor.
3. Note both guarantor fields are collapsed.
4. Apply patch, reload/
5. Note only expected fields are collapsed.
6. Confirm other fields continue to work as expected.

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Marcel de Rooy 2025-02-21 07:53:58 UTC
Created attachment 178446 [details] [review]
Bug 39038: Grep for exact matches for collapsed fields

This patch splits the CollapseFieldsPatronAddForm system preference
into a list in the template and then uses grep to find exact matches
for each field.

Test plan:
1. Edit CollapseFieldsPatronAddForm system preference and
   check the Non-patron guarantor and a few other fields, but
   not Guarantor.
2. Go to add a patron that can have a guarantor.
3. Note both guarantor fields are collapsed.
4. Apply patch, reload/
5. Note only expected fields are collapsed.
6. Confirm other fields continue to work as expected.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Katrin Fischer 2025-02-21 15:44:58 UTC
Pushed for 25.05!

Well done everyone, thank you!