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

PHP catchable fatal error - Random Glossary Entry block in course with no Glossary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.3.3
    • Fix Version/s: None
    • Component/s: Course, Glossary
    • Labels:
    • Workaround:
      Hide

      Hide the Random Glossary Entry block in the site admin block settings.

      Show
      Hide the Random Glossary Entry block in the site admin block settings.
    • Affected Branches:
      MOODLE_23_STABLE

      Description

      Hi!

      When entering course we receive error PHP catchable fatal error. How can we solve this problem? Version of Moodle is 2012062503.01.

      Ivica

      This error happens when a course has the Random Glossary Entry block but no Glossary.

      Steps to reproduce:

      1. Add a Glossary and Random Glossary Entry block to a course.
      2. Delete the Glossary.
      3. Try to access the course.

      Debug info: Argument 2 passed to has_capability() must be an instance of context, null given, called in [dirroot]/blocks/glossary_random/block_glossary_random.php on line 134 and defined
      Error code: codingerror
      Stack trace:

      • line 397 of /lib/setuplib.php: coding_exception thrown
      • line 355 of /lib/accesslib.php: call to default_error_handler()
      • line 134 of /blocks/glossary_random/block_glossary_random.php: call to has_capability()
      • line 281 of /blocks/moodleblock.class.php: call to block_glossary_random->get_content()
      • line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      • line 937 of /lib/blocklib.php: call to block_base->get_content_for_output()
      • line 989 of /lib/blocklib.php: call to block_manager->create_block_contents()
      • line 352 of /lib/blocklib.php: call to block_manager->ensure_content_created()
      • line 21 of /theme/express/layout/general.php: call to block_manager->region_has_content()
      • line 770 of /lib/outputrenderers.php: call to include()
      • line 715 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      • line 246 of /course/view.php: call to core_renderer->header()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              imatotek Ivica Matotek
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: