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

course-modchooser is hardcoded to li.section

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 2.7
    • Fix Version/s: 2.7.1
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide
      1. For each of the course formats which have sections:
      2. Open a course and turn editing on
      3. Open the activity chooser
        • Confirm it appears
      4. Select an activity
        • Confirm it takes you to the relevant module creation page
      5. Go back to the front page
      6. Open the activity chooser
        • Confirm it appears
      7. Select an activity
        • Confirm it takes you to the relevant module creation page
      8. Go back to the front page
      9. Add the Site Menu block
      10. Open the activity chooser in the block
        • Confirm it appears
      11. Select an activity
        • Confirm it takes you to the relevant module creation page
      Show
      For each of the course formats which have sections: Open a course and turn editing on Open the activity chooser Confirm it appears Select an activity Confirm it takes you to the relevant module creation page Go back to the front page Open the activity chooser Confirm it appears Select an activity Confirm it takes you to the relevant module creation page Go back to the front page Add the Site Menu block Open the activity chooser in the block Confirm it appears Select an activity Confirm it takes you to the relevant module creation page
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-34737-master

      Description

      course-modchooser looks for the mod selector element in li.section but it should neither assume that the class of section li is 'section' in all format plugins (especially given that section_class is configurable in format.js) nor assume that the mod selector element is in course sections to begin with.

      See line 4 in course/yui/modchooser.js

      1 YUI.add('moodle-course-modchooser', function(Y) {
      2     var CSS = {
      3         PAGECONTENT : 'div#page-content',
      4         SECTION : 'li.section',

      A better approach should be to wrap the mod selector element with a div with a designated class name and let the course-modchooser refer to all such wrapper elements. This way if a format plugin implements only one chooser outside any course section the core chooser could still be applied.

        Attachments

          Activity

            People

            Assignee:
            dobedobedoh Andrew Nicols
            Reporter:
            itamart Itamar Tzadok
            Peer reviewer:
            Petr Skoda
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Adrian Greeve
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Jul/14