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

Page validation fails when Resource Summary contains HTML tags

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.8.3, 1.9
    • 1.8.3
    • Accessibility
    • None
    • MySQL
    • MOODLE_18_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

      To reproduce the bug:

      1. in a course, create a resource of type "Display Folder"
      2. in the Summary field enter a simple text, WITHOUT formatting it by the HTML editor
      3. select any folder to display
      3. save the resource
      4. try validating the page: the pages validates correctly
      5. Now, edit the above resource and using the HTML editor, format the summary text using Heading 1 or Heading 2, thus adding h1 or h2 HTML tags.
      6. save the resource
      7. try validating the page: the page fails validation, due to h1 or h2 tags contained inside an opened <p> tag.

      The problem seems to be related to the presence of an open <p> tag inserted by the PHP code just before printing the summary HTML. The problem affects any resource containing an HTML formatted summary: for example, if creating a web page resource with HTML formatted summary, the Resource page list (the page where all the course resources are listed) does not validate; removing any HTML format from teh summaries, the page validates.

      Workaround:
      manually add a closing </p> tag on top of summary HTML and a opening <p> tag on bottom of summary HTML. This workaround is really error prone.

      Possible solution:
      remove the opening <p> and closing </p> form the php code

            lazyfish Yu Zhang
            andreabix Andrea Bicciolo
            Nicolas Martignoni Nicolas Martignoni
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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