Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-45533

Atto editor form element: placeholder breaks "required filed" validation.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test

      Try on all supported browsers

      1. Open a page where Atto is used for a required field
      2. Click in Atto, and click out.
      3. Make sure you cannot submit the field is considered "empty"
      4. Add some text, and submit
      5. Make sure this time you could

      Regression testing

      Stolen from MDL-44063

      1. In ie9, ie11, firefox, chrome, safari, ios safari, android stock
      2. Open atto on a page with no text already entered in the editor (exmaple: new blog entry)
      3. focus on the editor and type some text
      4. Hit enter - the content should be split into 2 paragraphs (with some margin between them)
      5. convert the 2 paragraphs to a list
      6. hit enter twice on the second list item to break out of the list
      7. the content after the list should be in a paragraph
      8. hit enter again and the paragraph after the lsit should be split into 2 paragraphs

      Testing notes: To see the if the content is in a paragraph, right click and inspect it (do not rely on html view because there is a little magic there).
      In firefox it is possible to use the arrow keys or by tabbing to a text field - to position the cursor outside of the first paragraph, typing then insert text directly into the div. This is a firefox bug and we should not work around it IMO. Please also note the existing issue: MDL-44812

      Show
      Test Try on all supported browsers Open a page where Atto is used for a required field Click in Atto, and click out. Make sure you cannot submit the field is considered "empty" Add some text, and submit Make sure this time you could Regression testing Stolen from MDL-44063 In ie9, ie11, firefox, chrome, safari, ios safari, android stock Open atto on a page with no text already entered in the editor (exmaple: new blog entry) focus on the editor and type some text Hit enter - the content should be split into 2 paragraphs (with some margin between them) convert the 2 paragraphs to a list hit enter twice on the second list item to break out of the list the content after the list should be in a paragraph hit enter again and the paragraph after the lsit should be split into 2 paragraphs Testing notes: To see the if the content is in a paragraph, right click and inspect it (do not rely on html view because there is a little magic there). In firefox it is possible to use the arrow keys or by tabbing to a text field - to position the cursor outside of the first paragraph, typing then insert text directly into the div. This is a firefox bug and we should not work around it IMO. Please also note the existing issue: MDL-44812
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:

      Description

      Just spotted the problem on some forms - when the new empty form is created, there is a placeholder "<p><br></p>"already in place (see updateFromTextArea in ./lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js) This basically make validation think that the field is not empty (while in fact it is empty), so you may submit empty content.

      The above can be demonstrated using the forum:
      http://youtu.be/FnAKx5hpbg0

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fred Frédéric Massart
              Reporter:
              kabalin Ruslan Kabalin
              Peer reviewer:
              Andrew Nicols
              Integrator:
              Damyon Wiese
              Tester:
              Ankit Agarwal
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jul/14