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

show_hide_link tooltip (title) overlap in tables produced by tablelib

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.10.3, 3.11
    • Fix Version/s: 3.10.7, 3.11.3
    • Component/s: Themes
    • Labels:
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE
    • Pull from Repository:
    • Pull 3.10 Branch:
      MDL-71375-310
    • Pull 3.11 Branch:
      MDL-71375-311
    • Pull Master Branch:
      MDL-71375-master
    • Testing Instructions:
      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"

      Description

      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.

       

       

       

        Attachments

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

          Activity

            People

            Assignee:
            moniNaydenov Simeon Naydenov
            Reporter:
            moniNaydenov Simeon Naydenov
            Peer reviewer:
            Simey Lameze Simey Lameze
            Integrator:
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Tester:
            Gladys Basiana Gladys Basiana
            Participants:
            Component watchers:
            Huong Nguyen, Bas Brands, Mathew May
            Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Sep/21

                Time Tracking

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