Bug 35817 - Wrong hint on patron's category when batch update patron
Summary: Wrong hint on patron's category when batch update patron
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 20443
Blocks:
  Show dependency treegraph
 
Reported: 2024-01-16 12:41 UTC by Jonathan Druart
Modified: 2024-02-09 20:23 UTC (History)
4 users (show)

See Also:
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


Attachments
Bug 35817: Fix hint on patron's category when batch update patron (1.59 KB, patch)
2024-01-16 12:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35817: Fix hint on patron's category when batch update patron (1.74 KB, patch)
2024-01-16 13:06 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 35817: Fix hint on patron's category when batch update patron (1.89 KB, patch)
2024-01-26 08:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35817: Fix hint on patron's category when batch update patron (1.95 KB, patch)
2024-01-26 10:53 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 2024-02-09 20:23:25 UTC
Backported to 23.05.x for upcoming 23.05.09