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

Change mtrace to debugging when module is missing in gradebook

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.6
    • Gradebook
    • MOODLE_36_STABLE
    • MDL-64970-master
    • Hide

      Setup: 

      This situation can happen but it's not clear how to trigger it so we will change the database to make it happen and test this issue.

      1. Edit "mod/scorm/lib.php"

      2. In the scorm_delete_instance() function move the call to "scorm_grade_item_delete()" to the end of the function

      3. Create a course with two assignment activities and some students. 

      5. Make sure the admin setting "debugdisplay" is turned on

      6. Make sure the admin setting "debug" is set to "Developer..."

      7. Run this query in the database: "delete from mdl_course_modules where module = (select id from mdl_modules where name = 'assign');"

      8. Purge all caches

      Test:

      9. Access the gradebook "Setup" for the course

      10. Delete the first assignment activity

      11. Verify you see "Can not find assign activity with id 1" messages on the "redirect" page (can be multiple times)

      12. Make sure the admin setting debugdisplay is turned off

      13. Access the gradebook "Setup" for the course

      14. Delete the second assignment activity

      15. Verify you do not see any error messages

       

      Show
      Setup:  This situation can happen but it's not clear how to trigger it so we will change the database to make it happen and test this issue. 1. Edit "mod/scorm/lib.php" 2. In the scorm_delete_instance() function move the call to "scorm_grade_item_delete()" to the end of the function 3. Create a course with two assignment activities and some students.  5. Make sure the admin setting "debugdisplay" is turned on 6. Make sure the admin setting "debug" is set to "Developer..." 7. Run this query in the database: "delete from mdl_course_modules where module = (select id from mdl_modules where name = 'assign');" 8. Purge all caches Test: 9. Access the gradebook "Setup" for the course 10. Delete the first assignment activity 11. Verify you see "Can not find assign activity with id 1" messages on the "redirect" page (can be multiple times) 12. Make sure the admin setting debugdisplay is turned off 13. Access the gradebook "Setup" for the course 14. Delete the second assignment activity 15. Verify you do not see any error messages  

      In MDL-64878 we detected this case that the database is inconsistent and generate an mtrace but return the course context so we don't fail halfway through the request. 

      The message indicates a bug in the calling code and is only really useful for developers so it would be better as debugging() instead of mtrace().

       

            Unassigned Unassigned
            damyon Damyon Wiese
            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, 30 minutes
                1h 30m

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