Quantcast
Channel: Installing and upgrading help
Viewing all articles
Browse latest Browse all 47066

ERROR: Can't find data record in database table course_categories.

$
0
0
by Francesco Viali.  

Hi,
a collegue installed a second moodle instance for testing purpouse but he made an error using the same MoodleData directory.
After an upgrade we have this error: 

Can't find data record in database table course_categories.
Debug info: SELECT id,parent FROM {course_categories} WHERE id = ?
[array (
0 => '2',
)]
Error code: invalidrecord
Stack trace:
  • line 1562 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
  • line 1538 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
  • line 6598 of /lib/accesslib.php: call to moodle_database->get_record()
  • line 658 of /course/classes/category.php: call to context_coursecat::instance()
  • line 1191 of /course/classes/category.php: call to core_course_category::can_view_category()
  • line 1307 of /course/classes/category.php: call to core_course_category->get_not_visible_children_ids()
  • line 300 of /course/classes/category.php: call to core_course_category->get_children()
  • line 1301 of /lib/navigationlib.php: call to core_course_category::user_top()
  • line 3468 of /lib/navigationlib.php: call to global_navigation->initialise()
  • line 3513 of /lib/navigationlib.php: call to navbar->has_items()
  • line 4489 of /lib/outputrenderers.php: call to navbar->get_items()
  • line 44 of /theme/boost/layout/columns2.php: call to core_renderer->region_main_settings_menu()
  • line 1374 of /lib/outputrenderers.php: call to include()
  • line 1304 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 100 of /index.php: call to core_renderer->header()

Reading forum I tried this:

SELECT * FROM mdl_course c WHERE NOT EXISTS (SELECT 1 FROM mdl_context ctx WHERE ctx.instanceid = c.id AND ctx.contextlevel = 50)

and  query return no rows


I also tried:

SELECT *

FROM mdl_context ctx

LEFT JOIN mdl_context parent ON ctx.path LIKE CONCAT('%/', parent.id, '/', ctx.id)

WHERE parent.id IS NULL OR ctx.path <> CONCAT(parent.path, '/', ctx.id)


and query returns one row with contextlevel = 10

Any suggestion?


Viewing all articles
Browse latest Browse all 47066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>