-
Bug
-
Resolution: Fixed
-
Minor
-
3.5
-
MOODLE_35_STABLE
-
MOODLE_35_STABLE
-
MDL-62713-master -
-
I run my cron via web browser using a password and an online cron service (cron-job.org).
After upgrading to Moodle 3.5, I implemented the global search feature using the new "Simple search" search engine. Now whenever I delete an activity or resource in a course, thus sending it to the recycle bin, the next time the "Global search indexing" task (\core\task\search_index_task) runs, I get the following cron output:
______________________________________________________________
Recently fetched info about available updates is still fresh enough, skipping.
Processing area: Assignment - activity information
No new documents to index.
Processing area: External tool - activity information
No new documents to index.
Processing area: Messages - sent
No new documents to index.
Processing area: Messages - received
No new documents to index.
Processing area: Course sections
!!! Exception - Call to undefined function core_course\search\get_section_name() !!!
Fatal error: Uncaught coding_exception: Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
C:\xampp\moodle\lib\classes\task\manager.php on line 520
Code should look like:
$factory = \core\lock\lock_config::get_lock_factory('type');
$lock = $factory->get_lock(Resource id #248);
$lock->release(); // Locks must ALWAYS be released like this.
in C:\xampp\moodle\lib\classes\lock\lock.php:117
Stack trace:
#0 [internal function]: core\lock\lock->__destruct()
#1 {main}
thrown in C:\xampp\moodle\lib\classes\lock\lock.php on line 117
_________________________________________________________________
This persists and no scheduled tasks run, until I manually run the "Global search indexing" task from the Site admin page using the "Run now" link.
To reproduce the error:
- Deselect site setting "Cron execution via command line only".
- Enable Global search.
- Select the Simple search search engine.
- Run the initial indexing.
- Delete an activity or resource from a course (I typically duplicate a label and then delete it).
- Execute the cron from a web browser.
- At this point, I should and do get a normal cron output.
- Wait until the "Global search indexing" task runs.
- Execute the cron from a web browser.
- Again, I should get normal cron output, but instead get the error above.
- Go to the Scheduled tasks in site administration.
- Execute the "Global search indexing" task via the "Run now" link.
- Execute the cron from a web browser.
- At this point, I should and do get a normal cron output.