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

block online users breaks xhtml

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Blocks
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Few errors are affecting the online-user block in moodle 2.
      For instance they are:
      tag <div> is not allowed inside tag <a>
      tag <a> and/or <div> not properly closed...

      The code I am talking about is

          <div class="content">
              <div class="info">
                  (last 5 minutes)
              </div>
              <ul class='list'>
                  <li class="listentry">
                      <div class="user">
                          <a href="http://localhost:8888/moodle20/user/view.php?id=2&amp;course=1" title="1 sec">
                              <div class="user">
                                  <a href="http://localhost:8888/moodle20/user/view.php?id=2&amp;course=1">
                                      <img src="http://localhost:8888/moodle20/theme/image.php?theme=anomaly&amp;image=u%2Ff2&amp;rev=41" alt="Picture of - Admin -" class="userpicture defaultuserpic" width="16" height="16" />
                                  </a>
                              - Admin -
                              </a>
                          </div>
                  </li>
              </ul>
          <div class="clearer">
      <!-- -->
      </div>
      </div>

      My suggestion to fix the bug is to change in moodle20/blocks/online_users/block_online_users.php
      about lines 152 - 156

       
      } else {
          $this->content->text .= '<div class="user"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->page->course->id.'" title="'.$timeago.'">';
          $this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
          $this->content->text .= $user->fullname.'</a></div>';
      }

      to

       
      } else {
          $this->content->text .= '<div class="user">';
          $this->content->text .= $OUTPUT->user_picture($user, array('size'=>16));
          $this->content->text .= $user->fullname.'</div>';
      }

      because $OUTPUT->user_picture($user, array('size'=>16)); already self provide tha tag <a>

        Attachments

          Activity

            People

            • Assignee:
              danmarsden Dan Marsden
              Reporter:
              daniss Daniele Cordella
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10