Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-7365

error when rendering a flexpage with a resource type video

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.10
    • Fix Version/s: None
    • Component/s: Set: Flexpage
    • Labels:
      None
    • Plugin Version:
      2017063000
    • Affected Branches:
      MOODLE_31_STABLE

      Description

      After uploading a resource type video, when returning to the page, it was blank.

      With debugging mode on, I could see the following messages:

      Class core_media_renderer is deprecated, please use core_media_manager::instance()
      • line 4702 of /lib/outputrenderers.php: call to debugging()
      • line 417 of /lib/outputfactories.php: call to core_media_renderer->__construct()
      • line 2134 of /lib/outputlib.php: call to theme_overridden_renderer_factory->get_renderer()
      • line 861 of /lib/pagelib.php: call to theme_config->get_renderer()
      • line 99 of /blocks/flexpagemod/lib/mod/resource.php: call to moodle_page->get_renderer()
      • line 70 of /blocks/flexpagemod/lib/mod/resource.php: call to block_flexpagemod_lib_mod_resource->resource_display_embed()
      • line 128 of /blocks/flexpagemod/lib/mod.php: call to block_flexpagemod_lib_mod_resource->module_block_setup()
      • line 63 of /blocks/flexpagemod/block_flexpagemod.php: call to block_flexpagemod_lib_mod->setup_block()
      • line 288 of /blocks/moodleblock.class.php: call to block_flexpagemod->get_content()
      • line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      • line 1179 of /lib/blocklib.php: call to block_base->get_content_for_output()
      • line 1231 of /lib/blocklib.php: call to block_manager->create_block_contents()
      • line 538 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()
      • line 123 of /theme/irishmedium/layout/standard.php: call to core_renderer->standard_head_html()
      • line 1110 of /lib/outputrenderers.php: call to include()
      • line 1040 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      • line 246 of /course/view.php: call to core_renderer->header()

      Fatal error: Class 'core_media' not found in /var/www/moodle/blocks/flexpagemod/lib/mod/resource.php on line 101

       

      I was able to fix it by replacing

      $embedoptions = array(
      core_media::OPTION_TRUSTED => true,
      core_media::OPTION_BLOCK => true,
      );

      by this:

      $embedoptions = array(
      core_media_manager::OPTION_TRUSTED => true,
      core_media_manager::OPTION_BLOCK => true,
      );

       

      Could this be added, when a new version is released? Maybe 3.3 or 3.4?

      This was first identified using 3.1.6 version of Moodle.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            silviapinheiro Silvia Pinheiro
            Participants:
            Component watchers:
            Michael Penney
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: