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

Change mtrace to debugging when module is missing in gradebook

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6
    • Fix Version/s: None
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      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  
    • Affected Branches:
      MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-64970-master

      Description

      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().

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              damyon Damyon Wiese
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

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