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

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

    Details

    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull Master Branch:
      wip-mdl-27896

      Description

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Oct/11