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

Standardise use of the cm_info object and fix type hinting where stdClass is still being used.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.0.2
    • 2.0.1
    • Workshop
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Easy

      Tomaz found a bug while attempting to use a workshop module on a recently upgraded site:

      Debug info: Argument 4 passed to workshop_extend_navigation() must be an instance of stdClass, instance of cm_info given, called in /html/lib/navigationlib.php on line 1529 and defined
      Stack trace:

         * line 351 of /lib/setuplib.php: coding_exception thrown
         * line 1310 of /mod/workshop/lib.php: call to default_error_handler()
         * line 1529 of /lib/navigationlib.php: call to workshop_extend_navigation()
         * line 1056 of /lib/navigationlib.php: call to global_navigation->load_activity()
         * line 2345 of /lib/navigationlib.php: call to global_navigation->initialise()
         * line 641 of /lib/pagelib.php: call to navbar->has_items()
         * line 4 of /theme/arialist/layout/general.php: call to moodle_page->has_navbar()
         * line 647 of /lib/outputrenderers.php: call to include()
         * line 605 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
         * line ? of unknownfile: call to core_renderer->header()
         * line 189 of /lib/outputrenderers.php: call to call_user_func_array()
         * line ? of unknownfile: call to plugin_renderer_base->__call()
         * line 67 of /mod/workshop/view.php: call to mod_workshop_renderer->header()

      The problem is because workshop_extend_navigation is type hinting $cm as a stdClass, and it recently changed to a cm_info object.

      I'll create a patch for this shortly.

      Cheers
      Sam

        There are no Sub-Tasks for this issue.

            samhemelryk Sam Hemelryk
            samhemelryk Sam Hemelryk
            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.