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

Move (non-JS): title attribute is on wrong tag



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.3
    • Fix Version/s: 2.6.5, 2.7.2
    • Component/s: Course
    • Labels:
    • Affected Branches:
    • Fixed Branches:
    • Pull from Repository:
    • Pull Master Branch:
    • Testing Instructions:
      • Turn off JS in your browser
      • Enabled editing in a course
      • Move an item
      • Check the source code of the move-target (the dotted box)
      • The link should now have the title "Move 'sdaf' to this location"
      Turn off JS in your browser Enabled editing in a course Move an item Check the source code of the move-target (the dotted box) The link should now have the title "Move 'sdaf' to this location"
    • Story Points:
    • Sprint:
      FRONTEND Sprint 13


      When you are moving items (using the non-AJAX version), the move targets are written out using code like the following:

      <li class="first movehere" title="Move 'AA306 discussion' to this location">
      <a href="https://learn2acct.open.ac.uk/course/mod.php?movetosection=149146&sesskey=666">
      <img class="movetarget" src="https://learn2acct.open.ac.uk/theme/image.php/ou/core/1383320278/movehere" title="Move to here" alt="Move to here">

      As you can see, there is a title attribute on the LI tag which does not make a lot of sense. It should be on the link tag. (Additionally, there is an unnecessary title attribute on the img tag.)

      This was caused by MDL-37085.

      The previous code was:

      <a title="Move 'AA306 discussion' to this location" href="https://learn2.open.ac.uk/course/mod.php?moveto=287791&amp;sesskey=666"><img class="movetarget" src="https://learn2.open.ac.uk/theme/image.php/ou/core/1382685195/movehere" alt="Move to here"></a>

      This code is correct, with a title attribute on the A tag containing the full text, and an alt attribute (no title) on the IMG tag.

      For accessibility reasons, none of these titles are suitable anyway. All links should have different texts so while the longer text includes the name of the item being moved, that doesn't actually help as it's still the same for all of them. An accessible solution would use text like:

      'Move item to Week 4 before "Study resources"'

      In other words, I didn't describe the item being moved (because they probably know, and it's the same for all of them) but I included the section name of the target location and a relative before/after for the position within that section.

      I am not sure whether or not it is worth doing anything about this because I know Moodle HQ is planning to stop supporting the non-JS graceful degradation features. I was thinking about fixing the regression and putting it back to have the right attribute on the right tag, but since it's inaccessible even after doing that (and always was), I don't think I am going to bother...

      So probably just filing this bug and leave it for Moodle staff to decide what to do, sorry!

      The offending code where it puts the title on the li is course/renderer.php in course_section_cm_list, currently line 1097/1106, btw.




            phalacee Jason Fowler
            quen Sam Marshall
            Peer reviewer:
            Jetha Chan Jetha Chan
            Sam Hemelryk Sam Hemelryk
            John Okely John Okely
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            0 Vote for this issue
            5 Start watching this issue


              Fix Release Date: