antriver/moodle-block_search

Search as student: could not find course table

Closed this issue · 3 comments

I'm using Moodle 2.8 with additional course formats (see bug report below). When a student searches then the error occures. This is not the case when an admin is using the search block.

It is not allowed to set the property course_modinfo::$courseid

line 177 of /lib/modinfolib.php: call to debugging()
line 385 of /blocks/search/MoodleSearch/DataManager.php: call to course_modinfo->__set()
line 143 of /blocks/search/MoodleSearch/DataManager.php: call to MoodleSearch\dummy_course_modinfo->__construct()
line 58 of /blocks/search/MoodleSearch/Model/Results/ModuleResult.php: call to MoodleSearch\DataManager::canUserSeeModule()
line 461 of /blocks/search/MoodleSearch/Model/Search.php: call to MoodleSearch\ModuleResult->isVisible()
line 91 of /blocks/search/MoodleSearch/Block.php: call to MoodleSearch\Search->filterResults()
line 91 of /blocks/search/index.php: call to MoodleSearch\Block->search()

It is not allowed to set the property course_modinfo::$userid

line 177 of /lib/modinfolib.php: call to debugging()
line 387 of /blocks/search/MoodleSearch/DataManager.php: call to course_modinfo->__set()
line 143 of /blocks/search/MoodleSearch/DataManager.php: call to MoodleSearch\dummy_course_modinfo->__construct()
line 58 of /blocks/search/MoodleSearch/Model/Results/ModuleResult.php: call to MoodleSearch\DataManager::canUserSeeModule()
line 461 of /blocks/search/MoodleSearch/Model/Search.php: call to MoodleSearch\ModuleResult->isVisible()
line 91 of /blocks/search/MoodleSearch/Block.php: call to MoodleSearch\Search->filterResults()
line 91 of /blocks/search/index.php: call to MoodleSearch\Block->search()

cm_info::obtain_dynamic_data() is deprecated and should not be used.

line 1147 of /lib/modinfolib.php: call to debugging()
line 161 of /blocks/search/MoodleSearch/DataManager.php: call to cm_info->__call()
line 161 of /blocks/search/MoodleSearch/DataManager.php: call to cm_info->obtain_dynamic_data()
line 58 of /blocks/search/MoodleSearch/Model/Results/ModuleResult.php: call to MoodleSearch\DataManager::canUserSeeModule()
line 461 of /blocks/search/MoodleSearch/Model/Search.php: call to MoodleSearch\ModuleResult->isVisible()
line 91 of /blocks/search/MoodleSearch/Block.php: call to MoodleSearch\Search->filterResults()
line 91 of /blocks/search/index.php: call to MoodleSearch\Block->search()

Notice: Trying to get property of non-object in /var/www/moodle26/lib/modinfolib.php on line 196

Notice: Trying to get property of non-object in /var/www/moodle26/lib/modinfolib.php on line 2609

Notice: Trying to get property of non-object in /var/www/moodle26/lib/modinfolib.php on line 2612

Datensatz kann nicht in der Datenbanktabelle course gefunden werden

Weitere Informationen über diesen Fehler
Debug info: SELECT format FROM {course} WHERE id = ?
[array (
0 => 0,
)]
Error code: invalidrecord
Stack trace:

line 1533 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
line 1509 of /lib/dml/moodle_database.php: call to moodle_database->get_field_select()
line 173 of /course/format/lib.php: call to moodle_database->get_field()
line 35 of /course/format/lib.php: call to format_base::instance()
line 2613 of /lib/modinfolib.php: call to course_get_format()
line 394 of /blocks/search/MoodleSearch/DataManager.php: call to section_info->__construct()
line 1815 of /lib/modinfolib.php: call to MoodleSearch\dummy_course_modinfo->get_section_info()
line 1151 of /lib/modinfolib.php: call to cm_info->obtain_dynamic_data()
line 161 of /blocks/search/MoodleSearch/DataManager.php: call to cm_info->__call()
line 161 of /blocks/search/MoodleSearch/DataManager.php: call to cm_info->obtain_dynamic_data()
line 58 of /blocks/search/MoodleSearch/Model/Results/ModuleResult.php: call to MoodleSearch\DataManager::canUserSeeModule()
line 461 of /blocks/search/MoodleSearch/Model/Search.php: call to MoodleSearch\ModuleResult->isVisible()
line 91 of /blocks/search/MoodleSearch/Block.php: call to MoodleSearch\Search->filterResults()
line 91 of /blocks/search/index.php: call to MoodleSearch\Block->search()

Hi,
I have made some fixes so it should work on 2.8 now. Could you let me know if it works for you now.

Sorry for my late answer. Yes, the bug seems to be fixed.

Thank you very much!