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

PHP notice and warning when editing a course with tags disabled.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.8
    • 3.8
    • Course, Tags
    • MOODLE_38_STABLE
    • MOODLE_38_STABLE
    • MDL-66446-master
    • Hide
      1. Make sure debugging is turned on.
      2. Create a course
      3. Go to Advanced features in Site administration
      4. Disable the tags functionality
      5. Save the changes.
      6. Edit the course and try to save the changes
      7. Confirm that the course will be saved without any notice/warning
      8. Reenable the tags functionality.
      9. Edit the course and add some course tags
      10. Save the changes
      11. Fetch the course_updated event in the logstore_standard_log table pertaining to the course that you updated. Example query:

        SELECT eventname, other FROM public.mdl_logstore_standard_log WHERE eventname LIKE '%course_updated%';
        

      12. Check the "other" column.
      13. Confirm that it contains the tags that were added to the course.
      Show
      Make sure debugging is turned on. Create a course Go to Advanced features in Site administration Disable the tags functionality Save the changes. Edit the course and try to save the changes Confirm that the course will be saved without any notice/warning Reenable the tags functionality. Edit the course and add some course tags Save the changes Fetch the course_updated event in the logstore_standard_log table pertaining to the course that you updated. Example query: SELECT eventname, other FROM public.mdl_logstore_standard_log WHERE eventname LIKE '%course_updated%'; Check the " other " column. Confirm that it contains the tags that were added to the course.

      To reproduce:

      1. Make sure debugging is turned on.
      2. Create a course
      3. Go to Advanced features in Site administration
      4. Disable the tags functionality
      5. Save the changes.
      6. Edit the course and try to save the changes
      7. Expected: The course will be saved without any notice/warning
      8. Actual: The following are being shown:

        Notice: Undefined property: stdClass::$tags in /home/jun/moodles/stable_master/moodle/course/lib.php on line 2543
         
        Warning: array_values() expects parameter 1 to be array, null given in /home/jun/moodles/stable_master/moodle/course/lib.php on line 2543
         
        Notice: Undefined property: stdClass::$tags in /home/jun/moodles/stable_master/moodle/course/lib.php on line 2544
        

            jpataleta Jun Pataleta
            jpataleta Jun Pataleta
            Amaia Anabitarte Amaia Anabitarte
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 10 minutes
                1h 10m

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