Installation help

Can not find data record in database table context

 
 
Picture of Richard Lian
Can not find data record in database table context
 

Hi all,

After upgrading from 1.9 to 2.2, some of my courses will not load. I get the message:

Can not find data record in database table context.

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

If you run cron once, it should sort out the mess.

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

Hi,

I have run cron as you suggested but it has not made any difference. Any other thoughts?

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Oh sorry, the key bit of cron only runs about 20% of the time.

I shoudl ahve said: "Run cron about 5 or 10 time, until you see a message like "Running clean-up tasks..." near the top of the ouptut 

 
Average of ratings:Useful (1)
Picture of Richard Lian
Re: Can not find data record in database table context
 

Hi Mate,

I have run cron over 10 times now and still got the same issue. Any ideas?

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

I really thought that would fix it. sad

If you want to investigate further, you will probably need to investigate in the DB. For example try queries like

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

That will find any courses where the course context does not exist (so it should return 0 rows).

You can also do similar queries for modules and blocks

SELECT * FROM mdl_course_modules cm WHERE NOT EXISTS (SELECT 1 FROM mdl_context ctx WHERE ctx.instanceid = cm.id AND ctx.contextlevel = 70)

SELECT * FROM mdl_block_instances bi WHERE NOT EXISTS (SELECT 1 FROM mdl_context ctx WHERE ctx.instanceid = bi.id AND ctx.contextlevel = 80)

If all those quries return no rows, then I am really confused by the error you are seeing.

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

Hi Tim,

I have installed phpmyadmin to run the commands.

When I try the first one you listed I get the following error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON ctx.instanceid = c.id AND ctx.contextlevel = 50) LIMIT 0, 30' at line 1

 

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Sorry, that was a copy-and-paste error.

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

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

No worries.

Using the new line it says: MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0022 sec )

If I change the end of the statement to AND ctx.contextlevel = 100 it then shays: Showing rows 0 - 29 ( 91 total, Query took 0.0010 sec)

Not really sure what that means though! thoughtful

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

I have changed contextlevel to 70 assuming that's the level within courses and get a number of rows returned. How do I re link them?

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Zero rows is correct, and what I would expect. What about the other queries above, relating to modules and blocks?

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

All 3 of the queries you provided return 0 rows mate.

But if I actually look in the context table - assuming I am looking in the right place; I can't see the missing courses.

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

Any more thoughts?

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Not really. I suppose you could try setting Debugging to DEVELOPER level, to see if that gives a more informative error message. If it does, copy and paste the whole thing here.

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

Here is an output from one of the broken links when developer level debugging is enabled:

Can not find data record in database table context.

Debug info: SELECT * FROM {context} WHERE id = ? [array (   0 => '571', )]
Stack trace:
  • line 1272 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
  • line 1249 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
  • line 4811 of /lib/accesslib.php: call to moodle_database->get_record()
  • line 5053 of /lib/accesslib.php: call to context::instance_by_id()
  • line 1522 of /lib/questionlib.php: call to context->get_parent_contexts()
  • line 1436 of /lib/questionlib.php: call to question_edit_contexts->__construct()
  • line 3277 of /lib/navigationlib.php: call to question_extend_settings_navigation()
  • line 2909 of /lib/navigationlib.php: call to settings_navigation->load_course_settings()
  • line 601 of /lib/pagelib.php: call to settings_navigation->initialise()
  • line 617 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
  • line 133 of /blocks/settings/block_settings.php: call to moodle_page->__get()
  • line 280 of /blocks/moodleblock.class.php: call to block_settings->get_content()
  • line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
  • line 926 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 978 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 349 of /lib/blocklib.php: call to block_manager->ensure_content_created()
  • line 6 of /theme/binarius/layout/general.php: call to block_manager->region_has_content()
  • line 685 of /lib/outputrenderers.php: call to include()
  • line 637 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 211 of /course/view.php: call to core_renderer->header()
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Ah, I see. The problem is in get_parent_contexts, which means that the problem is with the path for one of your contexts. (I wish I had thougth to start by asking for the full debug output! Sorry.)

So, can we do a query to locate that particular problem?

OK, try this

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)

If everything is OK, that query will return one row with contextlevel = 10, but in your case it should return more.

 
Average of ratings:Useful (1)
Picture of Richard Lian
Re: Can not find data record in database table context
 

This is the output:

Showing rows 0 - 7  ( 8 total, Query took 6.4536 sec)

idcontextlevelinstanceidpathdepthidcontextlevelinstanceidpathdepth
1 10 0 /1 1 NULL NULL NULL NULL NULL
44 50 5 /1/491/3496/492/493/570/44 7 NULL NULL NULL NULL NULL
215 50 8 /1/491/3496/492/493/571/215 7 NULL NULL NULL NULL NULL
392 50 10 /1/491/3496/492/493/570/392 7 NULL NULL NULL NULL NULL
961 50 16 /1/491/3496/492/493/570/961 7 NULL NULL NULL NULL NULL
1474 50 21 /1/491/3496/492/493/570/1474 7 NULL NULL NULL NULL NULL
1590 50 26 /1/491/3496/492/493/570/1590 7 NULL NULL NULL NULL NULL
1775 50 34 /1/491/3496/492/493/570/1775 7 NULL NULL NULL NULL NULL

 

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

I assume that output is what you expected. Is there a fix for it?

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Right, so the problem is those paths. The bits of teh path are context ids, so can you check whether contexts 491, 3496, 492, 493, 570 and 571 exist? Actually, just do 

SELECT * FROM mdl_context WHERE id IN (491, 3496, 492, 493, 570, 571)

and then we should have enough information to get this fixed.

 
Average of ratings:Useful (1)
Picture of Richard Lian
Re: Can not find data record in database table context
 

Here is the output:

Showing rows 0 - 2  ( 3 total, Query took 0.0006 sec)

Full textsidcontextlevelinstanceidpathdepth
Edit Edit Edit Inline Edit Copy Copy Delete Delete 491 40 2 /1/491 2
Edit Edit Edit Inline Edit Copy Copy Delete Delete 492 40 3 /1/491/3496/492 4
Edit Edit Edit Inline Edit Copy Copy Delete Delete 3496 40 21 /1/491/3496 3
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Can not find data record in database table context
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

OK, so you are missing contexts 493, 570, 571 which should correspond to the categories that the problem courses are in. Or perhaps the categories got deleted somehow, but the courses are still there.

I think the easiest way to fix this up is to use a simple script to move these courses into a category that we know is OK.

If you are wise, you will take a backup of everything before going any further.

Save the following script into a file called fixup.php using a plaing text editor.

Upload it to the root folder of your Moodle site (the same folder that contains files colled config.php and pluginfile.php) then visit the URL .../fixup.php with your web browser. Hopefully it will work, but I have to say this is just my best guess. It might be a good idea to set Debugging to developer level before running the script.

The alternative is to read the code, and work out exactly what the move_courses function does, and do the same thing manually in the database. That is more complex, but might be a bit safer.

<?php
require_once('config.php');
require_once($CFG->dirroot . '/course/lib.php');
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
move_courses(array(5, 8, 10, 16, 21, 26, 34), 3);
echo 'Done!';
 
Average of ratings:Useful (3)
Picture of Richard Lian
Re: Can not find data record in database table context
 

Hi Tim,

That seems to have worked a treat!

The courses now appear when clicked on. Can't see any adverse effects at the moment but will check through all the courses to be sure.

Thanks very much for your help - I reall appreciate it!

Could I call upon you one more time?

I have a new problem that came up earlier today HERE. Any thoughts on this one?

 
Average of ratings: -
Picture of Richard Lian
Re: Can not find data record in database table context
 

Actually don't worry about the other problem - managed to sort it!

Thanks very much again for all your help!

 
Average of ratings: -
Jaswant Tak
Re: Can not find data record in database table context
 

Thanks Tim / Thanks Richard,


I got the same issue and its been resolved now by following all the steps. But one critical issue, I can see all the courses, but courses are empty, I have lost all the course data (forums, resources, activities etc.)

Any suggestion on that Moodle data directory contains the data but Moodle is not showing that.

Please suggest what to do.

Thanks,

Jaswant

 
Average of ratings: -
Picture of Tobias Sopu
Re: Can not find data record in database table context
 

Just by guessing without looking at the error,

perhaps the issue might be: (I'm just guessing)

1. in your config.php file, make sure its

$CFG->wwwroot   ='http://moodlewebsite.org';

pointing to the right url and folder, 

OR

$CFG->dataroot  ='/home2/jpaccart/public_html/moodledata';

make sure its pointing to the right database, If the courses are empty than its pointing to a different database, the moodle system is retrieving empty database....

which you might check this two lines...

$CFG->dbname    ='xxxxxxx';

$CFG->dbuser    ='xxxxxxx';

Sometimes the prefix also has changed,

$CFG->prefix    ='mdl_'

check this also,

 

Sorry if this might not solve your problem, than I'm pretty sure it has to do with the Moodle system communication with the Database....may be others could help.....

 

 
Average of ratings: -
Picture of Nathan Bruley
Re: Can not find data record in database table context
 

Tim, I get this error when trying to view a quiz record from the logs. Is it the same sort of problem do you think? I ran Cron some 14 times and cleared the cache and still get the error.

Running Moodle 2.6.5+


Debug info: SELECT * FROM {quiz_attempts} WHERE id = ?
[array (
0 => 17373,
)]
Error code: invalidrecord
Stack trace:
  • line 1403 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
  • line 1379 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
  • line 490 of /mod/quiz/attemptlib.php: call to moodle_database->get_record()
  • line 508 of /mod/quiz/attemptlib.php: call to quiz_attempt::create_helper()
  • line 46 of /mod/quiz/review.php: call to quiz_attempt::create()
We recently had an issue where some records were deleted from the moodledata folder. Could that be related?

Nathan

 
Average of ratings: -
Picture of Geethanjali Bakki
Re: Can not find data record in database table context
 


I get this error when I type localhost:98/EnglishClassPlus

Can not find data record in database table course_modules.

Could not trace the error. Please help

 
Average of ratings: -
Picture of Geethanjali Bakki
Re: Can not find data record in database table context
 

The problem is solved. Thank you. 

Its just a line of code that I have added to the layout of my theme.

 
Average of ratings: -
Picture of Marty Jacobs
Re: Can not find data record in database table context
 

I experienced this exact same error today. The way I fixed it was to move the problematic course out of the category it was in, using the Moodle interface, and into a different category. I then moved it back into the original category and the course displayed correctly. This action must have forced Moodle to create the missing context entries in the DB.

I'm pretty sure this error was caused by deleting some sub-categories.

Hope this helps other with the same issue.

Marty

P.S. Thanks to all who contributed to this thread, it allowed me to diagnose the problem very quickly.

 
Average of ratings: -
Picture of Simon Brock
Can not find data record in database table course_modules.
 

we are experiencing a similar error but in the course_modules :

Can not find data record in database table course_modules.

 

Debug info: SELECT id,course FROM {course_modules} WHERE id = ? [array ( 0 => '39683', )]

Error code: invalidrecord Stack trace:

  • line 1357 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
  • line 1333 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
  • line 6799 of /lib/accesslib.php: call to moodle_database->get_record()
  • line 1029 of /lib/modinfolib.php: call to context_module::instance()
  • line 310 of /lib/modinfolib.php: call to cm_info->__construct()
  • line 1341 of /lib/modinfolib.php: call to course_modinfo->__construct()
  • line 1000 of /lib/completionlib.php: call to get_fast_modinfo()
  • line 47 of /report/progress/lib.php: call to completion_info->get_activities()
  • line 2459 of /lib/navigationlib.php: call to report_progress_extend_navigation_course()
  • line 1133 of /lib/navigationlib.php: call to global_navigation->add_course_essentials()
  • line 2920 of /lib/navigationlib.php: call to global_navigation->initialise()
  • line 766 of /lib/pagelib.php: call to navbar->has_items()
  • line 4 of /theme/canvas/layout/general.php: call to moodle_page->has_navbar()
  • line 804 of /lib/outputrenderers.php: call to include()
  • line 734 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 230 of /course/view.php: call to core_renderer->header()

we have run the cron script several times but has not fixed the error, also tried moving the course to another category

 
Average of ratings: -
Picture of Simon Brock
Re: Can not find data record in database table course_modules.
 

fixed it with

update mdl_course set modinfo='' where id = 10024;

 
Average of ratings:Useful (1)
This is me
Re: Can not find data record in database table course_modules.
 

I'm getting a similar error when I want to load a SCORM.

Debug info: SELECT * FROM {course} WHERE id = ?
[array (
0 => 41812,
)]
Stack trace:
  • line 1272 of \lib\dml\moodle_database.php: dml_missing_record_exception thrown
  • line 1249 of \lib\dml\moodle_database.php: call to moodle_database->get_record_select()
  • line 66 of \file.php: call to moodle_database->get_record()

Only happens in one course, other courses are ok.

 
Average of ratings: -
Picture of Joseph Gilgen
Re: Can not find data record in database table course_modules.
 

Just to be explicit-

id is the course id number, which you can see in the url:

http://yourmoodlesite.org/course/view.php?id=10024

 
Average of ratings: -
Picture of Sarah Hasanloo Nikfar
Re: Can not find data record in database table context
 

Hi, i have this problem for course table:

'Can not find data record in database table course.'

none of this answers have effect on result.

please help me!

thanks in advanced.

 
Average of ratings: -
bee
Re: Can not find data record in database table context
 

Just experienced this issue in Moodle v2.4.6

I was working in the course categories view and suspect I may have caused the problem* by doing one of the following. In the situation where I had:

Category A
       Category B
             Category C
Category D

- With Categories B and C both empty, I deleted Category B without first deleting Category C.

- With a different set of categories, but in a similar arrangement, I moved Category C from under Category B to Category D

 

Thanks to the tips provided by participants in this thread, I fixed the problem by creating a new category structure and used the Moodle interface to move the courses to the new categories.

* When I have a moment, I'll go back and test my theory on our sandbox instance and report the results back here and to the Moodle Tracker.

 

Hrynkiw
Kwantlen Polytechnic

 
Average of ratings: -
Daniel Phillips
Re: Can not find data record in database table context
 
Yes thank you to all who contributed.

We had a similar problem with a group of teaching staff that were getting the same error message when visiting their MyHome pages.

It turned out to be because of some old courses that we were removing for archiving and removal process (that they had access to) did not delete properly.

So to fix we popped into the courses and reset their categories (by moving into a new category then back again) and now their MyHome pages load with out the error message.

Many thanks again.

 
Average of ratings: -
Picture of Kristi N
Re: Can not find data record in database table context
 

Hello,

I am having the exact same problem when upgrading from Moodle 2.3 to either 2.4 or 2.5.   There are two courses that I can no longer access, though the do appear to be in the database.  

I tried the SQL query Tim suggested and only had the one row returned with contextlevel = 10 so it isn't the same issue, just similar.  Can someone please help me find the proper SQL query I need to find the error?

 

Here is the stack trace for one of the courses:

Can not find data record in database table course.

Debug info: SELECT id,category FROM {course} WHERE id = ?
[array (
0 => '4',
)]
Error code: invalidrecord
Stack trace:
  • line 1372 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
  • line 1348 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
  • line 6576 of /lib/accesslib.php: call to moodle_database->get_record()
  • line 124 of /blocks/course_list/block_course_list.php: call to context_course::instance()
  • line 51 of /blocks/course_list/block_course_list.php: call to block_course_list->get_remote_courses()
  • line 764 of /blocks/moodleblock.class.php: call to block_course_list->get_content()
  • line 238 of /blocks/moodleblock.class.php: call to block_list->formatted_contents()
  • line 951 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 1003 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 353 of /lib/blocklib.php: call to block_manager->ensure_content_created()
  • line 6 of /theme/ascend_tablet/layout/general.php: call to block_manager->region_has_content()
  • line 847 of /lib/outputrenderers.php: call to include()
  • line 777 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 240 of /course/view.php: call to core_renderer->header()
 
Average of ratings: -
Picture of Miro Iliaš
Re: Can not find data record in database table context
 

Hi, I have the same problem with Moodle 2.5 - Dataform. When I try to add and element to the Dataform module, I got "Can not find data record in database table course_modules." It then redirects me to this page.

Any help with this error for our Moodle 2.5  admin ? 

 Best, Miro

 
Average of ratings: -
Picture of John Andrewartha
Re: Can not find data record in database table context
 

Me to, here is the debug form Moodle 2.5+ (Build: 20130627)

Strict Standards: Creating default object from empty value in /var/www/moodle/report/log/index.php on line 107
Coding problem - missing course modinfo property in get_fast_modinfo() call

    line 1384 of /lib/modinfolib.php: call to debugging()
    line 1803 of /lib/navigationlib.php: call to get_fast_modinfo()
    line 1870 of /lib/navigationlib.php: call to global_navigation->generate_sections_and_activities()
    line 420 of /course/format/lib.php: call to global_navigation->load_generic_course_sections()
    line 1782 of /lib/navigationlib.php: call to format_base->extend_course_navigation()
    line 1093 of /lib/navigationlib.php: call to global_navigation->load_course_sections()
    line 3178 of /lib/navigationlib.php: call to global_navigation->initialise()
    line 717 of /lib/pagelib.php: call to settings_navigation->__construct()
    line 734 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
    line 6348 of /lib/adminlib.php: call to moodle_page->__get()
    line 150 of /report/log/index.php: call to admin_externalpage_setup()

Coding problem - missing course sectioncache property in get_fast_modinfo() call

    line 1388 of /lib/modinfolib.php: call to debugging()
    line 1803 of /lib/navigationlib.php: call to get_fast_modinfo()
    line 1870 of /lib/navigationlib.php: call to global_navigation->generate_sections_and_activities()
    line 420 of /course/format/lib.php: call to global_navigation->load_generic_course_sections()
    line 1782 of /lib/navigationlib.php: call to format_base->extend_course_navigation()
    line 1093 of /lib/navigationlib.php: call to global_navigation->load_course_sections()
    line 3178 of /lib/navigationlib.php: call to global_navigation->initialise()
    line 717 of /lib/pagelib.php: call to settings_navigation->__construct()
    line 734 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
    line 6348 of /lib/adminlib.php: call to moodle_page->__get()
    line 150 of /report/log/index.php: call to admin_externalpage_setup()

Notice: Undefined property: stdClass::$format in /var/www/moodle/course/format/lib.php on line 171
Format plugin format_ is not found. Using default format_topics

    line 118 of /course/format/lib.php: call to debugging()
    line 179 of /course/format/lib.php: call to format_base::get_format_or_default()
    line 35 of /course/format/lib.php: call to format_base::instance()
    line 1807 of /lib/navigationlib.php: call to course_get_format()
    line 1870 of /lib/navigationlib.php: call to global_navigation->generate_sections_and_activities()
    line 420 of /course/format/lib.php: call to global_navigation->load_generic_course_sections()
    line 1782 of /lib/navigationlib.php: call to format_base->extend_course_navigation()
    line 1093 of /lib/navigationlib.php: call to global_navigation->load_course_sections()
    line 3178 of /lib/navigationlib.php: call to global_navigation->initialise()
    line 717 of /lib/pagelib.php: call to settings_navigation->__construct()
    line 734 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
    line 6348 of /lib/adminlib.php: call to moodle_page->__get()
    line 150 of /report/log/index.php: call to admin_externalpage_setup()

Skip to main content

 

I have tried Tims fix and done multipal manual runs on cron.php

 
Average of ratings:Useful (1)
Picture of Keith Landa
Re: Can not find data record in database table context
 

We did an upgrade from 2.7.x to 2.8.1, and everything looked fine.  Tested out fine on our dev server, and a smooth upgrade on production.

However, we've now heard from students who can't access their courses.  Other roles (admin, teacher, a custom librarian role based off of teacher) have no problems.

Students with access issues get the message: "Can not find data record in database table course".

Affected courses have all students locked out.  Other courses in the same category don't have a problem.

We're using the Banner LMB enrollment plugin for the current semester, so I thought it might be related to that.  But there are past semester courses that were batch enrolled using the manual enrollment process that are also affected.

Does this seem to be the same context issue reported here?  Thanks.

 
Average of ratings: -
Picture of Keith Landa
Re: Can not find data record in database table context
 

It looks like it might be an issue with the attendance plugin.

https://moodle.org/mod/forum/discuss.php?d=275751

 
Average of ratings: -
Picture of Moodle Admin
Re: Can not find data record in database table context
 

Hi Keith,

We're experiencing this issue only with the auto attendance mod/block if that's helps. After the upgrade our site works fine and all the courses load ok, we get the "Can not find data record in database table context" message only in relation to the attendance module.

You need to enable debugging to see where this error refers to, it debug information would tell you from where it comes.

But would be nice if someone (maybe a developer?) who knows could shed some light on how this context generic message is being triggered and what might be the source of problem. Just a bit of help to investigate further..

 
Average of ratings: -
Picture of Keith Landa
Re: Can not find data record in database table context
 

I disabled both the attendance activity module and the related attendance block, and student access to courses has been restored.

It sounds as though the maintainer of the attendance activity is aware of the problem and working on an update, so hopefully there will be a new module and block to install shortly.

 
Average of ratings: -
Picture of Keith Landa
Re: Can not find data record in database table context
 

Is the problem with both the activity module and the block, or just with the block?  Thanks.

 
Average of ratings: -