Bug 27454 - Additional patron attributes change sequence on every reload of edit page
Summary: Additional patron attributes change sequence on every reload of edit page
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2021-01-17 15:59 UTC by Katrin Fischer
Modified: 2021-12-13 21:08 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the order that additional patron attributes are displayed on the patron edit form. They are now sorted by the attribute code, before this they displayed in a random order.
Version(s) released in:
21.05.00,20.11.03,20.05.09


Attachments
Bug 27454: Add sorting of patron attributes (1.54 KB, patch)
2021-01-18 10:29 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27454 - Display of paytron attributes after apply patch (22.37 KB, image/png)
2021-02-03 10:12 UTC, David Nind
Details
Bug 27454: Pass the arrayref (834 bytes, patch)
2021-02-03 12:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27454: Add sorting of patron attributes (1.59 KB, patch)
2021-02-03 18:41 UTC, David Nind
Details | Diff | Splinter Review
Bug 27454: Pass the arrayref (883 bytes, patch)
2021-02-03 18:41 UTC, David Nind
Details | Diff | Splinter Review
Bug 27454: Add sorting of patron attributes (1.65 KB, patch)
2021-02-07 11:35 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27454: Pass the arrayref (941 bytes, patch)
2021-02-07 11:35 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2021-01-17 15:59:08 UTC
This is a bit irritating and makes it a little harder when you want to fill out the form quickly.

To test:
- Create 2 PA_CLASS values and an empty one
- Create 3 patron attributes, one for each (I had A, B and the preinstalled SHOW_BCODE)
- Open any patron form for editing
- Note sequence of additional attributes
- Reload page
- Verify the sequence changes with reloads
Comment 1 Martin Renvoize 2021-01-17 20:05:58 UTC
I noticed this.. it's due to hash order randomisation I believe.. pretty sure I identified where it could be fixed.. will take a look on Monday
Comment 2 Martin Renvoize 2021-01-18 10:29:03 UTC
Created attachment 115238 [details] [review]
Bug 27454: Add sorting of patron attributes

This patch adds sorting on class code for the patrons attributes forms
on the memberentry page.

Test plan
1) Create a couple of different patron attributes
2) Go to the patron add page
3) Note the order in which the patron attributes load at the bottom of
   the page.
4) Reload the page and note the order of those attribues may change (if
   it doesn't, try reloading again.. it's random)
5) Apply the patch
6) Reload the page a few times and confirm the attributes are now
   ordered.
7) Signoff
Comment 3 David Nind 2021-02-03 10:12:37 UTC
Created attachment 116244 [details]
Bug 27454 - Display of paytron attributes after apply patch

Hi Martin.

I could replicate the problem, but after applying the patch the display of the additional attributes goes really weird - see screenshot.

I created three patron attrributes: PA0, PA1, and PA2. I flushed the cached and restarted all after applying the patch.

David
Comment 4 Jonathan Druart 2021-02-03 12:55:12 UTC
Created attachment 116254 [details] [review]
Bug 27454: Pass the arrayref

Otherwise you mess with the following hash elements :)
Comment 5 David Nind 2021-02-03 18:41:19 UTC
Created attachment 116291 [details] [review]
Bug 27454: Add sorting of patron attributes

This patch adds sorting on class code for the patrons attributes forms
on the memberentry page.

Test plan
1) Create a couple of different patron attributes
2) Go to the patron add page
3) Note the order in which the patron attributes load at the bottom of
   the page.
4) Reload the page and note the order of those attribues may change (if
   it doesn't, try reloading again.. it's random)
5) Apply the patch
6) Reload the page a few times and confirm the attributes are now
   ordered.
7) Signoff

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2021-02-03 18:41:23 UTC
Created attachment 116292 [details] [review]
Bug 27454: Pass the arrayref

Otherwise you mess with the following hash elements :)

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Martin Renvoize 2021-02-03 20:16:22 UTC
Oops, thanks for the fix Jonathan.
Comment 8 Katrin Fischer 2021-02-07 11:35:22 UTC
Created attachment 116461 [details] [review]
Bug 27454: Add sorting of patron attributes

This patch adds sorting on class code for the patrons attributes forms
on the memberentry page.

Test plan
1) Create a couple of different patron attributes
2) Go to the patron add page
3) Note the order in which the patron attributes load at the bottom of
   the page.
4) Reload the page and note the order of those attribues may change (if
   it doesn't, try reloading again.. it's random)
5) Apply the patch
6) Reload the page a few times and confirm the attributes are now
   ordered.
7) Signoff

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2021-02-07 11:35:25 UTC
Created attachment 116462 [details] [review]
Bug 27454: Pass the arrayref

Otherwise you mess with the following hash elements :)

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Jonathan Druart 2021-02-08 13:57:43 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 11 Fridolin Somers 2021-02-12 13:47:18 UTC
Pushed to 20.11.x for 20.11.03
Comment 12 Andrew Fuerste-Henry 2021-02-18 13:26:37 UTC
Pushed to 20.05.x for 20.05.09
Comment 13 Victor Grousset/tuxayo 2021-02-21 00:16:35 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.