Bug 21008

Summary: pay.pl and paycollect.pl raise warning
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, katrin.fischer, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18789    
Bug Blocks:    
Attachments: Bug 21008: Use patron object to get category_type
Bug 21008: Use Koha::Patron->is_child
Bug 21008: Use Koha::Patron->is_child
Bug 21008: Use patron object to get category_type
Bug 21008: Use Koha::Patron->is_child
Bug 21008: Use patron object to get category_type
Bug 21008: Use Koha::Patron->is_child

Description Tomás Cohen Arazi 2018-06-27 17:39:35 UTC
After bug 18789, both controller scripts log warnings due to and attribute not existing in the unblessed patron object.

Trying to fix that warning I found that the populated variables weren't actually used on the templates at all! They should be removed.
Comment 1 Tomás Cohen Arazi 2018-06-27 17:42:26 UTC
They are used, in patron-search.inc. Still needs fixing.
Comment 2 Jonathan Druart 2018-06-27 18:46:20 UTC
Which variables?
Comment 3 Tomás Cohen Arazi 2018-06-27 20:42:47 UTC
(In reply to Jonathan Druart from comment #2)
> Which variables?

1- $b_ref->{extendedattributes}

The other scripts set $template->param( extendedattributes => ... );

2- CATCODE_MULTI

I made a mistake on this one, as it is used in patron-search.inc. But the current logic prevents it to be populated.

3- catcode

Same as 2.

I really think this should all be moved into using the global $patron object.
Comment 4 Tomás Cohen Arazi 2018-06-28 13:33:50 UTC
Created attachment 76545 [details] [review]
Bug 21008: Use patron object to get category_type

This patch makes borrower_add_additional_fields() in both pay.pl and
paycollect.pl use the right object to pick the category_type.

It also populates the extendedattributes template variable in pay.pl
which was missed by a change.
Comment 5 Jonathan Druart 2018-06-28 14:01:39 UTC
Created attachment 76546 [details] [review]
Bug 21008: Use Koha::Patron->is_child
Comment 6 Tomás Cohen Arazi 2018-06-28 14:42:14 UTC
Created attachment 76547 [details] [review]
Bug 21008: Use Koha::Patron->is_child

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I removed the category parameter as it is not really used.
Comment 7 Katrin Fischer 2018-07-08 15:48:00 UTC
No test plan?
Comment 8 Katrin Fischer 2018-07-08 15:49:55 UTC
Created attachment 76766 [details] [review]
Bug 21008: Use patron object to get category_type

This patch makes borrower_add_additional_fields() in both pay.pl and
paycollect.pl use the right object to pick the category_type.

It also populates the extendedattributes template variable in pay.pl
which was missed by a change.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2018-07-08 15:49:59 UTC
Created attachment 76767 [details] [review]
Bug 21008: Use Koha::Patron->is_child

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I removed the category parameter as it is not really used.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Jonathan Druart 2018-07-12 17:42:58 UTC
Created attachment 76898 [details] [review]
Bug 21008: Use patron object to get category_type

This patch makes borrower_add_additional_fields() in both pay.pl and
paycollect.pl use the right object to pick the category_type.

It also populates the extendedattributes template variable in pay.pl
which was missed by a change.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2018-07-12 17:43:03 UTC
Created attachment 76899 [details] [review]
Bug 21008: Use Koha::Patron->is_child

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I removed the category parameter as it is not really used.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Nick Clemens 2018-07-13 13:49:35 UTC
Awesome work all!

Pushed to master for 18.11
Comment 13 Martin Renvoize 2018-07-15 20:41:05 UTC
Pushed to 18.05.x for 18.05.02
Comment 14 Fridolin Somers 2018-07-30 14:25:42 UTC
Depends on Bug 18789 not in 17.11.x