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

Fatal error when calendar event links to the non-existing activity

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Ensure you have debugging turned on and set to level developer
      2. Visit a course and remove the ‘Upcoming events’ block (if it exists) and add the ‘Calendar’ block (if it doesn't exist).
      3. Add the attached file create_event.php to your wwwroot.
      4. Edit the file and change the line '$event->courseid = '31';' so that the courseid points to the course you visited in step 1.
      5. Visit <yoursite>/create_event.php.
      6. Visit the course you specified in create_event.php and ensure there is a debugging message 'info_module::is_user_visible called with invalid cmid' instead of an exception.
      7. Remove the event from the mdl_event table.
      Show
      Ensure you have debugging turned on and set to level developer Visit a course and remove the ‘Upcoming events’ block (if it exists) and add the ‘Calendar’ block (if it doesn't exist). Add the attached file create_event.php to your wwwroot. Edit the file and change the line '$event->courseid = '31';' so that the courseid points to the course you visited in step 1. Visit <yoursite>/create_event.php. Visit the course you specified in create_event.php and ensure there is a debugging message 'info_module::is_user_visible called with invalid cmid' instead of an exception. Remove the event from the mdl_event table.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:

      Description

      We cannot load a course page and instead get this error:

      Can not find data record in database table course_modules.

      Previously mentioned fixes involve the modinfo field which has been removed in 2.7. I have tried purging caches and moving the course to new categories. All of the course content is in the database, just the front page cannot be displayed. I was able to make a backup of the course and restore it which temporarily fixed the problem. However, the newly restored course eventually gave the same error. Changing the course format doesn't fix the problem either.

        Attachments

        1. create_event.php
          0.3 kB
          Mark Nelson
        2. event_repair.php
          3 kB
          Eric Merrill

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  2/Feb/15