learnweb/moodle-mod_ratingallocate

Possible namespacing issue

Closed this issue · 2 comments

There appears to be an issue with the namespacing of the code. In several files the namespace is defined as 'namespace mod_ratingallocate' 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.

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. :)

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