Bug 23798 - Convert OpacMaintenanceNotice system preference to additional contents
Summary: Convert OpacMaintenanceNotice system preference to additional contents
Status: RESOLVED 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: Marcel de Rooy
URL:
Keywords:
Depends on: 22318 22880
Blocks: 26050 34869
  Show dependency treegraph
 
Reported: 2019-10-10 18:43 UTC by Owen Leonard
Modified: 2023-12-11 21:04 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/777
Text to go in the release notes:
Version(s) released in:
23.11.00


Attachments
Bug 23798: Convert OpacMaintenanceNotice system preference to additional contents (12.84 KB, patch)
2023-10-16 18:06 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23798: Convert OpacMaintenanceNotice system preference to additional contents (12.63 KB, patch)
2023-10-19 17:52 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23798: Convert OpacMaintenanceNotice system preference to additional contents (12.68 KB, patch)
2023-10-21 01:03 UTC, David Nind
Details | Diff | Splinter Review
Bug 23798: (follow-up) Add entry to HTML customization help include (1.10 KB, patch)
2023-10-25 15:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23798: Convert OpacMaintenanceNotice system preference to additional contents (12.78 KB, patch)
2023-10-26 11:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23798: (follow-up) Add entry to HTML customization help include (1.10 KB, patch)
2023-10-26 11:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23798: Convert OpacMaintenanceNotice system preference to additional contents (12.88 KB, patch)
2023-11-03 08:02 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 23798: (follow-up) Add entry to HTML customization help include (1.19 KB, patch)
2023-11-03 08:02 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 23798: (follow-up) Revise database update following Bug 31383 (2.06 KB, patch)
2023-11-08 16:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23798: Atomic update fixes (1.58 KB, patch)
2023-11-08 17:55 UTC, Tomás Cohen Arazi
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:43:51 UTC
Building on 22318, the OpacMaintenanceNotice system preference should be converted to a Koha news block.
Comment 1 Owen Leonard 2020-03-24 15:59:42 UTC
Reconsidered this: Since it's tied to the OpacMaintenance system preference it's probably better to leave it be.
Comment 2 Katrin Fischer 2020-03-24 16:43:26 UTC
Hm, not sure - but I think the need for multi-lingual is valid for this one as well. When you need to turn the catalog off, it's good to let everyone know :)
Comment 3 Owen Leonard 2023-10-16 18:06:42 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2023-10-19 17:52:41 UTC Comment hidden (obsolete)
Comment 5 David Nind 2023-10-21 01:03:03 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2023-10-25 15:47:16 UTC Comment hidden (obsolete)
Comment 7 Owen Leonard 2023-10-26 11:30:06 UTC Comment hidden (obsolete)
Comment 8 Owen Leonard 2023-10-26 11:30:08 UTC Comment hidden (obsolete)
Comment 9 Owen Leonard 2023-10-26 11:33:01 UTC
I revised the patch so that the database update would work after Bug 31383. I should have added a follow-up but I was rebasing anyway. QA please feel free to set back to "needs signoff."
Comment 10 Marcel de Rooy 2023-11-03 08:02:51 UTC
Created attachment 158308 [details] [review]
Bug 23798: Convert OpacMaintenanceNotice system preference to additional contents

This patch moves the OpacMaintenanceNotice system preference into HTML
customizations, making it possible to have language-specific content.

The patch modifies the OPAC maintenance page template so that the
language selection menu can be shown correctly according to the
OpacLangSelectorMode preference.

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

- In the staff client, go to Tools -> HTML customizations and verify
  that the content from OpacMaintenanceNotice is now stored there.
- The HTML customization entry form should offer OpacMaintenanceNotice
  as a choice under "Display location."
- Update and reinstall active translations (for instance fr-FR):
  - perl misc/translator/translate update fr-FR
  - perl misc/translator/translate install fr-FR
- Enable the translation if necessary under Administration -> System
  preferences -> language.
- Enable the "opaclanguagesdisplay" preference if necessary.
- Enable the "OpacMaintenance" system preference.
- Edit the OpacMaintenanceNotice HTML customization and add unique
  content to the "fr-FR" tab.

- Try to view any page in the OPAC. You should see the content you
  added to the OpacMaintenanceNotice HTML customization.
- Switch to your updated translation. The page should redisplay with
  your translated content.
- Go to Administration -> System preferences and search for
  "OpacMaintenanceNotice." The search should return no
  results.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Marcel de Rooy 2023-11-03 08:02:53 UTC
Created attachment 158309 [details] [review]
Bug 23798: (follow-up) Add entry to HTML customization help include

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Tomás Cohen Arazi 2023-11-08 14:04:39 UTC
This explodes if `OpacMaintenanceNotice` is not empty. Known cause:

DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug-23798-move-OpacMaintenanceNotice-to-additional-contents.pl  [14:03:46]: Bug 23798 - Convert OpacMaintenanceNotice system preference to additional contents
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Unknown column 'title' in 'field list' at /kohadevbox/koha/C4/Installer.pm line 741
Comment 13 Owen Leonard 2023-11-08 16:59:05 UTC
Created attachment 158667 [details] [review]
Bug 23798: (follow-up) Revise database update following Bug 31383
Comment 14 Owen Leonard 2023-11-08 17:00:02 UTC
> Bug 23798: (follow-up) Revise database update following Bug 31383

This follow-up makes the same change to the database update that I did for the other similar patches, but I understand if anyone wants this to go through QA again.
Comment 15 Tomás Cohen Arazi 2023-11-08 17:42:21 UTC
(In reply to Owen Leonard from comment #14)
> > Bug 23798: (follow-up) Revise database update following Bug 31383
> 
> This follow-up makes the same change to the database update that I did for
> the other similar patches, but I understand if anyone wants this to go
> through QA again.

All good, I test it again before pushing anyway.
Comment 16 Tomás Cohen Arazi 2023-11-08 17:55:19 UTC
Created attachment 158669 [details] [review]
Bug 23798: Atomic update fixes

This patch makes the atomic update remove the syspref even if it wasn't
previously set. It also tweaks the printed information to comform with
current practices.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 17 Tomás Cohen Arazi 2023-11-08 20:42:33 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 18 Fridolin Somers 2023-11-11 01:18:37 UTC
Enhancement not pushed to 23.05.x