Bug 24221

Summary: Convert OPACMySummaryNote system preference to news block
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, josef.moravec, kyle, lucas, shi-yao.wang, testopia
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/665
Text to go in the release notes:
OPACMySummaryNote system preference is converted to a news block. Note that its HTML id is now 'OpacMySummaryNote' instead of 'opac-my-summary-note'.
Version(s) released in:
22.05.00
Bug Depends on: 22880, 27451    
Bug Blocks: 26050    
Attachments: Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents
Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents
Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents
Bug 24221: Improve atomic update
Bug 24221: (follow-up) Remove id opac-my-summary-note

Description Owen Leonard 2019-12-11 19:16:58 UTC
Building on 22318, the OPACMySummaryNote system preference should be converted to a Koha news block.
Comment 1 Lucas Gass 2022-03-01 17:35:38 UTC
Created attachment 131204 [details] [review]
Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents

To test:
1- Before applying the patch add some content to the system preference OPACMySummaryNote
2- Apply patch
3- restart_all and updatedatabase
4. Go to additional-content.pl ( HTML customizations )
5. You should now see your content from the system preference under OpacMySummaryNote in HTML customizations
6. Try searching for the system preference, OPACMySummaryNote. It has been removed and you should not be able to find it.
7. Try changing/removing/adding content from OpacMySummaryNote in HTML customizations
8. Make sure your edits are reflected when you look at the user summary page

Note: The system preference was named OPACMySummaryNote but in to be more consitent with how we have named other additional_contents I have renamed this OpacMySummaryNote.
Comment 2 Shi Yao Wang 2022-03-10 20:00:12 UTC
Patch doesn't apply. At step 7, content doesn't appear when saving the new entry in Additional contents.
Comment 3 Lucas Gass 2022-03-10 20:26:48 UTC
(In reply to shi-yao.wang from comment #2)
> Patch doesn't apply. At step 7, content doesn't appear when saving the new
> entry in Additional contents.

This patch does cleanly apply to current master. As for step 7, I suspect your not adding a title. When I do not add a title to an HTML customization the content does not appear, that is probably a bug but I would request that you file separate bug report. Thanks for testing! 

Resetting this to NSO.
Comment 4 Shi Yao Wang 2022-03-10 20:50:08 UTC
Created attachment 131581 [details] [review]
Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents

To test:
1- Before applying the patch add some content to the system preference OPACMySummaryNote
2- Apply patch
3- restart_all and updatedatabase
4. Go to additional-content.pl ( HTML customizations )
5. You should now see your content from the system preference under OpacMySummaryNote in HTML customizations
6. Try searching for the system preference, OPACMySummaryNote. It has been removed and you should not be able to find it.
7. Try changing/removing/adding content from OpacMySummaryNote in HTML customizations
8. Make sure your edits are reflected when you look at the user summary page

Note: The system preference was named OPACMySummaryNote but in to be more consitent with how we have named other additional_contents I have renamed this OpacMySummaryNote.

Signed-off-by: shiyao <shiyao@inlibro.com>
Comment 5 Lucas Gass 2022-03-10 21:07:03 UTC
Shiyao,

I have created a new bug report for the problem you were experiencing:

See Bug 30272
Comment 6 Jonathan Druart 2022-03-22 12:19:55 UTC
Created attachment 132013 [details] [review]
Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents

To test:
1- Before applying the patch add some content to the system preference OPACMySummaryNote
2- Apply patch
3- restart_all and updatedatabase
4. Go to additional-content.pl ( HTML customizations )
5. You should now see your content from the system preference under OpacMySummaryNote in HTML customizations
6. Try searching for the system preference, OPACMySummaryNote. It has been removed and you should not be able to find it.
7. Try changing/removing/adding content from OpacMySummaryNote in HTML customizations
8. Make sure your edits are reflected when you look at the user summary page

Note: The system preference was named OPACMySummaryNote but in to be more consitent with how we have named other additional_contents I have renamed this OpacMySummaryNote.
Signed-off-by: shiyao <shiyao@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2022-03-22 12:20:00 UTC
Created attachment 132014 [details] [review]
Bug 24221: Improve atomic update

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Fridolin Somers 2022-03-25 20:44:14 UTC
Like other conversions, I've added to DBRev" :
No OpacMySummaryNote preference found. Value was empty or update has already been run.

I add a follow-up to remove the HTML id, like done in Bug 28927 "Fix id opacmainuserblock used twice in OPAC"
Comment 9 Fridolin Somers 2022-03-25 20:44:34 UTC
Created attachment 132264 [details] [review]
Bug 24221: (follow-up) Remove id opac-my-summary-note

Like in other conversions to news block, we do not need an HTML id in
the template, one is created by PROCESS koha_news_block
Comment 10 Fridolin Somers 2022-03-25 21:01:36 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄