Description
After upgrading Moodle from 3.9.17 to 3.9.19 with no changes to logstore_xapi, in the cron logs the following error is observed:
Execution started at 2023-03-01 10:42:02
Execute scheduled task: Emit records to LRS (logstore_xapi\task\emit_task)
!!! Exception - Argument 1 passed to src\transformer\utils\get_string_html_remov
ed() must be of the type string, null given, called in [dirroot]\admin\tool\log\
store\xapi\src\transformer\events\mod_quiz\question_answered\multichoice.php on
line 48 !!!
!! Error code: generalexceptionmessage !!
!! Stack trace: * line 35 of \admin\tool\log\store\xapi\src\transformer\utils\ge
t_string_html_removed.php: TypeError thrown
line 48 of \admin\tool\log\store\xapi\src\transformer\events\mod_quiz\question
_answered\multichoice.php: call to src\transformer\utils\get_string_html_removed
()
line 58 of \admin\tool\log\store\xapi\src\transformer\events\mod_quiz\question
_answered\handler.php: call to src\transformer\events\mod_quiz\question_answered
\multichoice()
line 48 of \admin\tool\log\store\xapi\src\transformer\events\modquiz\attempt
submitted\handler.php: call to src\transformer\events\mod_quiz\question_answered
\handler()
line ? of unknownfile: call to src\transformer\events\mod_quiz\attempt_submitt
ed{closure}()
line 49 of \admin\tool\log\store\xapi\src\transformer\events\modquiz\attempt
submitted\handler.php: call to array_reduce()
line 48 of \admin\tool\log\store\xapi\src\transformer\handler.php: call to src
\transformer\events\mod_quiz\attempt_submitted\handler()
line ? of unknownfile: call to src\transformer{closure}()
line 38 of \admin\tool\log\store\xapi\src\transformer\handler.php: call to arr
ay_map()
line 50 of \admin\tool\log\store\xapi\src\handler.php: call to src\transformer
\handler()
line 238 of \admin\tool\log\store\xapi\classes\log\store.php: call to src\hand
ler()
line 50 of \admin\tool\log\store\xapi\classes\task\emit_task.php: call to logs
tore_xapi\log\store->process_events()
line 163 of \admin\tool\task\cli\schedule_task.php: call to logstore_xapi\task
\emit_task->execute()
!!
Version
2022101800 on Moodle 3.9.19 (20230116)
Steps to reproduce the bug
cron runs in background
Expected behaviour
Should not generate cron errors
Actual behaviour
Generates cron errors
Server information
MSSQL 2016 with password authentication
Client information
OS: Windows 10
Browser: N/A
Additional information
Might just need to update transformer/utils/get_string_html_removed to handle null input, or handle null instead of string before calling it?
Description After upgrading Moodle from 3.9.17 to 3.9.19 with no changes to logstore_xapi, in the cron logs the following error is observed:
Execution started at 2023-03-01 10:42:02 Execute scheduled task: Emit records to LRS (logstore_xapi\task\emit_task) !!! Exception - Argument 1 passed to src\transformer\utils\get_string_html_remov ed() must be of the type string, null given, called in [dirroot]\admin\tool\log\ store\xapi\src\transformer\events\mod_quiz\question_answered\multichoice.php on line 48 !!! !! Error code: generalexceptionmessage !! !! Stack trace: * line 35 of \admin\tool\log\store\xapi\src\transformer\utils\ge t_string_html_removed.php: TypeError thrown
Version 2022101800 on Moodle 3.9.19 (20230116)
Steps to reproduce the bug cron runs in background
Expected behaviour Should not generate cron errors
Actual behaviour Generates cron errors
Server information MSSQL 2016 with password authentication
Client information OS: Windows 10 Browser: N/A
Additional information Might just need to update transformer/utils/get_string_html_removed to handle null input, or handle null instead of string before calling it?