Moodle
  1. Moodle
  2. MDL-26262

Adding event to Calendar causes "coding error detected"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.2
    • Component/s: Calendar
    • Labels:
    • Environment:
      Apache version 2.2.16
      PHP version 5.2.14
      MySQL version 5.0.91-community
      Architecture x86_64
      Operating system linux
      quad core, 2GB of Ram
      Moodle 2.0 (Build: 20101125)
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16334

      Description

      Adding and event to a calendar cases "Coding error detected, it must be fixed by a programmer: Invalid context level of parameter."

      Only on the home page adding an event to "ALL" works fine, but selecting a course causes this error. I turned on Deleveloper Level debugging messages and get this.

      Coding error detected, it must be fixed by a programmer: Invalid context level of parameter.

      Stack trace:
      •line 3956 of /lib/accesslib.php: coding_exception thrown
      •line 3089 of /lib/accesslib.php: call to get_course_context()
      •line 77 of /blocks/online_users/block_online_users.php: call to get_enrolled_sql()
      •line 279 of /blocks/moodleblock.class.php: call to block_online_users->get_content()
      •line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      •line 882 of /lib/blocklib.php: call to block_base->get_content_for_output()
      •line 934 of /lib/blocklib.php: call to block_manager->create_block_contents()
      •line 342 of /lib/blocklib.php: call to block_manager->ensure_content_created()
      •line 7 of /theme/splash/layout/general.php: call to block_manager->region_has_content()
      •line 627 of /lib/outputrenderers.php: call to include()
      •line 585 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      •line 215 of /calendar/event.php: call to core_renderer->header()

      as admin or a teacher, this error happens. When I switch templates back to stadard, same error occurs.
      My moodle is a fantastico installation.
      I have found a forum entry talking about the same problem.
      http://moodle.org/mod/forum/discuss.php?d=165451#p736608 (in french)

        Activity

        Hide
        Helen Foster added a comment -

        Bruce, thanks for your report.

        I've just tried to reproduce the problem on http://qa.moodle.net/ and found everything fine.

        Could you try upgrading to the latest 2.0.1 to see whether this fixes the problem.

        Show
        Helen Foster added a comment - Bruce, thanks for your report. I've just tried to reproduce the problem on http://qa.moodle.net/ and found everything fine. Could you try upgrading to the latest 2.0.1 to see whether this fixes the problem.
        Hide
        Bruce Currell added a comment -

        I just went to the qa.moodle.net, and tried to recreate it. I noticed, when I clicked on new event, the type of event that shows up are (user, course, and site). On my install, it only shows user and site. interesting. I will try the upgrade today from school and report back.

        Show
        Bruce Currell added a comment - I just went to the qa.moodle.net, and tried to recreate it. I noticed, when I clicked on new event, the type of event that shows up are (user, course, and site). On my install, it only shows user and site. interesting. I will try the upgrade today from school and report back.
        Hide
        Helen Foster added a comment -

        It may be because you tried adding an event from within a course that you were given 3 options (user, course, and site), whereas when you try adding an event via the front page you are given just 2 options (user and site).

        Show
        Helen Foster added a comment - It may be because you tried adding an event from within a course that you were given 3 options (user, course, and site), whereas when you try adding an event via the front page you are given just 2 options (user and site).
        Hide
        Bruce Currell added a comment -

        Oh boy, did it take a lot to upgrade a fantastico installation of Moodle from 2.0 to 2.1.
        Database wasn't in the correct UTF8 format. Zip extension for PHP wasn't enabled, and Soap extension for PHP wasn't enabled. So ontop of backing everything up and going through the update things were operating for quite a while.

        Now that I am at Moodle 2.0.1+ (Build: 20110204)
        I Still have the SAME Problem.

        The same problem but on a different line number now (probably because of the version update.

        Coding error detected, it must be fixed by a programmer: Invalid context level of parameter.
        Stack trace:
        •line 3967 of /lib/accesslib.php: coding_exception thrown
        •line 3084 of /lib/accesslib.php: call to get_course_context()
        •line 75 of /blocks/online_users/block_online_users.php: call to get_enrolled_sql()
        •line 279 of /blocks/moodleblock.class.php: call to block_online_users->get_content()
        •line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
        •line 895 of /lib/blocklib.php: call to block_base->get_content_for_output()
        •line 947 of /lib/blocklib.php: call to block_manager->create_block_contents()
        •line 342 of /lib/blocklib.php: call to block_manager->ensure_content_created()
        •line 7 of /theme/splash/layout/general.php: call to block_manager->region_has_content()
        •line 647 of /lib/outputrenderers.php: call to include()
        •line 605 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
        •line 215 of /calendar/event.php: call to core_renderer->header()

        Any help would be appreciated.

        I am thinking of testing out a brand new moodle installation on a different domain name using fantastico and seeing if this a repeatable problem.

        Show
        Bruce Currell added a comment - Oh boy, did it take a lot to upgrade a fantastico installation of Moodle from 2.0 to 2.1. Database wasn't in the correct UTF8 format. Zip extension for PHP wasn't enabled, and Soap extension for PHP wasn't enabled. So ontop of backing everything up and going through the update things were operating for quite a while. Now that I am at Moodle 2.0.1+ (Build: 20110204) I Still have the SAME Problem. The same problem but on a different line number now (probably because of the version update. Coding error detected, it must be fixed by a programmer: Invalid context level of parameter. Stack trace: •line 3967 of /lib/accesslib.php: coding_exception thrown •line 3084 of /lib/accesslib.php: call to get_course_context() •line 75 of /blocks/online_users/block_online_users.php: call to get_enrolled_sql() •line 279 of /blocks/moodleblock.class.php: call to block_online_users->get_content() •line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents() •line 895 of /lib/blocklib.php: call to block_base->get_content_for_output() •line 947 of /lib/blocklib.php: call to block_manager->create_block_contents() •line 342 of /lib/blocklib.php: call to block_manager->ensure_content_created() •line 7 of /theme/splash/layout/general.php: call to block_manager->region_has_content() •line 647 of /lib/outputrenderers.php: call to include() •line 605 of /lib/outputrenderers.php: call to core_renderer->render_page_layout() •line 215 of /calendar/event.php: call to core_renderer->header() Any help would be appreciated. I am thinking of testing out a brand new moodle installation on a different domain name using fantastico and seeing if this a repeatable problem.
        Hide
        Petr Škoda added a comment -

        Should be fixed in the next weekly build, thanks for the report.

        Petr

        Show
        Petr Škoda added a comment - Should be fixed in the next weekly build, thanks for the report. Petr

          People

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

            Dates

            • Created:
              Updated:
              Resolved: