invalidrecord error when mapping feedback

invalidrecord error when mapping feedback

by Chad Bergeron -
Number of replies: 6

We're starting the process of mapping a sitewide course evaluation to this term's courses, and after adding a handful, are now getting an 'error/moodle/invalidrecord' error (See attached).  Has anyone else come across this?  I can go into the database tables and delete the mappings, but then we have to start over.  I'd love to know why it is happeneing, and if we're alone or not in seeing this.

Attachment Screenshot - 04092013 - 022753 PM.png
Average of ratings: -
In reply to Chad Bergeron

Re: invalidrecord error when mapping feedback

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Chad,

I am not sure where the error come from. Can you turn debug mode on to show more information about this error?
Thank you.

Best regards
Andreas

In reply to Chad Bergeron

Re: invalidrecord error when mapping feedback

by Chad Bergeron -

Debugging on gives the following:

Debug info: SELECT id,category FROM {course} WHERE id = ?
[array (
0 => '375',
)]
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 6541 of /lib/accesslib.php: call to moodle_database->get_record()
line 133 of /mod/feedback/mapcourse.php: call to context_course::instance()


It looks like it says it can't find record 375, but that record is in the database when I look.

In reply to Chad Bergeron

Re: invalidrecord error when mapping feedback

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Chad,

that sounds strange. I have no idea what here goes wrong sad. Are you realy sure that there is a record in the course table with id=375? Did you tried to call this sql directly? Can you see this course in moodle?

Andreas

In reply to Andreas Grabs

Re: invalidrecord error when mapping feedback

by Chad Bergeron -

There was a record id=375 in mdl_feedback_sitecourse_map.  When I deleted that record, the error went away.  I was then able to attempt mapping the course again and it worked.  The course mapped has a different course id number.  Why would it be looking for a course id=375?

Confusedly,

Chad

In reply to Chad Bergeron

Re: invalidrecord error when mapping feedback

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Chad,

I am sorry, but I don't know what here went wrong sad. Maybe your course was deleted before and restored as a new course with a new id. I tried to reproduce this but this error didn't appear.

Best regards
Andreas

In reply to Andreas Grabs

Re: invalidrecord error when mapping feedback

by Chad Bergeron -

I don't think it has anything to do with the courses.  The 375 refers to mdl_feedback_sitecourse_map=>id, and when I remove the entry from the db, the error goes away.  As I continue mapping, the error comes up again (with a different row id, always the most recent mapping I've entered), so it is happening with courses I know exist.  Sometimes after removing the row I am able to reenter the mapping successfully, sometimes the error comes right back when I remap.

I will try downloading the latest version of hte module again and see if that fixes the issue.