-
Bug
-
Resolution: Fixed
-
Minor
-
3.11.7, 4.0.1
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MDL-74766-master -
Steps to reproduce:
- Go to any form using Atto, where that editor is not a required field (e.g. description field at https://qa.moodledemo.net/course/modedit.php?add=page&type=&course=2§ion=0)
- (Fill in any other required fields in the forum.)
- Open browser developer tools, and swtich to the network tab.
- Switch the Description Atto editor to 'HTML source' view.
- (You should see that the editor contains the standard blank content <p dir="ltr" style="text-align: left;"><br></p>.)
- Submit the form, and look at the POST request that was sent to the server.
Expected result:
If you miss out step 4, and submit the form with the editor in WYSIWYG mode, then the behaviour is correct. The content of the editor is submitted as an empty string:
This is because of the clean-up code which uses these values https://github.com/moodle/moodle/blob/1a744030d639f93f2a147d40f0a38572fa0f846d/lib/editor/atto/yui/src/editor/js/clean.js#L57.
Actual result:
In HTML source mode, the clean-up is not applied and junk HTML is submitted in the POST request.
Related to this, if you try similar experimentation with required Atto form fields (e.g. Page content in the form linked to above) then you will find that the client-side vaidation of required fields is never triggered with the editor in HTML source view. This should also be fixed but this issue will be enhanced in another ticket.
- is duplicated by
-
MDL-73499 Vertical space added to topic summary with no actual change
- Closed