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

badges_calculate_message_schedule() requires updates

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.5, 3.6.3, 3.7, 3.8
    • Fix Version/s: 3.6.7, 3.7.3
    • Component/s: Badges
    • Labels:
    • Testing Instructions:
      Hide

      Test 1

      1.  Login as Admin.
      2. Create a Course.
      3. Go to the Course.
      4. Go to Course Administration.
      5. Create a new Badge (Add a new Badge).
      6. Go to Course Administration > Badges > Manage badges.
      7. Edit the Badge.
      8. Go to the 'Message' tab;
      9. Choose a value from 'Notify badge creator' and save the changes. 
      10. Check the 'nextcron' field the mdl_badges table for the Badge.
        • make sure a timestamp has been added (if applicable) and the timestamp value has been properly calculated. (you can use https://www.unixtimestamp.com or any other similar tool to convert timestamps to readable dates).
      11. Repeat 9-10 steps for each available option in 'Notify badge creator'.
      Show
      Test 1  Login as Admin. Create a Course. Go to the Course. Go to Course Administration. Create a new Badge (Add a new Badge). Go to Course Administration > Badges > Manage badges. Edit the Badge. Go to the 'Message' tab; Choose a value from 'Notify badge creator' and save the changes.  Check the 'nextcron' field the mdl_badges table for the Badge. make sure a timestamp has been added (if applicable) and the timestamp value has been properly calculated. (you can use https://www.unixtimestamp.com or any other similar tool to convert timestamps to readable dates). Repeat 9-10 steps for each available option in 'Notify badge creator'.
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65243-master

      Description

      The badges function badges_calculate_message_schedule() is supposed to calculate the time the next message should be sent for a badge.

      It is incorrect because of 2 things:

      • There are not 210 days in a month
      • Date / times can never be calculated by adding seconds to a timestamp - they should always use https://docs.moodle.org/dev/Time_API or they will always be incorrect

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                damyon Damyon Wiese
                Reporter:
                damyon Damyon Wiese
                Peer reviewer:
                Mihail Geshoski
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Janelle Barcega
                Participants:
                Component watchers:
                Yuliya Bozhko, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 30 minutes
                  4h 30m