Moodle
  1. Moodle
  2. MDL-24333

home page breaks xhtml strict if "combo list" is shown

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Other
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      27320

      Description

      set "Site administration > Front page > Front page settings > Front page items when logged in" to "Combo list".
      Go to the home page of your moodle installation (with at least a course, of course) and ask for w3c validation.
      You will find that the code:

      <div class="category with_children">
          <div class="category_label">
              <a class="category_link" href="http://localhost:8888/moodle20/course/category.php?id=1">Category name</a>
          </div>
          <div class="courses">
              <div class="course odd">
                  <a class="course_link" href="http://localhost:8888/moodle20/course/view.php?id=2">
                      <div class="text_to_html">
                          Course name
                      </div>
                  </a>
                  <div class="course_info clearfix">
                      <a title="Summary" href="http://localhost:8888/moodle20/course/info.php?id=2"><img src="http://localhost:8888/moodle20/theme/image.php?theme=formal_white&amp;image=i%2Finfo" alt="Summary" /></a>
                  </div>
              </div>
          </div>
      </div>

      generates a problem.
      The problem is that the tag <div> is not allowed inside the tag <a>, so the code should be:

      <div class="category with_children">
          <div class="category_label">
              <a class="category_link" href="http://localhost:8888/moodle20/course/category.php?id=1">Category name</a>
          </div>
          <div class="courses">
              <div class="course odd">
                  <a class="course_link" href="http://localhost:8888/moodle20/course/view.php?id=2">Course name</a>
                  <div class="course_info clearfix">
                      <a title="Summary" href="http://localhost:8888/moodle20/course/info.php?id=2"><img src="http://localhost:8888/moodle20/theme/image.php?theme=formal_white&amp;image=i%2Finfo" alt="Summary" /></a>
                  </div>
              </div>
          </div>
      </div>

      AS FAR AS I UNDERSTAND, BUT THIS MAY BE NOT CORRECT AT ALL, this issue may be fixed by changing line 130 of the file moodle20/course/renderer.php of todays RC1
      from

      $content .= html_writer::link(new moodle_url('/course/view.php', array('id'=>$course->id)), format_text($course->fullname), array('class'=>$linkclass));

      to

      $content .= html_writer::link(new moodle_url('/course/view.php', array('id'=>$course->id)), format_text($course->fullname, FORMAT_HTML), array('class'=>$linkclass));

        Activity

        Hide
        Martin Dougiamas added a comment -

        Thanks Daniele! Rosie, all yours.

        Show
        Martin Dougiamas added a comment - Thanks Daniele! Rosie, all yours.
        Hide
        Daniele Cordella added a comment -

        Show
        Daniele Cordella added a comment -
        Hide
        Rossiani Wijaya added a comment -

        Thanks Daniele for reporting the bug.

        I fixed and committed the change to 2.0 distribution.

        Rosie.

        Show
        Rossiani Wijaya added a comment - Thanks Daniele for reporting the bug. I fixed and committed the change to 2.0 distribution. Rosie.
        Hide
        Daniele Cordella added a comment -

        Happy to see you accepted my suggestion. Thanks Rosie. Ciao.

        Show
        Daniele Cordella added a comment - Happy to see you accepted my suggestion. Thanks Rosie. Ciao.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: