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

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

XMLWordPrintable

    • MOODLE_24_STABLE
    • MOODLE_25_STABLE
    • MDL-38426_dnd_plain_text
    • 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

      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);
      }
      

      "

            davosmith Davo Smith
            szuta Patryk Szuta
            Damyon Wiese Damyon Wiese
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.