[Bug 21131] New: Changing and restoring a WYSIWYG preference can result in unexpected behaviour
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 Bug ID: 21131 Summary: Changing and restoring a WYSIWYG preference can result in unexpected behaviour Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com If you're using the WYSIWYG editor for system preferences, the TinyMCE editor will update the system preference text editor when the content is different to the content that the editor started with when the page was loaded. If you change the content and then change it back to the original content, the editor will actually use the last "different" content. Eg: TinyMCE Editor: 123a Textarea: 123a TinyMce Editor: 123 Textarea: 123 TinyMce Editor: 123a Textarea: 123 This is due to (my) overzealous use of the "TinyMCE.isDirty()" function. I'll just strip it out and everything will be fine. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 77322 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77322&action=edit Bug 21131 - Changing and restoring a WYSIWYG preference can result in unexpected behaviour When using the WYSIWYG editor for system preferences, the editor only updates the textarea element if the content is different from the original content. This means if you change a system preference and then change it back to the original content, the textarea will have the 2nd last change you made. This patch removes the TinyMCE.isDirty() check, which was responsible for comparing the original and changed content. Every input/keydown/dragend or TinyMCE command will cause the textarea element to be updated and trigger the input event which causes the "modified" class to be added to the element, so that the system preference can be saved. __TEST PLAN__ _Before applying_ 0. Change "UseWYSIWYGinSystemPreferences" to "Show" 1. Change "opaccredits" to "123a" 2. Click "Save all OPAC preferences" 3. Reload the page 4. Change "opaccredits" to "123" 5. Change "opaccredits" to "123a" 6. Click "Save all OPAC preferences" 7. Reload the page 8. Note that "opaccredits" says "123" _Apply the patch_ _After applying_ 1. Change "opaccredits" to "123a" 2. Change "opaccredits" to "123" 3. Click "Save all OPAC preferences" 4. Reload the page 5. Note that "opaccredits" says "123" (and not "123a") 6. Change "opaccredits" to "1234" 7. Click "Save all OPAC preferences" 8. Reload the page 9. Note that "opaccredits" says "1234" -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #77322|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 77389 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77389&action=edit Bug 21131 - Changing and restoring a WYSIWYG preference can result in unexpected behaviour When using the WYSIWYG editor for system preferences, the editor only updates the textarea element if the content is different from the original content. This means if you change a system preference and then change it back to the original content, the textarea will have the 2nd last change you made. This patch removes the TinyMCE.isDirty() check, which was responsible for comparing the original and changed content. Every input/keydown/dragend or TinyMCE command will cause the textarea element to be updated and trigger the input event which causes the "modified" class to be added to the element, so that the system preference can be saved. __TEST PLAN__ _Before applying_ 0. Change "UseWYSIWYGinSystemPreferences" to "Show" 1. Change "opaccredits" to "123a" 2. Click "Save all OPAC preferences" 3. Reload the page 4. Change "opaccredits" to "123" 5. Change "opaccredits" to "123a" 6. Click "Save all OPAC preferences" 7. Reload the page 8. Note that "opaccredits" says "123" _Apply the patch_ _After applying_ 1. Change "opaccredits" to "123a" 2. Change "opaccredits" to "123" 3. Click "Save all OPAC preferences" 4. Reload the page 5. Note that "opaccredits" says "123" (and not "123a") 6. Change "opaccredits" to "1234" 7. Click "Save all OPAC preferences" 8. Reload the page 9. Note that "opaccredits" says "1234" Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #77389|0 |1 is obsolete| | --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 77390 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77390&action=edit Bug 21131: Remove the TinyMCE.isDirty() check that caused unexpected behaviour When using the WYSIWYG editor for system preferences, the editor only updates the textarea element if the content is different from the original content. This means if you change a system preference and then change it back to the original content, the textarea will have the 2nd last change you made. This patch removes the TinyMCE.isDirty() check, which was responsible for comparing the original and changed content. Every input/keydown/dragend or TinyMCE command will cause the textarea element to be updated and trigger the input event which causes the "modified" class to be added to the element, so that the system preference can be saved. __TEST PLAN__ _Before applying_ 0. Change "UseWYSIWYGinSystemPreferences" to "Show" 1. Change "opaccredits" to "123a" 2. Click "Save all OPAC preferences" 3. Reload the page 4. Change "opaccredits" to "123" 5. Change "opaccredits" to "123a" 6. Click "Save all OPAC preferences" 7. Reload the page 8. Note that "opaccredits" says "123" _Apply the patch_ _After applying_ 1. Change "opaccredits" to "123a" 2. Change "opaccredits" to "123" 3. Click "Save all OPAC preferences" 4. Reload the page 5. Note that "opaccredits" says "123" (and not "123a") 6. Change "opaccredits" to "1234" 7. Click "Save all OPAC preferences" 8. Reload the page 9. Note that "opaccredits" says "1234" Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi David, we standardized the commit messages a bit more: https://wiki.koha-community.org/wiki/Commit_messages - Start with Bug XXXX: - Describe the fix in the subject, not the problem :) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #4)
Hi David, we standardized the commit messages a bit more: https://wiki.koha-community.org/wiki/Commit_messages - Start with Bug XXXX: - Describe the fix in the subject, not the problem :)
Thanks, Katrin. I actually wrote to koha-devel asking about https://wiki.koha-community.org/wiki/Commit_messages#Examples, when I was writing up this bug report, because I didn't understand the examples. But I realize now that the page actually starts with https://wiki.koha-community.org/wiki/Commit_messages#Good_commit_messages. I had no idea! But according to https://wiki.koha-community.org/wiki/Commit_messages#Subject_line, the prototypical example seems to describe the problem and not the fix :S. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- Btw, I am super duper happy to follow a standard, so long as I actually know what the standard is... I see in https://wiki.koha-community.org/wiki/Commit_messages#Good_commit_messages_2 that the subject line describes the fix and not the problem though. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |martin.renvoize@ptfs-europe | |.com --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.05.x for 18.05.03 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21131 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED CC| |fridolin.somers@biblibre.co | |m --- Comment #9 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.11.x for 17.11.10 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org