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

MyMobile theme's include of Choice mod renderer crashes restores if Choice module is absent

    Details

    • Testing Instructions:
      Hide

      BEFORE APPLYING THE PATCH PRIOR TO TESTING

      1. Goto Site administration ► Plugins ► Activity modules ► Manage activities: Delete the Choice module
      2. Remove yourmoodle/mod/choice folder
      3. Backup a couple of resources or activities without users from a course.
      4. Restore that backup
      5. Select MyMobile theme from Theme selector or by URL
      6. You should now get the error message: Warning: include_once(moodle/mod/choice/renderer.php) [function.include-once]: failed to open stream: No such file or directory in moodle/theme/mymobile/renderers.php on line 35

      TESTING

      1. Apply the patch
      2. Follow same scenario as 1 to 6 above
      3. TEST you DO NOT get error message upon restoring course.
      Show
      BEFORE APPLYING THE PATCH PRIOR TO TESTING Goto Site administration ► Plugins ► Activity modules ► Manage activities: Delete the Choice module Remove yourmoodle/mod/choice folder Backup a couple of resources or activities without users from a course. Restore that backup Select MyMobile theme from Theme selector or by URL You should now get the error message: Warning: include_once(moodle/mod/choice/renderer.php) [function.include-once] : failed to open stream: No such file or directory in moodle/theme/mymobile/renderers.php on line 35 TESTING Apply the patch Follow same scenario as 1 to 6 above TEST you DO NOT get error message upon restoring course.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:
      MDL-37523_master

      Description

      MyMobile theme's renderers.php line 35 has a call to include /mod/choice/renderer.php. This is really strange, as no other Moodle theme has such include to a module!

      On my moodle 2.4 test site, I have removed the Choice module, which I never use.
      When I backup and then restore a course (or part of course) on that test site, in the very last stage of restore I get the following error messages and a crash:

      Warning: include_once(moodle24/mod/choice/renderer.php) [function.include-once]: failed to open stream: No such file or directory in moodle24/theme/mymobile/renderers.php on line 35

      Warning: include_once() [function.include]: Failed opening 'moodle24/mod/choice/renderer.php' for inclusion (include_path='moodle24/lib/zend:moodle24/lib/pear:.:/usr/local/lib/php') in moodle24/theme/mymobile/renderers.php on line 35

      Fatal error: Class 'mod_choice_renderer' not found in moodle24/theme/mymobile/renderers.php on line 804.

      Please remove from MyMobile theme that include /mod/choice/renderer.php OR at least test that the Choice module does exist on a moodle site before trying to include it!

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/13