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

Page validation fails when Resource Summary contains HTML tags

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.3
    • Fix Version/s: 1.8.3, 1.9
    • Component/s: Accessibility
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      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

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Oct/07