Bug 23797 - Convert OpacLoginInstructions system preference to news block
Summary: Convert OpacLoginInstructions system preference to news block
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Alex Arnaud
URL:
Keywords:
Depends on: 22318 22880
Blocks: 26050
  Show dependency treegraph
 
Reported: 2019-10-10 18:40 UTC by Owen Leonard
Modified: 2021-12-13 21:08 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:
20.11.00, 20.05.03


Attachments
Bug 23797: Convert OpacLoginInstructions system preference to news block (9.84 KB, patch)
2020-03-24 15:15 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23797: Convert OpacLoginInstructions system preference to news block (9.91 KB, patch)
2020-03-25 12:26 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 23797: Convert OpacLoginInstructions system preference to news block (10.08 KB, patch)
2020-06-26 10:45 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23797: (follow-up) Increase the size of opac_news.lang (1.06 KB, patch)
2020-06-29 13:16 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23797: Convert OpacLoginInstructions system preference to news block (10.08 KB, patch)
2020-07-07 18:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23797: (follow-up) Increase the size of opac_news.lang (1.06 KB, patch)
2020-07-07 18:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23797: (follow-up) Enable OpacLoginInstructions in header (2.02 KB, patch)
2020-07-07 18:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23797: Convert OpacLoginInstructions system preference to news block (10.13 KB, patch)
2020-07-10 08:01 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23797: (follow-up) Increase the size of opac_news.lang (1.12 KB, patch)
2020-07-10 08:01 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23797: (follow-up) Enable OpacLoginInstructions in header (2.07 KB, patch)
2020-07-10 08:01 UTC, Alex Arnaud
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-10-10 18:40:59 UTC
Building on 22318, the OpacLoginInstructions system preference should be converted to a Koha news block.
Comment 1 Owen Leonard 2020-03-24 15:15:25 UTC
Created attachment 101610 [details] [review]
Bug 23797: Convert OpacLoginInstructions system preference to news block

This patch builds on Bug 22318 to move the OpacLoginInstructions system
preference into the Koha news system, making it possible to have
language- and library-specific content.

To test you should have some content in the OpacLoginInstructions system
preference. Apply the patch and run the database update process.

 - Go to the OPAC and click the login link.
 - In the login modal, confirm that the content which was previously in
   the OpacLoginInstructions system preference displays correctly
   below the login form.
 - While not logged in to the OPAC, navigate directly to
   /cgi-bin/koha/opac-user.pl. The OpacLoginInstructions content should
   display correctly here as well.
 - In the staff client, go to Tools -> News and verify that the content
   from OpacLoginInstructions is now stored in news items. There
   should be one entry for each of the enabled translations in your
   system, for instance 'OpacLoginInstructions_en',
   'OpacLoginInstructions_fr-FR', 'OpacLoginInstructions_cs-CZ'
 - Go to Administration -> System preferences and confirm that the
   OpacLoginInstructions preference has been removed.
 - To test the correct selection of language-specific content you must
   run the translation update/install process for the languages you're
   updating.
Comment 2 PTFS Europe Sandboxes 2020-03-25 12:26:41 UTC
Created attachment 101699 [details] [review]
Bug 23797: Convert OpacLoginInstructions system preference to news block

This patch builds on Bug 22318 to move the OpacLoginInstructions system
preference into the Koha news system, making it possible to have
language- and library-specific content.

To test you should have some content in the OpacLoginInstructions system
preference. Apply the patch and run the database update process.

 - Go to the OPAC and click the login link.
 - In the login modal, confirm that the content which was previously in
   the OpacLoginInstructions system preference displays correctly
   below the login form.
 - While not logged in to the OPAC, navigate directly to
   /cgi-bin/koha/opac-user.pl. The OpacLoginInstructions content should
   display correctly here as well.
 - In the staff client, go to Tools -> News and verify that the content
   from OpacLoginInstructions is now stored in news items. There
   should be one entry for each of the enabled translations in your
   system, for instance 'OpacLoginInstructions_en',
   'OpacLoginInstructions_fr-FR', 'OpacLoginInstructions_cs-CZ'
 - Go to Administration -> System preferences and confirm that the
   OpacLoginInstructions preference has been removed.
 - To test the correct selection of language-specific content you must
   run the translation update/install process for the languages you're
   updating.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 3 Sally 2020-03-25 12:27:52 UTC
Very similar commentary to my testing on 23795.

I tested this on a sandbox and it works perfectly for the English language.  
I couldn't find an option to install alternative languages on the newer sandbox environments.

I attempted to test on Biblibre's sandboxes which allow alternative languages.
I couldn't find a way to add content to the opaccredits and then add the patch to test if the content carries over.
However, I can confirm that the other language drop downs are visible in the news section if the patch is applied.

I've added my sign off, but I understand how important additional languages are.  Another person may want to test on a dev environment to double check?
Comment 4 Alex Arnaud 2020-06-19 15:21:30 UTC
Owen, this one also needs a tiny rebase
Comment 5 Owen Leonard 2020-06-26 10:45:56 UTC
Created attachment 106326 [details] [review]
Bug 23797: Convert OpacLoginInstructions system preference to news block

This patch builds on Bug 22318 to move the OpacLoginInstructions system
preference into the Koha news system, making it possible to have
language- and library-specific content.

To test you should have some content in the OpacLoginInstructions system
preference. Apply the patch and run the database update process.

 - Go to the OPAC and click the login link.
 - In the login modal, confirm that the content which was previously in
   the OpacLoginInstructions system preference displays correctly
   below the login form.
 - While not logged in to the OPAC, navigate directly to
   /cgi-bin/koha/opac-user.pl. The OpacLoginInstructions content should
   display correctly here as well.
 - In the staff client, go to Tools -> News and verify that the content
   from OpacLoginInstructions is now stored in news items. There
   should be one entry for each of the enabled translations in your
   system, for instance 'OpacLoginInstructions_en',
   'OpacLoginInstructions_fr-FR', 'OpacLoginInstructions_cs-CZ'
 - Go to Administration -> System preferences and confirm that the
   OpacLoginInstructions preference has been removed.
 - To test the correct selection of language-specific content you must
   run the translation update/install process for the languages you're
   updating.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 6 Alex Arnaud 2020-06-26 13:41:48 UTC
Owen,

As the old syspref name is longer than the others you moved into opac_news, the atomicupdate fail if the language code is more than 3 characters:

DBD::mysql::db do failed: Data too long for column 'lang' at row 1 [for Statement "INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, '', ?)"] at (eval 1424) line 23.

OpacLoginInstructions_en //Ok
OpacLoginInstructions_es_ES // Not ok
OpacLoginInstructions_de_DE // Not ok

Changing opac_news.lang column to a varchar(30) would be ok.

Sorry
Comment 7 Owen Leonard 2020-06-29 13:16:24 UTC
Created attachment 106396 [details] [review]
Bug 23797: (follow-up) Increase the size of opac_news.lang

This patch adds a database update to increase the size of the
opac_news.lang column in order to accommodate longer values.
Comment 8 Alex Arnaud 2020-06-30 08:17:28 UTC
Didn't see it at my first check, but the changes are missing in koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc.

Logout from opac (if you are), click on "Log in to your account" top right => No opac login instructions in the modal.*

grep -ri "Koha.Preference( 'OpacLoginInstructions' )" *
koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc:                    [% IF Koha.Preference( 'OpacLoginInstructions' ) %]
koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc:                            [% Koha.Preference( 'OpacLoginInstructions' ) | $raw %]
Comment 9 Owen Leonard 2020-07-07 18:47:07 UTC
Created attachment 106639 [details] [review]
Bug 23797: Convert OpacLoginInstructions system preference to news block

This patch builds on Bug 22318 to move the OpacLoginInstructions system
preference into the Koha news system, making it possible to have
language- and library-specific content.

To test you should have some content in the OpacLoginInstructions system
preference. Apply the patch and run the database update process.

 - Go to the OPAC and click the login link.
 - In the login modal, confirm that the content which was previously in
   the OpacLoginInstructions system preference displays correctly
   below the login form.
 - While not logged in to the OPAC, navigate directly to
   /cgi-bin/koha/opac-user.pl. The OpacLoginInstructions content should
   display correctly here as well.
 - In the staff client, go to Tools -> News and verify that the content
   from OpacLoginInstructions is now stored in news items. There
   should be one entry for each of the enabled translations in your
   system, for instance 'OpacLoginInstructions_en',
   'OpacLoginInstructions_fr-FR', 'OpacLoginInstructions_cs-CZ'
 - Go to Administration -> System preferences and confirm that the
   OpacLoginInstructions preference has been removed.
 - To test the correct selection of language-specific content you must
   run the translation update/install process for the languages you're
   updating.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 10 Owen Leonard 2020-07-07 18:47:10 UTC
Created attachment 106640 [details] [review]
Bug 23797: (follow-up) Increase the size of opac_news.lang

This patch adds a database update to increase the size of the
opac_news.lang column in order to accommodate longer values.
Comment 11 Owen Leonard 2020-07-07 18:47:14 UTC
Created attachment 106641 [details] [review]
Bug 23797: (follow-up) Enable OpacLoginInstructions in header

The OpacLoginInstructions information should be available in the login
modal which is displayed when the login link in the header menu is
clicked.
Comment 12 Alex Arnaud 2020-07-10 08:01:30 UTC
Created attachment 106760 [details] [review]
Bug 23797: Convert OpacLoginInstructions system preference to news block

This patch builds on Bug 22318 to move the OpacLoginInstructions system
preference into the Koha news system, making it possible to have
language- and library-specific content.

To test you should have some content in the OpacLoginInstructions system
preference. Apply the patch and run the database update process.

 - Go to the OPAC and click the login link.
 - In the login modal, confirm that the content which was previously in
   the OpacLoginInstructions system preference displays correctly
   below the login form.
 - While not logged in to the OPAC, navigate directly to
   /cgi-bin/koha/opac-user.pl. The OpacLoginInstructions content should
   display correctly here as well.
 - In the staff client, go to Tools -> News and verify that the content
   from OpacLoginInstructions is now stored in news items. There
   should be one entry for each of the enabled translations in your
   system, for instance 'OpacLoginInstructions_en',
   'OpacLoginInstructions_fr-FR', 'OpacLoginInstructions_cs-CZ'
 - Go to Administration -> System preferences and confirm that the
   OpacLoginInstructions preference has been removed.
 - To test the correct selection of language-specific content you must
   run the translation update/install process for the languages you're
   updating.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 13 Alex Arnaud 2020-07-10 08:01:33 UTC
Created attachment 106761 [details] [review]
Bug 23797: (follow-up) Increase the size of opac_news.lang

This patch adds a database update to increase the size of the
opac_news.lang column in order to accommodate longer values.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 14 Alex Arnaud 2020-07-10 08:01:37 UTC
Created attachment 106762 [details] [review]
Bug 23797: (follow-up) Enable OpacLoginInstructions in header

The OpacLoginInstructions information should be available in the login
modal which is displayed when the login link in the header menu is
clicked.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 15 Jonathan Druart 2020-07-23 09:39:20 UTC
DB changes were not added to kohastructure.sql
New commit will be added when pushed
  Bug 23797: Apply DB changes to kohastructure.sql
Comment 16 Jonathan Druart 2020-07-23 09:49:21 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 17 Lucas Gass 2020-07-31 19:58:31 UTC
backported to 20.05.x for 20.05.03
Comment 18 Aleisha Amohia 2020-08-03 23:39:27 UTC
enhancement, not backported to 19.11.x