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

strict standards warnings when using calculated grade items

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              andyjdavis Andrew Davis
              Reporter:
              andyjdavis Andrew Davis
              Peer reviewer:
              Dan Poltawski Dan Poltawski
              Integrator:
              Sam Hemelryk Sam Hemelryk
              Tester:
              Ankit Agarwal Ankit Agarwal
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Jun/12