Moodle
  1. Moodle
  2. MDL-20034

User Picture tooltips only show in Internet Explorer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not a bug
    • Affects Version/s: 1.9.5
    • Fix Version/s: 1.9
    • Component/s: Unknown, Usability
    • Labels:
      None
    • Environment:
      Firefox, Google Chrome, Safari, Opera
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      31379

      Description

      Because only Internet Explorer displays tooltips using the 'alt' tag, all other browsers are missing out on the display picture description. The easy fix is to also add a 'title' tag to images to the userpics in addidtion to the 'alt' tag.

      Line 4457 in moodle\lib\weblib.php just needs to go from:
      $output .= "<img class=\"$class\" src=\"$src\" height=\"$size\" width=\"$size\" alt=\"".s($imagealt).'" />';

      to:
      $output .= "<img class=\"$class\" src=\"$src\" height=\"$size\" width=\"$size\" title=\"".s($imagealt)."\" alt=\"".s($imagealt).'" />';

      This is definitely not a big issue but is one that can be very quickly fixed. I don't know where else this might be an issue!

      Josh Lukins

        Activity

        Hide
        Mark Williams added a comment -

        I found a Windows application called Alt&Title that automatically added missing title attributes to applicable HTML tags.

        It saved me many hours of work. Here is the Web page promoting it...

        http://www.flysoftware.com/products/altandtitle/overview.asp

        Mark

        Show
        Mark Williams added a comment - I found a Windows application called Alt&Title that automatically added missing title attributes to applicable HTML tags. It saved me many hours of work. Here is the Web page promoting it... http://www.flysoftware.com/products/altandtitle/overview.asp Mark
        Hide
        Rossiani Wijaya added a comment -

        Add title attribute to user picture.
        Committed file to 1.9 stable and head.

        Show
        Rossiani Wijaya added a comment - Add title attribute to user picture. Committed file to 1.9 stable and head.
        Hide
        Petr Škoda added a comment -

        we are very close to release, moving the target, sorry...

        Show
        Petr Škoda added a comment - we are very close to release, moving the target, sorry...
        Hide
        Rossiani Wijaya added a comment -

        The purpose for alt attribute is to briefly describe the image if its not load properly. (http://www.w3.org/QA/Tips/altAttribute). Therefore, the use of alt attribute should not be confused as tooltip.

        Previously, I made changes to user profile image however since this is not bug, I would not make any further changes to the rest of the site.

        Thank you for reporting.
        Rosie

        Show
        Rossiani Wijaya added a comment - The purpose for alt attribute is to briefly describe the image if its not load properly. ( http://www.w3.org/QA/Tips/altAttribute ). Therefore, the use of alt attribute should not be confused as tooltip. Previously, I made changes to user profile image however since this is not bug, I would not make any further changes to the rest of the site. Thank you for reporting. Rosie

          People

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

            Dates

            • Created:
              Updated:
              Resolved: