learnweb / moodle-mod_ratingallocate

:pray: "Fair allocation" moodle activity
https://moodle.org/plugins/view/mod_ratingallocate
20 stars 29 forks source link

Possible namespacing issue #292

Closed james-pearce-bath-ac closed 7 months ago

james-pearce-bath-ac commented 8 months ago

There appears to be an issue with the namespacing of the code. In several files the namespace is defined as 'namespace modratingallocate' for example in the task files. In other places the namspacing is defined as 'namespace ratingallocate' without the mod prefix for example in the strategy php files.

FelixDiLenarda commented 7 months ago

The incorrect namespace designations lead to the failure of the ad_hoc task with the following output:

Execute adhoc task: mod_ratingallocate\task\distribute_unallocated_task
Adhoc task id: 90667432
Adhoc task custom data: {"courseid":"38278","cmid":"1786341","distributionalgorithm":"distribute_unallocated_equally"}
... started 12:13:03. Current memory use 42.6 MB.
Debugging increased temporarily due to faildelay of 7680
... used 1 dbqueries
... used 0.00084400177001953 seconds
Adhoc task failed: mod_ratingallocate\task\distribute_unallocated_task,Undefined constant "mod_ratingallocate\task\ACTION_DISTRIBUTE_UNALLOCATED_EQUALLY"
Backtrace:
* line 508 of /lib/classes/cron.php: call to mod_ratingallocate\task\distribute_unallocated_task->execute()
* line 302 of /lib/classes/cron.php: call to core\cron::run_inner_adhoc_task()
* line 128 of /lib/classes/cron.php: call to core\cron::run_adhoc_tasks()
* line 186 of /admin/cli/cron.php: call to core\cron::run_main_process()

This PR fixes the Issue. The integration of the pull request #296 is therefore eagerly anticipated. :)

Laur0r commented 7 months ago

Thank you for pointing this out! This will be fixed for the current master branch and the next release :)