Moodle
  1. Moodle
  2. MDL-33084

strict standards warnings when using calculated grade items

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Gradebook
    • Labels:
      None
    • Testing Instructions:
      Hide

      Log in as a teacher or admin. Go into a course and go to the gradebook. Go to the "categories and items: full view"

      Click "add grade item". Enter a name and click save.

      On the same row as your new grade item in the categories and items screen is a little calculator icon. click it.

      check no notices are displayed.

      Enter the following as the calculation (without quotes) "broken calc". Click save. No strict notices should be displayed. You should get an error message about the formula.

      Change the calculation to "=sum(2,4)". Click save and you should be returned to the categories and items screen.

      Show
      Log in as a teacher or admin. Go into a course and go to the gradebook. Go to the "categories and items: full view" Click "add grade item". Enter a name and click save. On the same row as your new grade item in the categories and items screen is a little calculator icon. click it. check no notices are displayed. Enter the following as the calculation (without quotes) "broken calc". Click save. No strict notices should be displayed. You should get an error message about the formula. Change the calculation to "=sum(2,4)". Click save and you should be returned to the categories and items screen.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      MDL-33084_strict_calc
    • Rank:
      40324

      Description

      Go to the gradebook categories and items screen. Add a new grade item. Add a custom calculation.

      Strict Standards: Non-static method calc_formula::localize() should not be called statically in /home/andrew/Desktop/code/moodle/dev/master/grade/edit/tree/calculation.php on line 69 Strict Standards: Non-static method calc_formula::unlocalize() should not be called statically, assuming $this from incompatible context in /home/andrew/Desktop/code/moodle/dev/master/grade/edit/tree/calculation_form.php on line 96

      localise() and unlocalize are not static methods but it looks like they probably should be. They never access $this.

      Check the unit tests after making any modifications.

        Issue Links

          Activity

          Hide
          Andrew Davis added a comment - - edited

          Added testing instructions. Putting this up for peer review.

          I altered the definiton of localize() and unlocalize(). I couldnt find any calls to them apart from the ones in /grade/edit/tree/calculation.php

          Show
          Andrew Davis added a comment - - edited Added testing instructions. Putting this up for peer review. I altered the definiton of localize() and unlocalize(). I couldnt find any calls to them apart from the ones in /grade/edit/tree/calculation.php
          Hide
          Dan Poltawski added a comment -

          Looks good Andrew. Only question is whether its also worth declaring public at the same time.

          Show
          Dan Poltawski added a comment - Looks good Andrew. Only question is whether its also worth declaring public at the same time.
          Hide
          Andrew Davis added a comment -

          Done. Putting this up for integration.

          Show
          Andrew Davis added a comment - Done. Putting this up for integration.
          Hide
          Sam Hemelryk added a comment -

          Nice simple perfect changes thanks Andrew. Has been integrated now

          Show
          Sam Hemelryk added a comment - Nice simple perfect changes thanks Andrew. Has been integrated now
          Hide
          Ankit Agarwal added a comment -

          works as expected.
          passing
          Thanks

          Show
          Ankit Agarwal added a comment - works as expected. passing Thanks
          Hide
          Dan Poltawski added a comment -

          Congratulations!

          Your work has made into the latest Moodle release!

          You are only authorised to celebrate after testing 15 Moodle 2.3 QA tests, thanks!

          Show
          Dan Poltawski added a comment - Congratulations! Your work has made into the latest Moodle release! You are only authorised to celebrate after testing 15 Moodle 2.3 QA tests, thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: