Bug 22059 - Wrong exception parameters in Koha::Patron->set_password
Summary: Wrong exception parameters in Koha::Patron->set_password
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Target Milestone: ---
Assignee: Tomás Cohen Arazi
QA Contact: Josef Moravec
URL:
Whiteboard:
Keywords:
Depends on: 21178
Blocks: 17006
  Show dependency treegraph
 
Reported: 2019-01-02 12:55 UTC by Tomás Cohen Arazi
Modified: 2019-01-10 15:49 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 22059: regression tests (1.10 KB, patch)
2019-01-02 12:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22059: Fix exception params in Koha::Patron->set_password (1.20 KB, patch)
2019-01-02 12:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22059: regression tests (1.17 KB, patch)
2019-01-02 13:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 22059: Fix exception params in Koha::Patron->set_password (1.27 KB, patch)
2019-01-02 13:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 22059: regression tests (1.20 KB, patch)
2019-01-02 21:07 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 22059: Fix exception params in Koha::Patron->set_password (1.30 KB, patch)
2019-01-02 21:07 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2019-01-02 12:55:23 UTC
Exception::Class requires parameters to be passed as a list instead of a hashref. Then

this is wrong:
Koha::Exceptions::Password::TooShort->throw({ length => $password_length, min_length => $min_length });

this is ok:
Koha::Exceptions::Password::TooShort->throw( length => $password_length, min_length => $min_length );

This is a minor issue anyway, preventing exceptions from being stringified correctly.
Comment 1 Tomás Cohen Arazi 2019-01-02 12:59:54 UTC
Created attachment 83574 [details] [review]
Bug 22059: regression tests
Comment 2 Tomás Cohen Arazi 2019-01-02 12:59:57 UTC
Created attachment 83575 [details] [review]
Bug 22059: Fix exception params in Koha::Patron->set_password

This simple patch fixes a wrong call to ->throw. Parameters shouldn't be
enclosed in curly brackets.

To test:
- Apply the tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> FAIL: Tests fail because the throw call is wrong
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
-Sign off :-D
Comment 3 Kyle M Hall 2019-01-02 13:18:02 UTC
Created attachment 83576 [details] [review]
Bug 22059: regression tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Kyle M Hall 2019-01-02 13:18:13 UTC
Created attachment 83577 [details] [review]
Bug 22059: Fix exception params in Koha::Patron->set_password

This simple patch fixes a wrong call to ->throw. Parameters shouldn't be
enclosed in curly brackets.

To test:
- Apply the tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> FAIL: Tests fail because the throw call is wrong
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
-Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Josef Moravec 2019-01-02 21:07:44 UTC
Created attachment 83607 [details] [review]
Bug 22059: regression tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Josef Moravec 2019-01-02 21:07:47 UTC
Created attachment 83608 [details] [review]
Bug 22059: Fix exception params in Koha::Patron->set_password

This simple patch fixes a wrong call to ->throw. Parameters shouldn't be
enclosed in curly brackets.

To test:
- Apply the tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> FAIL: Tests fail because the throw call is wrong
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
-Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Nick Clemens 2019-01-08 15:56:27 UTC
Awesome work all!

Pushed to master for 19.05
Comment 8 Martin Renvoize 2019-01-10 13:25:36 UTC
Pushed to 18.11.x for 18.11.02
Comment 9 Lucas Gass 2019-01-10 15:49:07 UTC
21178 not in 18.05, not backporting