Bug 21279 - Transport cost matrix shows html entity in all empty cells
Summary: Transport cost matrix shows html entity in all empty cells
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-27 20:03 UTC by Katrin Fischer
Modified: 2020-01-06 20:14 UTC (History)
6 users (show)

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


Attachments
Bug 21279: (bug 13618 follow-up) Do not escape   in "Transport cost matrix" (1.84 KB, patch)
2018-08-29 19:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21279: (bug 13618 follow-up) Do not escape   in "Transport cost matrix" (1.89 KB, patch)
2018-08-29 19:58 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21279: [COUNTERPATCH] Fix   in transport cost matrix (1.76 KB, patch)
2018-10-10 11:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 21279: Fix   in transport cost matrix (1.79 KB, patch)
2018-10-10 12:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21279: Fix   in transport cost matrix (1.85 KB, patch)
2018-10-10 13:43 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2018-08-27 20:03:12 UTC
The transport cost matrix now shows   in all empty cells. Cells should be empty.
Comment 1 Jonathan Druart 2018-08-29 19:53:05 UTC
Created attachment 78290 [details] [review]
Bug 21279: (bug 13618 follow-up) Do not escape   in "Transport cost matrix"

Test plan:
On Home › Administration › Transport cost matrix you should no longer
see " ".
Fill some values and save, you should see the correct values.
Comment 2 Katrin Fischer 2018-08-29 19:58:16 UTC
Created attachment 78291 [details] [review]
Bug 21279: (bug 13618 follow-up) Do not escape   in "Transport cost matrix"

Test plan:
On Home › Administration › Transport cost matrix you should no longer
see " ".
Fill some values and save, you should see the correct values.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 3 Marcel de Rooy 2018-08-31 06:00:44 UTC
-                            <div class="enable_cost_input" data-cost-id="[% bt.id | html %]">[% bt.disabled ? '&nbsp;' : bt.value | html %]</div>
+                            [% SET bt_value = '&nbsp;' %]
+                            [% UNLESS bt.disabled %][% bt_value = BLOCK %][% bt.value | html %][% END %][% END %]
+                            <div class="enable_cost_input" data-cost-id="[% bt.id | html %]">[% bt_value | $raw %]</div>

Looks overcomplicated to me. Assigning &nbsp; to template vars does not seem the way to go imo. No need to pass &nbsp; to raw too. This is just regular template contents.
Why not:

<div ..> [% IF bt.disabled %]&nbsp;[% ELSE %][% bt.value | html %]</div>

Looks simpler to me :) What do you think?
Comment 4 Jonathan Druart 2018-10-09 21:26:22 UTC
(In reply to Marcel de Rooy from comment #3)
> Looks simpler to me :) What do you think?

That's sounds simpler indeed, could you provide an alternative patch?
Comment 5 Marcel de Rooy 2018-10-10 11:46:59 UTC
Created attachment 80334 [details] [review]
Bug 21279: [COUNTERPATCH] Fix &nbsp; in transport cost matrix

Test plan:
On Home › Administration › Transport cost matrix you should no longer
see "&nbsp;".
Fill some values and save, you should see the correct values.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Jonathan Druart 2018-10-10 12:58:43 UTC
Created attachment 80338 [details] [review]
Bug 21279: Fix &nbsp; in transport cost matrix

Test plan:
On Home › Administration › Transport cost matrix you should no longer
see "&nbsp;".
Fill some values and save, you should see the correct values.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2018-10-10 12:59:03 UTC
Thanks Marcel!
Comment 8 Martin Renvoize 2018-10-10 13:43:37 UTC
Created attachment 80351 [details] [review]
Bug 21279: Fix &nbsp; in transport cost matrix

Test plan:
On Home › Administration › Transport cost matrix you should no longer
see "&nbsp;".
Fill some values and save, you should see the correct values.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2018-10-10 13:43:55 UTC
Nice simple fix, passing qa.
Comment 10 Nick Clemens 2018-10-15 17:03:13 UTC
Awesome work all!

Pushed to master for 18.11
Comment 11 Martin Renvoize 2018-10-17 10:28:26 UTC
Pushed to 18.05.x for 18.05.05
Comment 12 Fridolin Somers 2018-11-09 07:59:53 UTC
Pushed to 17.11.x for 17.11.12