Bug 22659

Summary: Add 'save and continue' functionality to news and HTML customizations
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ToolsAssignee: Lucas Gass (lukeg) <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: arthur.suzuki, barbara.johnson, caroline.cyr-la-rose, dcook, jonathan.druart, josef.moravec, lisettepalouse+koha, lucas, magnus, sally.healey, severine.queune, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22318
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23824
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/679
Text to go in the release notes:
Adds the ability to save & continue when working with either News or HTML customization editors.
Version(s) released in:
22.11.00, 22.05.04, 21.11.11
Circulation function:
Attachments: Bug 22659: Add save and continue button to additional-contents.tt
Bug 22659: Add save and continue button to additional-contents.tt
Bug 22659: Add save and continue button to additional-contents.tt
Bug 22659: Add save and continue button to additional-contents.tt
Bug 22659: Add save and continue button to additional-contents.tt
Bug 22659: (follow-up) Add category to redirect
Bug 22659: Add save and continue button to additional-contents.tt
Big 22659: (follow-up) Add category to redirect
Bug 22659: Add save and continue button to additional-contents.tt
Big 22659: (follow-up) Add category to redirect
Bug 22659: Add save and continue button to additional-contents.tt
Big 22659: (follow-up) Add category to redirect
Bug 22659: (follow-up) Add category to redirect
Bug 22659: Add save and continue button to additional-contents.tt
Bug 22659: (follow-up) Add category to redirect

Description Katrin Fischer 2019-04-08 18:07:36 UTC
When working on news and soon other content blocks it would be nice if it would be possible to save and continue. This would allow to check how something look sin the OPAC, adjust, save... and continue without the need to look for the entry in the list again saving some clicks.

This will especially be important with bug 22318 as the system preferences editor already allows it.
Comment 1 Owen Leonard 2020-09-11 17:46:43 UTC
*** Bug 26437 has been marked as a duplicate of this bug. ***
Comment 2 Lucas Gass (lukeg) 2021-10-20 17:32:46 UTC
Created attachment 126593 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and open a News item
3. Notice a Save and continue button
4. Make some changes and use the Save and continue button, making sure it works.
5. Make sure it works using both the text (CodeMirror) editor and wysiwyg (TinyMCE) editor
6. Flip the 'AdditionalContentsEditor' system preference and repeat steps 4 & 5.
7. Turn on the NewsLog system preference
8. Make some changes and make sure those changes get logged when you use the Save and continue button
Comment 3 PTFS Europe Sandboxes 2021-10-26 16:06:36 UTC
Created attachment 126929 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and open a News item
3. Notice a Save and continue button
4. Make some changes and use the Save and continue button, making sure it works.
5. Make sure it works using both the text (CodeMirror) editor and wysiwyg (TinyMCE) editor
6. Flip the 'AdditionalContentsEditor' system preference and repeat steps 4 & 5.
7. Turn on the NewsLog system preference
8. Make some changes and make sure those changes get logged when you use the Save and continue button

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 4 Katrin Fischer 2021-10-31 12:19:39 UTC
Created attachment 127133 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and open a News item
3. Notice a Save and continue button
4. Make some changes and use the Save and continue button, making sure it works.
5. Make sure it works using both the text (CodeMirror) editor and wysiwyg (TinyMCE) editor
6. Flip the 'AdditionalContentsEditor' system preference and repeat steps 4 & 5.
7. Turn on the NewsLog system preference
8. Make some changes and make sure those changes get logged when you use the Save and continue button

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2021-10-31 12:21:49 UTC
Really nice little addition to round up the work done in this area.
Comment 6 Katrin Fischer 2021-10-31 12:23:41 UTC
I am sorry, just as I was done I thought about another thing to test:

- Add a new additional contents entry
- Try to save and continue without adding anything - mandatory fields complaint
- Fill in code and other content
- save and continue - no complaint, but the code will be empty again :(
Comment 7 Katrin Fischer 2021-10-31 12:25:21 UTC
Another little bug:
The save and continue changes your form from "additional contents" to "news" with the bug mentioned above.
Comment 8 Lucas Gass (lukeg) 2022-02-03 22:38:15 UTC
Created attachment 130155 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and create some new additional content.
3. Notice a Save and continue button
4. Try saving and contining.
5. Make sure if you are using the CodeMirror editor that you are still in the CodeMirror editor
6. Try 2 - 5 again but with the wysiwyg editor, make sure when you save and continue you remain in the wysiwyg editor.
7. If you are saving and contining from News make sure you remain in News, when you are saving and contining from HTML customizations make sure you remain there.
8. Turn on the NewsLog system preference
9. With the NewsLog on make sure your content is being logged correctly when you sabe and continue.
Comment 9 Biblibre Sandboxes 2022-02-07 16:23:25 UTC
Created attachment 130238 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and create some new additional content.
3. Notice a Save and continue button
4. Try saving and contining.
5. Make sure if you are using the CodeMirror editor that you are still in the CodeMirror editor
6. Try 2 - 5 again but with the wysiwyg editor, make sure when you save and continue you remain in the wysiwyg editor.
7. If you are saving and contining from News make sure you remain in News, when you are saving and contining from HTML customizations make sure you remain there.
8. Turn on the NewsLog system preference
9. With the NewsLog on make sure your content is being logged correctly when you sabe and continue.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 10 Sally 2022-02-07 16:25:03 UTC
Tested with the original and amended test plans.  Works great, thanks for the patch - this is a superb idea!
Comment 11 Katrin Fischer 2022-03-27 01:17:36 UTC
(In reply to Katrin Fischer from comment #7)
> Another little bug:
> The save and continue changes your form from "additional contents" to "news"
> with the bug mentioned above.

I am sorry, but I am still seeing this bug:

1) Add a new HTML customization
2) Leave title empty
3) Save and continue
4) Breadcrumbs and headings have changed to news

This might relate to some other bugs we have in this area - adding Joubu.
Comment 12 Lucas Gass (lukeg) 2022-03-28 20:52:19 UTC
Created attachment 132365 [details] [review]
Bug 22659: (follow-up) Add category to redirect
Comment 13 Séverine Queune 2022-04-04 14:10:08 UTC
If I follow Katrin's test plan :
  1) Add a new HTML customization
  2) Leave title empty
  3) Save and continue
--> no more redirection problems Katrin found, but the 'Content' field is reset

This problem (or expected behaviour ?) exists for 'News' menu but only for the language specific tabs.
For 'Default' tab, we have a warning pop-up asking to specify a title.
I think it should be the same for 'HTML customization' menu.

I also noticed that for HTML menu, it's possible to save a content only for a specific language without any content in 'Default' : is that expected ?
Comment 14 Lucas Gass (lukeg) 2022-04-06 17:31:00 UTC
>   1) Add a new HTML customization
>   2) Leave title empty
>   3) Save and continue
> --> no more redirection problems Katrin found, but the 'Content' field is
> reset
> 
> This problem (or expected behaviour ?) exists for 'News' menu but only for
> the language specific tabs.
> For 'Default' tab, we have a warning pop-up asking to specify a title.
> I think it should be the same for 'HTML customization' menu.
> 
> I also noticed that for HTML menu, it's possible to save a content only for
> a specific language without any content in 'Default' : is that expected ?

Séverine,

Thanks for testing. I believe you are now experiencing a bug that I filed:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30272

This happens with or without my patch for this bug.
Comment 15 Biblibre Sandboxes 2022-05-10 09:01:48 UTC
Created attachment 134802 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and create some new additional content.
3. Notice a Save and continue button
4. Try saving and contining.
5. Make sure if you are using the CodeMirror editor that you are still in the CodeMirror editor
6. Try 2 - 5 again but with the wysiwyg editor, make sure when you save and continue you remain in the wysiwyg editor.
7. If you are saving and contining from News make sure you remain in News, when you are saving and contining from HTML customizations make sure you remain there.
8. Turn on the NewsLog system preference
9. With the NewsLog on make sure your content is being logged correctly when you sabe and continue.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 16 Biblibre Sandboxes 2022-05-10 09:02:07 UTC
Created attachment 134803 [details] [review]
Big 22659: (follow-up) Add category to redirect

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 17 Biblibre Sandboxes 2022-05-10 09:02:12 UTC
Created attachment 134804 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and create some new additional content.
3. Notice a Save and continue button
4. Try saving and contining.
5. Make sure if you are using the CodeMirror editor that you are still in the CodeMirror editor
6. Try 2 - 5 again but with the wysiwyg editor, make sure when you save and continue you remain in the wysiwyg editor.
7. If you are saving and contining from News make sure you remain in News, when you are saving and contining from HTML customizations make sure you remain there.
8. Turn on the NewsLog system preference
9. With the NewsLog on make sure your content is being logged correctly when you sabe and continue.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 18 Biblibre Sandboxes 2022-05-10 09:02:18 UTC
Created attachment 134805 [details] [review]
Big 22659: (follow-up) Add category to redirect

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 19 Sally 2022-05-10 09:07:31 UTC
I think the sandbox had a few issues submitting that sign off; sorry for the noise.

Apologies, Katrin - I initially missed that additional test you found.  All  tests working fine for me now with Lucas' follow up - but I do see the same issues Séverine has listed.

It's hard to untangle what is this bug and what's normal behaviour - 29828 and 30272 are both having an impact, but as Lucas says, it seems they're both existing issues that this bug hasn't changed.
Comment 20 Jonathan Druart 2022-05-31 07:48:28 UTC
Created attachment 135471 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and create some new additional content.
3. Notice a Save and continue button
4. Try saving and contining.
5. Make sure if you are using the CodeMirror editor that you are still in the CodeMirror editor
6. Try 2 - 5 again but with the wysiwyg editor, make sure when you save and continue you remain in the wysiwyg editor.
7. If you are saving and contining from News make sure you remain in News, when you are saving and contining from HTML customizations make sure you remain there.
8. Turn on the NewsLog system preference
9. With the NewsLog on make sure your content is being logged correctly when you sabe and continue.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 21 Jonathan Druart 2022-05-31 07:48:33 UTC
Created attachment 135472 [details] [review]
Big 22659: (follow-up) Add category to redirect

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 22 Jonathan Druart 2022-05-31 07:49:38 UTC
Created attachment 135473 [details] [review]
Bug 22659: (follow-up) Add category to redirect

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 23 Tomás Cohen Arazi (tcohen) 2022-06-24 14:52:53 UTC
Please rebase ASAP. Thanks.
Comment 24 Lucas Gass (lukeg) 2022-06-24 15:28:33 UTC
Created attachment 136523 [details] [review]
Bug 22659: Add save and continue button to additional-contents.tt

To test:
1. Apply patch and restart everything
2. Go to Tools > News and create some new additional content.
3. Notice a Save and continue button
4. Try saving and contining.
5. Make sure if you are using the CodeMirror editor that you are still in the CodeMirror editor
6. Try 2 - 5 again but with the wysiwyg editor, make sure when you save and continue you remain in the wysiwyg editor.
7. If you are saving and contining from News make sure you remain in News, when you are saving and contining from HTML customizations make sure you remain there.
8. Turn on the NewsLog system preference
9. With the NewsLog on make sure your content is being logged correctly when you sabe and continue.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 25 Lucas Gass (lukeg) 2022-06-24 15:28:38 UTC
Created attachment 136524 [details] [review]
Bug 22659: (follow-up) Add category to redirect

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 26 Lucas Gass (lukeg) 2022-06-24 15:30:08 UTC
rebased for current master and reset to NSO
Comment 27 Tomás Cohen Arazi (tcohen) 2022-06-24 17:55:15 UTC
This was actually PQA :-D
Comment 28 Tomás Cohen Arazi (tcohen) 2022-06-25 14:17:53 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 29 Lucas Gass (lukeg) 2022-07-29 16:08:31 UTC
Backported to 22.05.x for 22.05.04
Comment 30 Arthur Suzuki 2022-08-11 10:00:19 UTC
backported to 21.11.x for 21.11.11
Comment 31 Victor Grousset/tuxayo 2022-08-13 16:20:56 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.