Bug 21293

Summary: Display of housebound delivery information broken by Bug 13618
Product: Koha Reporter: Owen Leonard <oleonard>
Component: CirculationAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: gmcharlt, jonathan.druart, kyle.m.hall, m.de.rooy, nick, testopia
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 13618    
Bug Blocks:    
Attachments: Bug 21293: Display of housebound delivery information broken by Bug 13618
Bug 21293: Display of housebound delivery information broken by Bug 13618
Bug 21293: Remove another misplaced html filter on housebound.tt
Bug 21293: Display of housebound delivery information broken by Bug 13618
Bug 21293: Remove another misplaced html filter on housebound.tt

Description Owen Leonard 2018-08-30 16:42:33 UTC
A stray " | html " filter in the housebound template means that none of the housebound delivery details are showing up.
Comment 1 Owen Leonard 2018-08-30 16:47:28 UTC
Created attachment 78314 [details] [review]
Bug 21293: Display of housebound delivery information broken by Bug 13618

This patch corrects the patron housebound details template. A stray
"html" filter broke display of delivery information.

To test, apply the patch and enable the HouseboundModule system
preference.

 - Open a patron record and select the "Housebound" tab in the left-hand
   navigation menu.
 - Click "Add a new deliver" and save some delivery details.
 - Upon saving you should be directed back to the housebound details
   page. All the details of the delivery you saved should appear
   correctly.
Comment 2 Jonathan Druart 2018-08-31 16:51:46 UTC
Created attachment 78341 [details] [review]
Bug 21293: Display of housebound delivery information broken by Bug 13618

This patch corrects the patron housebound details template. A stray
"html" filter broke display of delivery information.

To test, apply the patch and enable the HouseboundModule system
preference.

 - Open a patron record and select the "Housebound" tab in the left-hand
   navigation menu.
 - Click "Add a new deliver" and save some delivery details.
 - Upon saving you should be directed back to the housebound details
   page. All the details of the delivery you saved should appear
   correctly.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Jonathan Druart 2018-08-31 16:51:50 UTC
Created attachment 78342 [details] [review]
Bug 21293: Remove another misplaced html filter on housebound.tt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Marcel de Rooy 2018-09-14 08:33:04 UTC
QA: Looking here
Comment 5 Marcel de Rooy 2018-09-14 09:25:42 UTC
Created attachment 78640 [details] [review]
Bug 21293: Display of housebound delivery information broken by Bug 13618

This patch corrects the patron housebound details template. A stray
"html" filter broke display of delivery information.

To test, apply the patch and enable the HouseboundModule system
preference.

 - Open a patron record and select the "Housebound" tab in the left-hand
   navigation menu.
 - Click "Add a new deliver" and save some delivery details.
 - Upon saving you should be directed back to the housebound details
   page. All the details of the delivery you saved should appear
   correctly.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2018-09-14 09:25:49 UTC
Created attachment 78641 [details] [review]
Bug 21293: Remove another misplaced html filter on housebound.tt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Marcel de Rooy 2018-09-14 09:34:37 UTC
Some testing told me:

A construction with an assignment and a filter may be dangerous.
Like this one:
[% test = housebound_profile.housebound_visits | html  %]
housebound_profile is an object; visits is the returned arrayref.
Somehow, the html filter in TT makes that template var test becomes the string ARRAY(..) instead of an array.

In the second patch we remove the filter from
[% hpd = housebound_profile.day | html %]
This is less problematic, since day is a string already.

Lesson:
All occurrences of [% var = something | html %] are error prone. If something is not a string, but an object, array, hash etc., we are in trouble.
This probably needs more attention since we are passing objects to templates in more scripts.
Comment 8 Jonathan Druart 2018-09-14 16:41:21 UTC
(In reply to Marcel de Rooy from comment #7)
> Lesson:
> All occurrences of [% var = something | html %] are error prone. If
> something is not a string, but an object, array, hash etc., we are in
> trouble.
> This probably needs more attention since we are passing objects to templates
> in more scripts.

Yes, that's a problem the script did not spot/handle. I searched for other occurrences but did not find any.
Comment 9 Nick Clemens (kidclamp) 2018-09-14 19:54:32 UTC
Awesome work all!

Pushed to master for 18.11