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

moving moodle dirroot causes cache to be corrupt.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.5.1
    • 2.5
    • Caching
    • MOODLE_25_STABLE
    • MOODLE_25_STABLE
    • wip-MDL-40136-m26
    • Hide

      after changing dirroot - delete the cache dir in moodledata

      Show
      after changing dirroot - delete the cache dir in moodledata
    • Hide

      set up a normal moodle site and make sure it's running

      Move your Moodle sites dirroot for example:

      $CFG->dirroot = '/home/sites/moodle';
      to
      $CFG->dirroot = '/home/sites/newmoodle';

      And make sure the old dirroot doesn't exist anymore - if you leave the old dirroot in place this test doesn't work correctly.

      (NOTE: dirroot isn't a required field in $CFG anymore as it is calculated automatically)
      load the homepage of your Moodle site - make sure it loads correctly.

      Show
      set up a normal moodle site and make sure it's running Move your Moodle sites dirroot for example: $CFG->dirroot = '/home/sites/moodle'; to $CFG->dirroot = '/home/sites/newmoodle'; And make sure the old dirroot doesn't exist anymore - if you leave the old dirroot in place this test doesn't work correctly. (NOTE: dirroot isn't a required field in $CFG anymore as it is calculated automatically) load the homepage of your Moodle site - make sure it loads correctly.

      if you move your Moodle site files (dirroot) to a different location this causes the site to fail like this:

      Coding error detected, it must be fixed by a programmer: Request for an unknown renderer class block_navigation_renderer 
       line 230 of \lib\outputfactories.php: coding_exception thrown
      line 1384 of \lib\outputlib.php: call to standard_renderer_factory->get_renderer()
      line 754 of \lib\pagelib.php: call to theme_config->get_renderer()
      line 208 of \blocks\navigation\block_navigation.php: call to moodle_page->get_renderer()
      line 292 of \blocks\moodleblock.class.php: call to block_navigation->get_content()
      line 238 of \blocks\moodleblock.class.php: call to block_base->formatted_contents()
      line 951 of \lib\blocklib.php: call to block_base->get_content_for_output()
      line 1003 of \lib\blocklib.php: call to block_manager->create_block_contents()
      line 353 of \lib\blocklib.php: call to block_manager->ensure_content_created()
      line 3 of \theme\base\layout\frontpage.php: call to block_manager->region_has_content()
      line 847 of \lib\outputrenderers.php: call to include()
      line 777 of \lib\outputrenderers.php: call to core_renderer->render_page_layout()
      line 99 of \index.php: call to core_renderer->header()
      

      this is because the cache returns the old dirroot instead of the correct new one.

      It would be nice if we could do some form of sanity check on the cache to see if $CFG->dirroot (which is correct after directory change) matches whatever is coming from the cache.

      This is also an issue as some deployment software (like MS Web Matrix) allow a user to package Moodle on their local system and then deploy to an external webserver taking both moodleweb and moodledata across to the external system.

            samhemelryk Sam Hemelryk
            danmarsden Dan Marsden
            Dan Poltawski Dan Poltawski
            Petr Skoda Petr Skoda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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