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

Remove reliance on dynamic property in MDL-73325 Add "tags" field to BadgeClass

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-78545-master
    • Hide

      This fix removes the specific issue raised in  MDL-73325.
      Run Behat test scenario 'Edit a badge' from badges/tests/behat/add_badge.feature
      Previous result: see description
      Expected result: the test passes without issue, setting the badge's tags in the Moodle form when Editing the badge details.

      Manual test:

      1. Make sure you are running your test Moodle site on PHP 8.2 and you have your debugging set to fatal error for deprecation's
      2. Log into Moodle as an admin
      3. Navigate to `General > Badges > Badges settings`
      4. Set a Badge issue name and Badge issuer email address - both of these can be fake
      5. Click save changes
      6. Navigate to `General > Badges > Add a new badge
      7. Set a name, version and description for the bade
      8. Upload an image for the badge
      9. Set a tag for the badge (does not need to be an existing tag)
      10. Click `Create badge`
      11. Next, chose `edit details` from the badge summary page.
      12. Add a new different tag to the badge
      13. Click save changes
      14. You should not see any errors

      NOTE: When I tested this it took a bit of fiddling to get Moodle to stop on deprecated warnings, otherwise the error is very hard to notice via the UI when the patch is not applied

      Show
      This fix removes the specific issue raised in   MDL-73325 . Run Behat test scenario 'Edit a badge' from badges/tests/behat/add_badge.feature Previous result: see description Expected result: the test passes without issue, setting the badge's tags in the Moodle form when Editing the badge details. Manual test: Make sure you are running your test Moodle site on PHP 8.2 and you have your debugging set to fatal error for deprecation's Log into Moodle as an admin Navigate to `General > Badges > Badges settings` Set a Badge issue name and Badge issuer email address - both of these can be fake Click save changes Navigate to `General > Badges > Add a new badge Set a name, version and description for the bade Upload an image for the badge Set a tag for the badge (does not need to be an existing tag) Click `Create badge` Next, chose `edit details` from the badge summary page. Add a new different tag to the badge Click save changes You should not see any errors NOTE: When I tested this it took a bit of fiddling to get Moodle to stop on deprecated warnings, otherwise the error is very hard to notice via the UI when the patch is not applied

      Recreate this issue on 4.3 and fix it to pass the Behat test.

       

      — Failed steps:

      001 Scenario: Edit a badge       # /var/www/html/badges/tests/behat/add_badge.feature:175

            And I press "Save changes" # /var/www/html/badges/tests/behat/add_badge.feature:200

              Moodle exception: Exception - Unknown error type: Creation of dynamic property core_badges\badge::$tags is deprecated in [dirroot]/badges/edit.php on line 121 More information about this error
              Exception - Unknown error type: Creation of dynamic property core_badges\badge::$tags is deprecated in [dirroot]/badges/edit.php on line 121

            jippo43 Damian
            jippo43 Damian
            Paul Holden Paul Holden
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 15 minutes
                2h 15m

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