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

Comments chooser in marking guide emits php notice if there are no entries

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.5, 3.2.2
    • 3.1.4, 3.2.1, 3.3
    • Grading methods
    • MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • Hide

      Ensure you have debugging mode at the developer level and display errors on (or watch the error log for your webserver).

      Then follow the steps from MDL-54056 - you should not see a php notice about $commentchooser not being set during any of it:

      1. Create an assignment.
      2. Set its grading method to Marking guide.
      3. Define the marking guide, but do not define any item for the frequently used comments.
      4. Save the marking guide and make it ready.
      5. Go back to the assignment and grade it.
      6. On the grading page, check the marking guide section.
        • Confirm that the Insert frequently used comment button is not being rendered below the criterion's comment text area.
        • Confirm that there are no JS errors or warnings in your console
      7. Edit the assignment's marking guide definition and define some comments and save the marking guide definition.
      8. Go back to the assignment's grading page and check the marking guide section.
        • Confirm that the Insert frequently used comment button is being rendered below the criterion's comment text area.
        • Confirm that there are no JS errors or warnings in your console
      9. Click on a criterion's Insert frequently used comment button.
        • Confirm that the Frequently used comments dialogue is being shown.
        • Confirm that the previously defined frequently used comments are listed in the dialogue.
      10. Click on a frequently-used comment.
        • Confirm that the dialogue closes and the selected comment is reflected in the comment text area of the chosen criterion.
      Show
      Ensure you have debugging mode at the developer level and display errors on (or watch the error log for your webserver). Then follow the steps from MDL-54056 - you should not see a php notice about $commentchooser not being set during any of it: Create an assignment. Set its grading method to Marking guide. Define the marking guide, but do not define any item for the frequently used comments. Save the marking guide and make it ready. Go back to the assignment and grade it. On the grading page, check the marking guide section. Confirm that the Insert frequently used comment button is not being rendered below the criterion's comment text area. Confirm that there are no JS errors or warnings in your console Edit the assignment's marking guide definition and define some comments and save the marking guide definition. Go back to the assignment's grading page and check the marking guide section. Confirm that the Insert frequently used comment button is being rendered below the criterion's comment text area. Confirm that there are no JS errors or warnings in your console Click on a criterion's Insert frequently used comment button. Confirm that the Frequently used comments dialogue is being shown. Confirm that the previously defined frequently used comments are listed in the dialogue. Click on a frequently-used comment. Confirm that the dialogue closes and the selected comment is reflected in the comment text area of the chosen criterion.

      MDL-54056 moved the initialisation of $commentschooser into an IF condition, whilst still using it outside of that IF conditions scope. As such, if there are no comments to choose from, the variable is never init'd but it still goes to use it, emitting a PHP notice.

            aolley Adam Olley
            aolley Adam Olley
            Simey Lameze Simey Lameze
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Ryan Wyllie Ryan Wyllie
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.