Bug 25137 - PatronSelfRegistrationLibraryList results in empty branch list on opac-memberentry.pl
Summary: PatronSelfRegistrationLibraryList results in empty branch list on opac-member...
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 23084
Blocks: 25136
  Show dependency treegraph
 
Reported: 2020-04-13 19:48 UTC by Andrew Fuerste-Henry
Modified: 2020-05-05 22:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition (1.54 KB, patch)
2020-04-14 10:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition (1.61 KB, patch)
2020-04-14 10:52 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition (1.66 KB, patch)
2020-04-14 21:39 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 Andrew Fuerste-Henry 2020-04-13 19:48:46 UTC
Putting any value into PatronSelfRegistrationLibraryList results in a completely empty branch list on opac-memberentry.pl for both self-reg and self-mod. 
To Test:
- confirm you have a branch with code X
- confirm PatronSelfRegistrationBorrowerUnwantedField and PatronSelfModificationBorrowerUnwantedField are empty
- enter X in PatronSelfRegistrationLibraryList
- go to cgi-bin/koha/opac-memberentry.pl (either as a logged in patron or as a self-reg patron)
- confirm branch dropdown is empty
- empty out PatronSelfRegistrationLibraryList
- reload cgi-bin/koha/opac-memberentry.pl and confirm branches show

Found this while trying to test a bug around this same syspref in 19.05, bug 25136
Comment 1 Jonathan Druart 2020-04-14 09:59:48 UTC
Caused by
  commit 82716a01727f143ba2c167cd86233a531f330390
  Bug 23084: Replace grep {^$var$} with grep {$_ eq $var}
Comment 2 Jonathan Druart 2020-04-14 10:01:57 UTC
Created attachment 102917 [details] [review]
Bug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition

The lack of parenthesis makes the condition evaluated wrong.

Test plan:
- confirm you have a branch with code X
- enter X in PatronSelfRegistrationLibraryList
- go to cgi-bin/koha/opac-memberentry.pl (either as a logged in patron or as a self-reg patron)
- confirm branch dropdown is not empty and contain X
- empty out PatronSelfRegistrationLibraryList
- reload cgi-bin/koha/opac-memberentry.pl and confirm branches show
Comment 3 Jonathan Druart 2020-04-14 10:04:26 UTC
@QA I did check the other occurrences modified by bug 23084 and they appear correct. Another look would be good anyway!
Comment 4 Bernardo Gonzalez Kriegel 2020-04-14 10:47:11 UTC
Was the lack of () the reason?
If that is the case perhaps C4/Utils/DataTables/Members.pm lines 59/60

Why write a logical test not surrounded by parenthesis?

Tested, fix the error.
Comment 5 Bernardo Gonzalez Kriegel 2020-04-14 10:52:49 UTC
Created attachment 102921 [details] [review]
Bug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition

The lack of parenthesis makes the condition evaluated wrong.

Test plan:
- confirm you have a branch with code X
- enter X in PatronSelfRegistrationLibraryList
- go to cgi-bin/koha/opac-memberentry.pl (either as a logged in patron or as a self-reg patron)
- confirm branch dropdown is not empty and contain X
- empty out PatronSelfRegistrationLibraryList
- reload cgi-bin/koha/opac-memberentry.pl and confirm branches show

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment 9 Katrin Fischer 2020-04-14 21:39:48 UTC
Created attachment 102951 [details] [review]
Bug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition

The lack of parenthesis makes the condition evaluated wrong.

Test plan:
- confirm you have a branch with code X
- enter X in PatronSelfRegistrationLibraryList
- go to cgi-bin/koha/opac-memberentry.pl (either as a logged in patron or as a self-reg patron)
- confirm branch dropdown is not empty and contain X
- empty out PatronSelfRegistrationLibraryList
- reload cgi-bin/koha/opac-memberentry.pl and confirm branches show

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Martin Renvoize 2020-04-15 07:35:57 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Joy Nelson 2020-05-05 22:32:18 UTC
missing dependencies - not backported to 19.11.x