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

Incorrect context set in course/edit.php prevent emoticons to observe filters status properly

XMLWordPrintable

    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • wip-mdl-27896
    • Hide
                            1. Test editor filters ############
                              1. Log in as Admin
                              2. Turn emoticons on (Site administration -> Plugins -> filters -> Manage filters -> Display emoticons as images)
                              3. Turn editing on
                              4. Select a course
                              5. Click settings -> Edit settings
                              6. Click on emoticon icon and add an emoticon in course summary
                              7. Save course
                              8. Turn emoticons off for the course (Settings -> Filters -> Display emoticons as images )
                              9. Click settings -> Edit settings
                              10. Emoticon icon should not be visible, but text version of emoticon should be shown.
                              11. Select another course and click settings -> edit settings
                              12. You should be able to see emoticons button in course summary editor.
                              13. Try perform similar test for cohort

      test category:
      1. Create a category
      2. turn off emoticon filter
      3. Add a subcategory and emoticon button should not be visible
      4. Add course and emoticons should not be visible
      5. Turn emoticon "on" on category
      6. repeat 3 and 4, and emoticon button should be visible.

                            1. Test files ############
                              1. edit category and insert image
                              2. Save category and edit again, image should be visible
                              3. Try create multiple categories and sub-categories and repeat step 1,2.
                              4. Try test the same in cohort, course, assignment, feedback, lesson, wiki, workshop and user
      Show
      Test editor filters ############ 1. Log in as Admin 2. Turn emoticons on (Site administration -> Plugins -> filters -> Manage filters -> Display emoticons as images) 3. Turn editing on 4. Select a course 5. Click settings -> Edit settings 6. Click on emoticon icon and add an emoticon in course summary 7. Save course 8. Turn emoticons off for the course (Settings -> Filters -> Display emoticons as images ) 9. Click settings -> Edit settings 10. Emoticon icon should not be visible, but text version of emoticon should be shown. 11. Select another course and click settings -> edit settings 12. You should be able to see emoticons button in course summary editor. 13. Try perform similar test for cohort test category: 1. Create a category 2. turn off emoticon filter 3. Add a subcategory and emoticon button should not be visible 4. Add course and emoticons should not be visible 5. Turn emoticon "on" on category 6. repeat 3 and 4, and emoticon button should be visible. Test files ############ 1. edit category and insert image 2. Save category and edit again, image should be visible 3. Try create multiple categories and sub-categories and repeat step 1,2. 4. Try test the same in cohort, course, assignment, feedback, lesson, wiki, workshop and user

      While integrating MDL-27500 and playing with new code was detected that the course->summary editor was not observing the filters status for the course context, causing the emoticons button (tinymce plugin) to be shown / hidden incorrectly.

      After a nice trace session with David, it seems that we need to:

      1) Add the missing 'context' element to the editoroptions array in course/edit.php

      And also we have agreed it would be great to have some central check in order to find anomalous situations like that, so we have decided to:

      2) Modify file_prepare_editor() (not used in all forms but in a hight %, and it's the only central point where both $options and $context are available) to:

      2a) missing both OK
      2b) $context !== $options['context'] then EXCEPTION
      2c) missing one of them DEBUGGING_DEVELOPER

            rajeshtaneja Rajesh Taneja
            stronk7 Eloy Lafuente (stronk7)
            Dongsheng Cai Dongsheng Cai
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Michael de Raadt Michael de Raadt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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