danmarsden/moodle-local_recompletion

User notification fails with php error

DavidPruem opened this issue · 2 comments

The plugin successfully resets the course, but no notification email is sent.

OS: Debian Linux
PHP: 8.1
Moodle Version: 4.1.8
DB: mariadb

There is a code error message in the task log. It seems the scripts expects a string argument at some point but receives an array.

Execute scheduled task: Prüfen, ob Nutzer Kurs wiederholen müssen (local_recompletion\task\check_recompletion)
... started 00:18:01. Current memory use 20.3 MB.
Debugging increased temporarily due to faildelay of 60
... used 109 dbqueries
... used 1.5371451377869 seconds
Scheduled task failed: Prüfen, ob Nutzer Kurs wiederholen müssen (local_recompletion\task\check_recompletion),trim(): Argument #1 ($string) must be of type string, array given
Backtrace:

  • line 210 of /local/recompletion/classes/task/check_recompletion.php: call to trim()
  • line 297 of /local/recompletion/classes/task/check_recompletion.php: call to local_recompletion\task\check_recompletion->notify_user()
  • line 119 of /local/recompletion/classes/task/check_recompletion.php: call to local_recompletion\task\check_recompletion->reset_user()
  • line 263 of /lib/cronlib.php: call to local_recompletion\task\check_recompletion->execute()
  • line 120 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
  • line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
  • line 178 of /admin/cli/cron.php: call to cron_run()

Hi @DavidPruem just FYI I encountered the same error but fixed it by upgrading the plugin version. I was getting the same error on 4becd2c but now on f8d86c8 it is fixed.

Thanks @matthewhilton - I've also just fixed the plugins db token in this repo and bumped the versions which has published new versions to the plugins db now - but yes, the latest version will always be in github.