Bug 21293 - Display of housebound delivery information broken by Bug 13618
Summary: Display of housebound delivery information broken by Bug 13618
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 13618
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-30 16:42 UTC by Owen Leonard
Modified: 2020-01-06 20:14 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21293: Display of housebound delivery information broken by Bug 13618 (1.57 KB, patch)
2018-08-30 16:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 21293: Display of housebound delivery information broken by Bug 13618 (1.65 KB, patch)
2018-08-31 16:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21293: Remove another misplaced html filter on housebound.tt (1.13 KB, patch)
2018-08-31 16:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21293: Display of housebound delivery information broken by Bug 13618 (1.74 KB, patch)
2018-09-14 09:25 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 21293: Remove another misplaced html filter on housebound.tt (1.22 KB, patch)
2018-09-14 09:25 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 2018-09-14 19:54:32 UTC
Awesome work all!

Pushed to master for 18.11