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

show_hide_link tooltip (title) overlap in tables produced by tablelib

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.10.7, 3.11.3
    • 3.10.3, 3.11
    • Themes
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-71375-master
    • Hide
      1. Open a course
      2. Go to Participants
      3. Enrol at least one participant
      4. Hover over the "-" button  right Firstname / Surname column title in the main users table
      5. Check the tooltip says "Hide Fullname"
      6. Hover over the "-" button  right Country column title in the main users table
      7. Check the tooltip says "Hide Country"
      8. Click the "Hide country" button
      9. Hover over the "+" button  right Country column title in the main users table
      10. Check the tooltip says "Show Country"
      Show
      Open a course Go to Participants Enrol at least one participant Hover over the "-" button  right Firstname / Surname column title in the main users table Check the tooltip says "Hide Fullname" Hover over the "-" button  right Country column title in the main users table Check the tooltip says "Hide Country" Click the "Hide country" button Hover over the "+" button  right Country column title in the main users table Check the tooltip says "Show Country"

      FULL STEPS:

      1. Open a moodle course
      2. Go to Participants
      3. Enrol at least one participant
      4. Hover over the "-" button  right Firstname / Surname column title in the main users table

      EXPECTED:

      The tooltip should say "Hide Full name"

      ACTUAL RESULT:

      The tooltip says "Hide" without specifying which column

      If hovered in the bottom-right corner of the "-" sign, the correct tooltip is displayed. 

       

      BUG:

      The problem seems to be that both the <a> and the <i> inside have a title attribute. It is applicable to all tables produced with lib/tablelib.php. The problematic function is flexible_table::show_hide_link in lib/tablelib.php:

      ...

      protected function show_hide_link($column, $index) {
      ...
      return html_writer::link($this->baseurl->out(false, array($this->request[TABLE_VAR_SHOW] => $column)),
      {{ $OUTPUT->pix_icon('t/switch_plus', get_string('show')), $linkattributes);}}
      ...
      return html_writer::link($this->baseurl->out(false, array($this->request[TABLE_VAR_HIDE] => $column)),
      {{ $OUTPUT->pix_icon('t/switch_minus', get_string('hide')), $linkattributes);}}
      ...

      $linkattributes already contains the correct title, so all that needs to be done is to replace get_string('show') and get_string('hide') with null, so that the icon doesn't have a title attribute.

       

       

       

        1. current.png
          current.png
          180 kB
        2. expected.png
          expected.png
          233 kB
        3. MDL-71375_Test Passed.png
          MDL-71375_Test Passed.png
          234 kB

            moniNaydenov Simeon Naydenov
            moniNaydenov Simeon Naydenov
            Simey Lameze Simey Lameze
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Gladys Basiana Gladys Basiana
            Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 38 minutes
                1h 38m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.