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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8
    • Fix Version/s: 3.8
    • Component/s: Course, Tags
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      MDL-66446-master

      Description

      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
        

        Attachments

        1. screenshot-1.png
          116 kB
          Janelle Barcega

          Issue Links

            Activity

              People

              • Assignee:
                jpataleta Jun Pataleta
                Reporter:
                jpataleta Jun Pataleta
                Peer reviewer:
                Amaia Anabitarte
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Janelle Barcega
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/19

                  Time Tracking

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