moosh icon indicating copy to clipboard operation
moosh copied to clipboard

course-reset with reset_start_date option messes up dates of activities

Open porcospino opened this issue 4 years ago • 0 comments

  • moosh version: 0.32
  • moodle version: 3.5.14
    • database: 10.2.10-MariaDB,
  • php version: 7.2.33
  • operating system: CentOS

Steps to reproduce

  • Create a test course with a start date of 28th September 2019
  • Create an assignment in that course with a due date of 12:00 pm on 28th September 2019
  • Reset the course with Moosh, using the following command
moosh course-reset -s "reset_start_date=1600642800" <courseid>

Expected behaviour

  • The course start date changes to 00:00 BST on 28th September 2020
  • The assignment due date changes to 12:00 BST on 28th September 2020

Actual behaviour

  • The course start date changes to 00:00 BST on 28th September 2020
  • The assignment due date changes to 11:00 BST on 18 June 2070

This is because reset_start_date_old is zero:

PHP Notice:  Undefined property: stdClass::$reset_start_date_old in /opt/moodle/lib/moodlelib.php on line 5311

Notice: Undefined property: stdClass::$reset_start_date_old in /opt/moodle/lib/moodlelib.php on line 5311
PHP Notice:  Undefined property: stdClass::$reset_end_date_old in /opt/moodle/lib/moodlelib.php on line 5364

Notice: Undefined property: stdClass::$reset_end_date_old in /opt/moodle/lib/moodlelib.php on line 5364

porcospino avatar Sep 21 '20 19:09 porcospino