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

Iframes with the src pointing to index.html file does not work in the Book module

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.9, 2.9.1, 3.4, 3.5
    • Fix Version/s: None
    • Component/s: Book
    • Labels:
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE

      Description

      If any chapter in the book module has an iframe that is pointing to a file index.html that is uploaded/linked in that chapter, then the iframe simply displays as blank and the user is forced to download an index.html file.
      The index file downloaded is a HTML snippet of the book chapter displayed in Moodle and the iframe code looks like:

      <iframe src="index.html" height="300" width="580"></iframe>
      

      I noted this behavior when I upgraded a Moodle 2.7 site to v2.9 and some iframes in the book did not display. If you renamed the index.html to another name eg index2.html and update the src in the iframe, it displays without any issue. This only happens in the Book if iframe is pointing to a file named index.html. In all other places (page, assignment, forum) the iframes display regardless of the filename.

      I can reproduce this on the Demo Moodle site as well. Screenshots are attached.

        Attachments

        1. backup-moodle29-book.mbz
          3 kB
        2. book1.png
          book1.png
          38 kB
        3. book2.png
          book2.png
          41 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rjnl Rajneel Totaram
              Participants:
              Component watchers:
              David Jones, Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: