Bug 25069

Summary: AddressFormat="fr" behavior is broken
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: 1joynelson, gmcharlt, kyle.m.hall, lucas, m.de.rooy
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11
Bug Depends on: 13618, 18110    
Bug Blocks: 25070    
Attachments: Bug 25069: Fix AddressFormat="fr" behavior
Bug 25069: Fix AddressFormat="fr" behavior
Bug 25069: Fix AddressFormat="fr" behavior
Bug 25069: Fix AddressFormat="fr" behavior
[19.11.x version] Bug 25069: Fix AddressFormat="fr" behavior

Description Jonathan Druart 2020-04-06 10:35:57 UTC
Something went wrong during a rebase of bug 13618
  commit dcd1f5d48c758aee17b6c6f069c6146b42efe117
  Bug 13618: Add html filters to all the variables

Several changes related to AddressFormat are wrong:

-    [% IF Koha.Preference( 'AddressFormat' ) %]
-        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
-    [% ELSE %]
-        [% INCLUDE 'member-main-address-style-us.inc' %]
-    [% END %]
+    [% SWITCH Koha.Preference( 'AddressFormat' ) %]
+        [% CASE 'de' %]
+            [% INCLUDE 'member-main-address-style-de.inc' %]
+        [% CASE # us %]
+            [% INCLUDE 'member-main-address-style-us.inc' %]
+     [% END %]
Comment 1 Jonathan Druart 2020-04-06 10:45:57 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2020-04-06 11:33:32 UTC
Created attachment 102437 [details] [review]
Bug 25069: Fix AddressFormat="fr" behavior

Something went wrong during a rebase of bug 13618
  commit dcd1f5d48c758aee17b6c6f069c6146b42efe117
  Bug 13618: Add html filters to all the variables

Several changes related to AddressFormat are wrong:

-    [% IF Koha.Preference( 'AddressFormat' ) %]
-        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
-    [% ELSE %]
-        [% INCLUDE 'member-main-address-style-us.inc' %]
-    [% END %]
+    [% SWITCH Koha.Preference( 'AddressFormat' ) %]
+        [% CASE 'de' %]
+            [% INCLUDE 'member-main-address-style-de.inc' %]
+        [% CASE # us %]
+            [% INCLUDE 'member-main-address-style-us.inc' %]
+     [% END %]

Test plan:
Create a patron with all the address fields filled
Play with the 3 option values of AddressFormat, and confirm that the address is displayed correctly
on the patron's view, and in the patron module (top left)
Comment 3 Owen Leonard 2020-04-06 14:46:34 UTC
Created attachment 102454 [details] [review]
Bug 25069: Fix AddressFormat="fr" behavior

Something went wrong during a rebase of bug 13618
  commit dcd1f5d48c758aee17b6c6f069c6146b42efe117
  Bug 13618: Add html filters to all the variables

Several changes related to AddressFormat are wrong:

-    [% IF Koha.Preference( 'AddressFormat' ) %]
-        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
-    [% ELSE %]
-        [% INCLUDE 'member-main-address-style-us.inc' %]
-    [% END %]
+    [% SWITCH Koha.Preference( 'AddressFormat' ) %]
+        [% CASE 'de' %]
+            [% INCLUDE 'member-main-address-style-de.inc' %]
+        [% CASE # us %]
+            [% INCLUDE 'member-main-address-style-us.inc' %]
+     [% END %]

Test plan:
Create a patron with all the address fields filled
Play with the 3 option values of AddressFormat, and confirm that the address is displayed correctly
on the patron's view, and in the patron module (top left)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Marcel de Rooy 2020-04-10 10:27:58 UTC
Created attachment 102695 [details] [review]
Bug 25069: Fix AddressFormat="fr" behavior

Something went wrong during a rebase of bug 13618
  commit dcd1f5d48c758aee17b6c6f069c6146b42efe117
  Bug 13618: Add html filters to all the variables

Several changes related to AddressFormat are wrong:

-    [% IF Koha.Preference( 'AddressFormat' ) %]
-        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
-    [% ELSE %]
-        [% INCLUDE 'member-main-address-style-us.inc' %]
-    [% END %]
+    [% SWITCH Koha.Preference( 'AddressFormat' ) %]
+        [% CASE 'de' %]
+            [% INCLUDE 'member-main-address-style-de.inc' %]
+        [% CASE # us %]
+            [% INCLUDE 'member-main-address-style-us.inc' %]
+     [% END %]

Test plan:
Create a patron with all the address fields filled
Play with the 3 option values of AddressFormat, and confirm that the address is displayed correctly
on the patron's view, and in the patron module (top left)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Martin Renvoize 2020-04-14 07:37:36 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 6 Joy Nelson 2020-05-04 21:21:33 UTC
does not apply to 19.11.x branch.
please rebase if needed.
Comment 7 Jonathan Druart 2020-05-05 07:28:27 UTC
Created attachment 104349 [details] [review]
[19.11.x version] Bug 25069: Fix AddressFormat="fr" behavior

Something went wrong during a rebase of bug 13618
  commit dcd1f5d48c758aee17b6c6f069c6146b42efe117
  Bug 13618: Add html filters to all the variables

Several changes related to AddressFormat are wrong:

-    [% IF Koha.Preference( 'AddressFormat' ) %]
-        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
-    [% ELSE %]
-        [% INCLUDE 'member-main-address-style-us.inc' %]
-    [% END %]
+    [% SWITCH Koha.Preference( 'AddressFormat' ) %]
+        [% CASE 'de' %]
+            [% INCLUDE 'member-main-address-style-de.inc' %]
+        [% CASE # us %]
+            [% INCLUDE 'member-main-address-style-us.inc' %]
+     [% END %]

Test plan:
Create a patron with all the address fields filled
Play with the 3 option values of AddressFormat, and confirm that the address is displayed correctly
on the patron's view, and in the patron module (top left)
Comment 8 Joy Nelson 2020-05-07 17:32:36 UTC
Thanks for the rebase - backported to 19.11.x for 19.11.06
Comment 9 Lucas Gass 2020-05-14 17:20:11 UTC
backported to 19.05.x for 19.05.11