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

Convert hardcode tests for label to module_supports()

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3, 2.5
    • Fix Version/s: 2.5
    • Component/s: Libraries
    • Testing Instructions:
      Hide

      Hopefully this issue will be integrated together with MDL-37455 and they can be tested together.

      Test 1. Upgrade

      1. BEFORE integrating this issue
      2. Create course with labels in it (or several courses)
      3. Apply commits from this issue
      4. Run upgrade
      5. Make sure that you can view the courses and see all labels

      Test 2.

      1. Create a course in weeks/topics format with at least one label, one folder that is displayed inside the course (see MDL-37455) and one normal module
      2. Add recent activity block
      3. Turn editing on and try different actions on modules - inline edit of the name, hide/show, duplicate, delete. Make sure all works
      4. Make sure recent activity block shows actions on non-inline module only (exception: the delete action on inline folder will be shown)
      5. Login as student, view the first course, do some activities on the course (view, submit assignment, etc.)
      6. Login as admin/teacher, view all available reports on the course, make sure that only activities on non-inline module(s) are shown
      7. Enable filter "activity names"
      8. Create some text in the course where you use all names of existing activities
      9. Make sure that filter auto-link only activities that are not displayed inline
      10. Create a course in social format, add similar 3 activities in the block, turn editing on, make sure editing buttons work
      Show
      Hopefully this issue will be integrated together with MDL-37455 and they can be tested together. Test 1. Upgrade BEFORE integrating this issue Create course with labels in it (or several courses) Apply commits from this issue Run upgrade Make sure that you can view the courses and see all labels Test 2. Create a course in weeks/topics format with at least one label, one folder that is displayed inside the course (see MDL-37455 ) and one normal module Add recent activity block Turn editing on and try different actions on modules - inline edit of the name, hide/show, duplicate, delete. Make sure all works Make sure recent activity block shows actions on non-inline module only (exception: the delete action on inline folder will be shown) Login as student, view the first course, do some activities on the course (view, submit assignment, etc.) Login as admin/teacher, view all available reports on the course, make sure that only activities on non-inline module(s) are shown Enable filter "activity names" Create some text in the course where you use all names of existing activities Make sure that filter auto-link only activities that are not displayed inline Create a course in social format, add similar 3 activities in the block, turn editing on, make sure editing buttons work
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip-MDL-33774-master

      Description

      As discovered in MDL-33726, we need to convert hardcoded use of labels:

      grep -r "== [\"']label[\"']" *
       
      course/lib.php:            if ($info[0] == 'label') {     // Labels are ignored in recent activity
      course/lib.php:    if ($mod->modname !== 'label' && $hasmanageactivities && course_ajax_enabled($COURSE)) {
      lib/modinfolib.php:        if ($this->modname === 'label' && $this->content === '') {
      report/log/locallib.php:            if ($mod->mod == "label") {
      report/log/locallib.php:            if ($mod->mod == "label") {

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/13