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

Handle plain text content type for a drag and drop event in mod/label

    Details

    • Testing Instructions:
      Hide
      1. Turn on dnd upload of text (in experimental settings)
      2. Drag some plain text onto a course (Gedit works under Linux, maybe Notepad under Windows?)
      3. Create a label
        1. Check that the line breaks are retained
      4. Drag some HTML text (out of another window of the same browser)
      5. Create another label
        1. Check that the HTML formatting is retained

      As always with drag and drop - Firefox, Chrome, Safari, IE10

      Show
      Turn on dnd upload of text (in experimental settings) Drag some plain text onto a course (Gedit works under Linux, maybe Notepad under Windows?) Create a label Check that the line breaks are retained Drag some HTML text (out of another window of the same browser) Create another label Check that the HTML formatting is retained As always with drag and drop - Firefox, Chrome, Safari, IE10
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-38426_dnd_plain_text

      Description

      Dropping plain text with line breaks isn't handled correctly by mod/label: the line breaks disappear. Davo suggests that the fix is:

      "The correct fix is going to be similar to the code in mod/page/lib.php, page_dndupload_handle:

      if ($uploadinfo->type == 'text/html') {
          $data->contentformat = FORMAT_HTML; $data->content = clean_param($uploadinfo->content, PARAM_CLEANHTML);
      } 
      else {
          $data->contentformat = FORMAT_PLAIN; $data->content = clean_param($uploadinfo->content, PARAM_TEXT);
      }
      

      "

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13