Moodle
  1. Moodle
  2. MDL-35784

sql error on my home page when user is enrolled in mnet course

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: MNet, My home
    • Labels:
    • Testing Instructions:
      Hide

      Pre-requisite
      – Two sites with mnet

      Test

      1. Login to first site and enable mnet enrolment on course 1
      2. Login to second site and enrol user1 to mnet shared course (Site administration -> Networking -> Remote enrolments client)
      3. Go to first site as user1 and go to myhome page and make sure you don't see any error and get redirected to remote course
        Note: ignore php warning, will open another bug to fix it.
        ( Edit: Test that Raj has created this MDL :-p )
      Show
      Pre-requisite – Two sites with mnet Test Login to first site and enable mnet enrolment on course 1 Login to second site and enrol user1 to mnet shared course (Site administration -> Networking -> Remote enrolments client) Go to first site as user1 and go to myhome page and make sure you don't see any error and get redirected to remote course Note: ignore php warning, will open another bug to fix it. ( Edit: Test that Raj has created this MDL :-p )
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:
      wip-mdl-35784

      Description

      Following error is observed when user try to access my home page and is enrolled in mnet course

      Debug info: SELECT id,category FROM {course} WHERE id = ?
      [array (
      0 => -7,
      )]
      Error code: invalidrecord
      Stack trace:
       
          line 1335 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
          line 1311 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
          line 6525 of /lib/accesslib.php: call to moodle_database->get_record()
          line 1277 of /lib/weblib.php: call to context_course::instance()
          line 114 of /blocks/course_overview/renderer.php: call to format_string()
          line 86 of /blocks/course_overview/block_course_overview.php: call to block_course_overview_renderer->course_overview()
          line 281 of /blocks/moodleblock.class.php: call to block_course_overview->get_content()
          line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
          line 935 of /lib/blocklib.php: call to block_base->get_content_for_output()
          line 987 of /lib/blocklib.php: call to block_manager->create_block_contents()
          line 314 of /lib/blocklib.php: call to block_manager->ensure_content_created()
          line 1062 of /lib/outputrenderers.php: call to block_manager->get_content_for_region()
          line 155 of /my/index.php: call to core_renderer->blocks_for_region()

        Gliffy Diagrams

          Activity

          Hide
          Rajesh Taneja added a comment -

          AFAIK format_text for remote course should depend on page->context as we don't have this course information on our site.
          Patch in auth/mnet/auth.php is fixing php warining.

          Show
          Rajesh Taneja added a comment - AFAIK format_text for remote course should depend on page->context as we don't have this course information on our site. Patch in auth/mnet/auth.php is fixing php warining.
          Hide
          David Mudrak added a comment -

          Raj, the commit looks ok - thanks for it. Please feel free to re-assign. Maybe we might even check if the course is a local one or not and call format_string() accordingly.

          May I just suggest that if you are fixing some trivial bug like the one in auth/mnet/auth.php, you do it via two separate patches? It surely makes the git-blame records more intuitive and readable. Or at least to explain the change in the commit message, too. Tracker comments are likely to be forgotten but the commit messages are forever

          Show
          David Mudrak added a comment - Raj, the commit looks ok - thanks for it. Please feel free to re-assign. Maybe we might even check if the course is a local one or not and call format_string() accordingly. May I just suggest that if you are fixing some trivial bug like the one in auth/mnet/auth.php, you do it via two separate patches? It surely makes the git-blame records more intuitive and readable. Or at least to explain the change in the commit message, too. Tracker comments are likely to be forgotten but the commit messages are forever
          Hide
          Rajesh Taneja added a comment -

          Thanks David,

          I was thinking of creating two patches, but got lazy

          Anyways, should I open another issue for notice or should I just put this as another commit ?

          Show
          Rajesh Taneja added a comment - Thanks David, I was thinking of creating two patches, but got lazy Anyways, should I open another issue for notice or should I just put this as another commit ?
          Hide
          Adrian Greeve added a comment -

          [Y] Syntax
          [Y] Output
          [Y] Whitespace
          [N/A] Language
          [N/A] Databases
          [Y] Testing
          [Y] Security
          [Y] Documentation
          [Y] Git
          [Y] Sanity check

          It all looks very straight forward.

          Thanks Raj.

          Show
          Adrian Greeve added a comment - [Y] Syntax [Y] Output [Y] Whitespace [N/A] Language [N/A] Databases [Y] Testing [Y] Security [Y] Documentation [Y] Git [Y] Sanity check It all looks very straight forward. Thanks Raj.
          Hide
          Rajesh Taneja added a comment -

          Thanks Adrian.

          Show
          Rajesh Taneja added a comment - Thanks Adrian.
          Hide
          Aparup Banerjee added a comment -

          Thanks, integrated into master.

          Show
          Aparup Banerjee added a comment - Thanks, integrated into master.
          Hide
          Ankit Agarwal added a comment -

          After some crazy setups finally tested this works as expected.
          Passing
          Thanks!

          Show
          Ankit Agarwal added a comment - After some crazy setups finally tested this works as expected. Passing Thanks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          From somewhere within the clouds...

          Congrats, this has been sent upstream and is now part of Moodle (your favorite LMS platform). Many thanks for your awesome collaboration!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - From somewhere within the clouds... Congrats, this has been sent upstream and is now part of Moodle (your favorite LMS platform). Many thanks for your awesome collaboration! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: