Moodle
  1. Moodle
  2. MDL-31179

/grade/grading/lib.php grading_manager::get_controller() is missing global $DB

    Details

    • Rank:
      37620

      Activity

      Hide
      Marina Glancy added a comment -

      in the current usage of advanced grading it is only used in assignment submission and function get_controller is called after the grading method is set which means after function set_active_method() is invoked. In the later the property areacache is populated.
      It means that the code accessing $DB in get_controller is unreachable.

      Although in the future it may be possible for module to have several grading methods and the function get_controller may be called for non-active method

      Show
      Marina Glancy added a comment - in the current usage of advanced grading it is only used in assignment submission and function get_controller is called after the grading method is set which means after function set_active_method() is invoked. In the later the property areacache is populated. It means that the code accessing $DB in get_controller is unreachable. Although in the future it may be possible for module to have several grading methods and the function get_controller may be called for non-active method
      Hide
      Eloy Lafuente (stronk7) added a comment -

      The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

      TIA and ciao

      Show
      Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
      Hide
      Petr Škoda added a comment -

      thanks for the detailed evaluation and fix!

      Show
      Petr Škoda added a comment - thanks for the detailed evaluation and fix!
      Hide
      Eloy Lafuente (stronk7) added a comment -

      Integrated, thanks (22 and master).

      Show
      Eloy Lafuente (stronk7) added a comment - Integrated, thanks (22 and master).
      Hide
      Eloy Lafuente (stronk7) added a comment -

      nobody tested this as far as it is unreachable right now.

      Show
      Eloy Lafuente (stronk7) added a comment - nobody tested this as far as it is unreachable right now.
      Hide
      Eloy Lafuente (stronk7) added a comment -

      Your nice code represents only 1/46 of the issues that have been sent upstream this week, so thanks, but not many.

      Nah, joking, many thanks! Closing this a fixed, ciao

      Show
      Eloy Lafuente (stronk7) added a comment - Your nice code represents only 1/46 of the issues that have been sent upstream this week, so thanks, but not many. Nah, joking, many thanks! Closing this a fixed, ciao

        People

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

          Dates

          • Created:
            Updated:
            Resolved: