Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
6.1.20 EE GA2, 7.0.0 M3
-
6.2.x, 6.1.x
-
Committed
-
3
-
3
Description
When "Web Content Display" portlet is loading at edition mode, CKEditor takes more time to load than rest of the page. During this loading time its content is blank, so a "save" request of portlet during this time, causes original content to be overwritten with temporal blank content.
There are two use cases for customers:
- When users edit a existing content, they can change a value in a field of the structure (title or other custom field) and save it without waiting CKEditor to be fully initialized.
- When users press "Save as Draft" in a normal situation, they can press the button twice. If the second time is executed after window refresh but before CKEditor initialization, the content is lost.
The problem is easily reproduced in the following situations:
- Using Internet Explorer 8 and Windows XP with an old computer. Because of IE8 JS engine, loading time is increased a lot and there are more chances that users press the save button while CKEditor is not fully loaded.
- With any browser, when the structure is complex and/or has multiple CKEditors, loading time is also increased.
Steps to reproduce with Firefox at Master:
- Create a new Structure and Template using atached repeating_ckeditor_structure.xml and repeating_ckeditor_template.flt.
- Create a new WebContent using those Structures/Templates, edit them at "Web Content Display" portlet
- At repeating field, add six or seven CKEditor copies with some test html.
- Click at "Save as Draft"
- Changes will be summitted to server and page will be refreshed, before content at CKEditor is loaded, press again "Save as Draft" continuosly.
- A second request will be summitted to server with empty contents.
- If we close and reopen the content, we will see that CKEditor are empty
- Note: The bug can be also reproduced using standard structure using IE8 at WinXP.
After an analysis of the problem, I have compiled the following information:
- The root cause is that the form is submitted without first checking if the components of the structure have finished loading.
- Button executes _15_saveArticle() JS function where some checks are done, but there is no checks about loading event. At first time I tried to add some checks at this point.
- But, if button is pressed quickly, before Javascript loading, _15_saveArticle() is not executed and standard HTML Form is submited without using JS, so checks are not executed. (a possible solution is to switch standard button with an AlloyUI Javascript button)
So in my opinion, there are two possible solutions to this issue:
- Add a check at _15_saveArticle() to stop save request if portlet has not been fully loaded. Also change standard HTML button with an AlloyUI Javascript button, to always force the execution of _15_saveArticle()
- Disable the button and enable it by Javascript when the portlet has been fully loaded and all CKEditors are initialized.
Validation cannot be done at Server side because we cannot distinguish if the blank CKEditor field content is caused by this issue or if the customer wants to save a blank content.
Attachments
Issue Links
- causes
-
LPS-45908 Search button disabled
- Closed
-
LPS-70650 Autofocus not being set on Sign In portlet
- Closed
- is duplicated by
-
LPS-36151 Web content overwritten if we save it again in a certain moment
- Verified
- is related to
-
LPE-11856 When saving as a draft in the Web Content Display while the CKEditor is loading content is lost
-
- Closed
-
- relates
-
LPS-56443 At Web Content Display, when "save as draft" is executed while CKEditor loading, its content is lost and blank content is saved in the database (LPS-45613 is reproduced again)
- Closed
-
LPS-56460 At Web Content Display, only for "Basic Web Content": when "save as draft" is executed while CKEditor loading, its content is lost and blank content is saved in the database (same issue than LPS-45613 but only reproduced for "Basic Web Content")
- Closed
-
LPS-36151 Web content overwritten if we save it again in a certain moment
- Verified