Bug 28525 - TinyMCE for system prefs does some automatic code clean up
Summary: TinyMCE for system prefs does some automatic code clean up
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-07 22:12 UTC by Lucas Gass
Modified: 2021-08-31 04:32 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.03,20.11.10


Attachments
Bug 28525: Dont let TinyMCE do code cleanup (1.80 KB, patch)
2021-06-07 22:23 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 28525: Dont let TinyMCE do code cleanup (1.86 KB, patch)
2021-08-10 17:50 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 28525: Dont let TinyMCE do code cleanup (1.92 KB, patch)
2021-08-17 22:20 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 28525: Dont let TinyMCE do code cleanup (2.22 KB, patch)
2021-08-18 13:10 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2021-06-07 22:12:38 UTC
If you look at Bug 24764 and Bug 26942 we adjusted the TinyMCE for the News tool so it will not do some types of automatic code clean up. 

The TinyMCE editor for system preferences which can be enabled by 'UseWYSIWYGinSystemPreferences' has the same problems. 

We should make the configurations the same.
Comment 1 Lucas Gass 2021-06-07 22:23:01 UTC
Created attachment 121698 [details] [review]
Bug 28525: Dont let TinyMCE do code cleanup

To Test:
1. Turn on 'UseWYSIWYGinSystemPreferences'
2. Go to a system preference like 'RestrictedPageContent'
3. Try entering something like '<i class="fa fa-facebook-official" aria-hidden="true">TEST</i>' in the Source Code window
4. It gets cleaned up by the editor
5. Try something like '<a href="https://www.test.com" referrerpolicy="&quot;no-referrer-when-downgrade">TEST</a>'
6. It's cleaned up by the editor.
7. Try something like '<link href="https://fonts.googleapis.com/css?family=Open+Sans” rel=“stylesheet">'
8. Cleaned up by editor.
9. Apply patch
10. Try step 3, 5, and 7 again.
11. It should not be changed by the editor
Comment 2 sandboxes@biblibre.com 2021-08-10 17:50:27 UTC
Created attachment 123717 [details] [review]
Bug 28525: Dont let TinyMCE do code cleanup

To Test:
1. Turn on 'UseWYSIWYGinSystemPreferences'
2. Go to a system preference like 'RestrictedPageContent'
3. Try entering something like '<i class="fa fa-facebook-official" aria-hidden="true">TEST</i>' in the Source Code window
4. It gets cleaned up by the editor
5. Try something like '<a href="https://www.test.com" referrerpolicy="&quot;no-referrer-when-downgrade">TEST</a>'
6. It's cleaned up by the editor.
7. Try something like '<link href="https://fonts.googleapis.com/css?family=Open+Sans” rel=“stylesheet">'
8. Cleaned up by editor.
9. Apply patch
10. Try step 3, 5, and 7 again.
11. It should not be changed by the editor

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 3 Katrin Fischer 2021-08-17 22:20:47 UTC
Created attachment 123919 [details] [review]
Bug 28525: Dont let TinyMCE do code cleanup

To Test:
1. Turn on 'UseWYSIWYGinSystemPreferences'
2. Go to a system preference like 'RestrictedPageContent'
3. Try entering something like '<i class="fa fa-facebook-official" aria-hidden="true">TEST</i>' in the Source Code window
4. It gets cleaned up by the editor
5. Try something like '<a href="https://www.test.com" referrerpolicy="&quot;no-referrer-when-downgrade">TEST</a>'
6. It's cleaned up by the editor.
7. Try something like '<link href="https://fonts.googleapis.com/css?family=Open+Sans” rel=“stylesheet">'
8. Cleaned up by editor.
9. Apply patch
10. Try step 3, 5, and 7 again.
11. It should not be changed by the editor

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2021-08-18 13:10:52 UTC
Created attachment 123959 [details] [review]
Bug 28525: Dont let TinyMCE do code cleanup

If you look at Bug 24764 and Bug 26942 we adjusted the TinyMCE for the News tool so it will not do some types of automatic code clean up.

The TinyMCE editor for system preferences which can be enabled by 'UseWYSIWYGinSystemPreferences' has the same problems.

We should make the configurations the same.

To Test:
1. Turn on 'UseWYSIWYGinSystemPreferences'
2. Go to a system preference like 'RestrictedPageContent'
3. Try entering something like '<i class="fa fa-facebook-official" aria-hidden="true">TEST</i>' in the Source Code window
4. It gets cleaned up by the editor
5. Try something like '<a href="https://www.test.com" referrerpolicy="&quot;no-referrer-when-downgrade">TEST</a>'
6. It's cleaned up by the editor.
7. Try something like '<link href="https://fonts.googleapis.com/css?family=Open+Sans” rel=“stylesheet">'
8. Cleaned up by editor.
9. Apply patch
10. Try step 3, 5, and 7 again.
11. It should not be changed by the editor

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2021-08-18 13:36:29 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 6 Kyle M Hall 2021-08-20 18:00:40 UTC
Pushed to 21.05.x for 21.05.03
Comment 7 Fridolin Somers 2021-08-27 19:10:26 UTC
Pushed to 20.11.x for 20.11.10
Comment 8 Victor Grousset/tuxayo 2021-08-31 04:32:35 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.