Bug 23078 - Use Koha.Preference in OPAC global header include
Summary: Use Koha.Preference in OPAC global header include
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-07 12:27 UTC by Owen Leonard
Modified: 2020-06-04 20:33 UTC (History)
7 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:
19.11.00,19.05.03


Attachments
Bug 23078: Use Koha.Preference in OPAC global header include (6.20 KB, patch)
2019-06-10 16:34 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23078: Use Koha.Preference in OPAC global header include (6.17 KB, patch)
2019-06-11 12:24 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23078: Use Koha.Preference in OPAC global header include (6.22 KB, patch)
2019-06-21 20:46 UTC, Frédérik Chénier
Details | Diff | Splinter Review
Bug 23078: Use Koha.Preference in OPAC global header include (6.28 KB, patch)
2019-07-05 17:56 UTC, Nadine Pierre
Details | Diff | Splinter Review
Bug 23078: (follow-up) Update self checkout help page (2.45 KB, patch)
2019-07-09 13:56 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23078: (follow-up) Update self checkout help page (3.12 KB, patch)
2019-07-09 13:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23078: (follow-up) Update self checkout help page (3.18 KB, patch)
2019-07-12 18:19 UTC, Frédérik Chénier
Details | Diff | Splinter Review
Bug 20607: Make Koha::SearchEngine::Elasticsearch::reset_elasticsearch_mappings take weight into account (4.96 KB, patch)
2019-07-19 10:26 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 20607: (QA follow-up) Test corrections (1.41 KB, patch)
2019-07-19 10:26 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23078: Use Koha.Preference in OPAC global header include (6.34 KB, patch)
2019-07-19 13:41 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23078: (follow-up) Update self checkout help page (3.24 KB, patch)
2019-07-19 13:41 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2019-06-07 12:27:27 UTC
To prevent bugs like Bug 23076 the OPAC's doc-head-close.inc include file should use 'Koha.Preference' syntax everywhere.
Comment 1 Owen Leonard 2019-06-10 16:34:27 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2019-06-11 01:49:34 UTC
Comment on attachment 90460 [details] [review]
Bug 23078: Use Koha.Preference in OPAC global header include

Review of attachment 90460 [details] [review]:
-----------------------------------------------------------------

Fix the lines that should be removed, and I'll sign off. :)

::: koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc
@@ +9,4 @@
>  [% IF ( bidi ) %]
>      [% Asset.css("lib/bootstrap/css/bootstrap-rtl.min.css") | $raw %]
> +    [% Asset.css("lib/jquery/jquery-ui-rtl.css") | $raw %]
> +    [% Asset.css("css/right-to-left.css") | $raw %]

Nice clean up moves.

@@ +20,1 @@
>  [% END %]

You probably could have deleted these three lines.
Comment 3 Mark Tompsett 2019-06-11 01:49:58 UTC
Because extra lines got left behind.
Comment 4 Mark Tompsett 2019-06-11 01:51:44 UTC
(In reply to M. Tompsett from comment #3)
> Because extra lines got left behind.

18	[% IF ( bidi ) %]
19	[% ELSE %]
20	[% END %]
Those ones.
Comment 5 Owen Leonard 2019-06-11 12:24:52 UTC Comment hidden (obsolete)
Comment 6 Frédérik Chénier 2019-06-21 20:46:53 UTC Comment hidden (obsolete)
Comment 7 Mark Tompsett 2019-07-04 18:01:14 UTC
Frederik seems to have forgotten to set the status to signed off. My former comments were addressed. Fixing status.
Comment 8 Nadine Pierre 2019-07-05 17:56:49 UTC
Created attachment 91349 [details] [review]
Bug 23078: Use Koha.Preference in OPAC global header include

This patch updates the OPAC's doc-head-close.inc so that it uses
'Koha.Preference' syntax to output system preference data. The patch
removes handling of two preferences from Auth.pm which which are covered
by this template change.

This patch also makes some minor changes to consolidate multiple
template checks for "bidi"

To test, apply the patch and test the affected OPAC system preferences:

 - OpacFavicon
 - opaclayoutstylesheet
 - OPACUserCSS
 - OPACBaseURL

Confirm that changes made to these preferences are reflected in the
OPAC.

Signed-off-by: frederik <frederik@inlibro.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Comment 9 Katrin Fischer 2019-07-06 07:39:59 UTC
Hi Owen,

can you explain why those 2 lines in Auth.pm are still needed with patches applied?

OpacAdditionalStylesheet  => C4::Context->preference("OpacAdditionalStylesheet"),
opaclayoutstylesheet      => C4::Context->preference("opaclayoutstylesheet"),

Also found these:

koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt:<link rel="shortcut icon" href="[% IF ( OpacFavicon  ) %][% OpacFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/images/favicon.ico[% END %]" type="image/x-icon" />
koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/printslip.tt:<link rel="shortcut icon" href="[% IF ( OpacFavicon  ) %][% OpacFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/images/favicon.ico[% END %]" type="image/x-icon" />
koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt:[% IF ( Koha.Preference('OpacFavicon') ) %]

koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt:[% IF ( OPACUserCSS ) %]<style>[% OPACUserCSS | $raw %]</style>[% END %]
koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt:[% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]

Can you please check?
Comment 10 Owen Leonard 2019-07-09 13:56:00 UTC Comment hidden (obsolete)
Comment 11 Owen Leonard 2019-07-09 13:59:31 UTC
Created attachment 91431 [details] [review]
Bug 23078: (follow-up) Update self checkout help page

This patch takes care of some preference instances I missed in the self
checkout module's help page. It also removes some obsolete lines from
Auth.pm.

To test, apply the patch and re-test based on the previous test plan.
Also test in the self-checkout module by logging into self checkout and
clicking the "Help" link in the upper right of the screen.

The settings of the following preferences should be shown correctly:

 - OpacFavicon
 - OPACUserCSS
Comment 12 Frédérik Chénier 2019-07-12 18:19:47 UTC
Created attachment 91503 [details] [review]
Bug 23078: (follow-up) Update self checkout help page

This patch takes care of some preference instances I missed in the self
checkout module's help page. It also removes some obsolete lines from
Auth.pm.

To test, apply the patch and re-test based on the previous test plan.
Also test in the self-checkout module by logging into self checkout and
clicking the "Help" link in the upper right of the screen.

The settings of the following preferences should be shown correctly:

 - OpacFavicon
 - OPACUserCSS

Signed-off-by: frederik chenier <frederik.chenier@inlibro.com>
Comment 13 Nick Clemens 2019-07-19 10:26:28 UTC
Created attachment 91626 [details] [review]
Bug 20607: Make Koha::SearchEngine::Elasticsearch::reset_elasticsearch_mappings take weight into account

Test plan:
  - apply this patch,
  - edit admin/searchengine/elasticsearch/mappings.yaml
    to add weight for some fields,
  - go to admin > search engine configuration,
  - reset your mappings (add ?op=reset&i_know_what_i_am_doing=1 to url),
  - check that weights you've added are set

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 14 Nick Clemens 2019-07-19 10:26:32 UTC
Created attachment 91627 [details] [review]
Bug 20607: (QA follow-up) Test corrections

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Martin Renvoize 2019-07-19 13:02:24 UTC
I think Nick accidentally marked this one PQA when meaning to mark another bug, setting back to SO
Comment 16 Nick Clemens 2019-07-19 13:41:19 UTC
Created attachment 91654 [details] [review]
Bug 23078: Use Koha.Preference in OPAC global header include

This patch updates the OPAC's doc-head-close.inc so that it uses
'Koha.Preference' syntax to output system preference data. The patch
removes handling of two preferences from Auth.pm which which are covered
by this template change.

This patch also makes some minor changes to consolidate multiple
template checks for "bidi"

To test, apply the patch and test the affected OPAC system preferences:

 - OpacFavicon
 - opaclayoutstylesheet
 - OPACUserCSS
 - OPACBaseURL

Confirm that changes made to these preferences are reflected in the
OPAC.

Signed-off-by: frederik <frederik@inlibro.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 17 Nick Clemens 2019-07-19 13:41:22 UTC
Created attachment 91655 [details] [review]
Bug 23078: (follow-up) Update self checkout help page

This patch takes care of some preference instances I missed in the self
checkout module's help page. It also removes some obsolete lines from
Auth.pm.

To test, apply the patch and re-test based on the previous test plan.
Also test in the self-checkout module by logging into self checkout and
clicking the "Help" link in the upper right of the screen.

The settings of the following preferences should be shown correctly:

 - OpacFavicon
 - OPACUserCSS

Signed-off-by: frederik chenier <frederik.chenier@inlibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 18 Martin Renvoize 2019-07-19 14:59:25 UTC
Nice work!

Pushed to master for 19.11.00
Comment 19 Fridolin Somers 2019-08-06 14:52:57 UTC
Pushed to 19.05.x for 19.05.03
Comment 20 Fridolin Somers 2019-08-06 14:53:54 UTC
It is nice to see code becoming more clean and clear.
Thanks a lot for this job ;)
Comment 21 Lucas Gass 2019-08-13 21:21:50 UTC
backported to 18.11.x for 18.11.09