Bug 35817

Summary: Wrong hint on patron's category when batch update patron
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: ToolsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: anneli.osterman, fridolin.somers, julian.maurice, lucas
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.03,23.05.09
Circulation function:
Bug Depends on: 20443    
Bug Blocks:    
Attachments: Bug 35817: Fix hint on patron's category when batch update patron
Bug 35817: Fix hint on patron's category when batch update patron
Bug 35817: Fix hint on patron's category when batch update patron
Bug 35817: Fix hint on patron's category when batch update patron

Description Jonathan Druart 2024-01-16 12:41:56 UTC
When a patron's attribute is limited to a given patron's category, the batch patron modification tool will display a hint "This attribute will be only applied to the patron's category %s". But this is followed by the description of the patron's attribute, not the patron's category.
Comment 1 Jonathan Druart 2024-01-16 12:44:05 UTC
Created attachment 161060 [details] [review]
Bug 35817: Fix hint on patron's category when batch update patron

When a patron's attribute is limited to a given patron's category, the batch patron modification tool will display a hint "This attribute will be only applied to the patron's category %s". But this is followed by the description of the patron's attribute, not the patron's category.

Test plan:
Create a patron's attribute "Color of hair" and select a patron
category (Patron).
Batch edit batch and select "Color of hair"
A hint will be display.
=> Without this patch the hint is "This attribute will be only applied to the patron's category Color of hair"
=> With this patch it will be corrected to "This attribute will be only applied to the patron's category Patron"
Comment 2 PTFS Europe Sandboxes 2024-01-16 13:06:13 UTC
Created attachment 161063 [details] [review]
Bug 35817: Fix hint on patron's category when batch update patron

When a patron's attribute is limited to a given patron's category, the batch patron modification tool will display a hint "This attribute will be only applied to the patron's category %s". But this is followed by the description of the patron's attribute, not the patron's category.

Test plan:
Create a patron's attribute "Color of hair" and select a patron
category (Patron).
Batch edit batch and select "Color of hair"
A hint will be display.
=> Without this patch the hint is "This attribute will be only applied to the patron's category Color of hair"
=> With this patch it will be corrected to "This attribute will be only applied to the patron's category Patron"

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Comment 3 Marcel de Rooy 2024-01-26 08:04:22 UTC
 WARN   tools/modborrowers.pl
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 165, now: 167)
Comment 4 Jonathan Druart 2024-01-26 08:45:24 UTC
Created attachment 161493 [details] [review]
Bug 35817: Fix hint on patron's category when batch update patron

When a patron's attribute is limited to a given patron's category, the batch patron modification tool will display a hint "This attribute will be only applied to the patron's category %s". But this is followed by the description of the patron's attribute, not the patron's category.

Test plan:
Create a patron's attribute "Color of hair" and select a patron
category (Patron).
Batch edit batch and select "Color of hair"
A hint will be display.
=> Without this patch the hint is "This attribute will be only applied to the patron's category Color of hair"
=> With this patch it will be corrected to "This attribute will be only applied to the patron's category Patron"

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Comment 5 Julian Maurice 2024-01-26 10:53:57 UTC
Created attachment 161506 [details] [review]
Bug 35817: Fix hint on patron's category when batch update patron

When a patron's attribute is limited to a given patron's category, the
batch patron modification tool will display a hint "This attribute will
be only applied to the patron's category %s". But this is followed by
the description of the patron's attribute, not the patron's category.

Test plan:
Create a patron's attribute "Color of hair" and select a patron
category (Patron).
Batch edit batch and select "Color of hair"
A hint will be display.
=> Without this patch the hint is "This attribute will be only applied
   to the patron's category Color of hair"
=> With this patch it will be corrected to "This attribute will be only
   applied to the patron's category Patron"

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 6 Katrin Fischer 2024-01-26 14:18:12 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Fridolin Somers 2024-01-31 13:48:11 UTC
This code looks strange to me :

my $category_code = $attr_type->category_code;
...defined $category_code and $attr_type->category_code eq $_->categorycode

The var $category_code is useless right ?
And this map can be skipped if $attr_type->category_code undefined ?
Comment 8 Fridolin Somers 2024-01-31 13:48:47 UTC
Fixes a bug so I backport

Pushed to 23.11.x for 23.11.03
Comment 9 Lucas Gass (lukeg) 2024-02-09 20:23:25 UTC
Backported to 23.05.x for upcoming 23.05.09