General help

Urgent help :more then one record.

Picture of Murtaza Yousuf
Urgent help :more then one record.
I am using moodle 2.4.4
on adding any topic to course or activty to a topic i get an error below.
Although after going back i can see the topic has been added but that is not the case with activity .. Activity doesnt add.
Please help me guys. i had just updated a live running moodle.
Debug info: 
Error code: morethanonerecordinfetch
Stack trace:
  • line 476 of /lib/setuplib.php: moodle_exception thrown
  • line 163 of /lib/grade/grade_object.php: call to print_error()
  • line 191 of /lib/grade/grade_category.php: call to grade_object::fetch_helper()
  • line 1488 of /lib/grade/grade_category.php: call to grade_category::fetch()
  • line 389 of /lib/grade/grade_item.php: call to grade_category::fetch_course_category()
  • line 128 of /lib/gradelib.php: call to grade_item->insert()
  • line 692 of /mod/scorm/lib.php: call to grade_update()
  • line 159 of /mod/scorm/lib.php: call to scorm_grade_item_update()
  • line 449 of /course/modedit.php: call to scorm_add_instance()
Average of ratings: -
Picture of Helen Foster
Re: Urgent help :more then one record.
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators


How about trying a forum search for morethanonerecordinfetch or even a search (which also searches the tracker and documentation) as most likely you're not the only one to have encountered this error and it's likely someone has posted an explanation.

Average of ratings: -
Picture of Jennifer McVicker
Re: Urgent help :more then one record.

I am having the same issue, also running Moodle 2.4.4.  I have an external script that imports courses into moodle by essentially copying an existing course and all of its settings/assignments/etc.  All is well until I edit a quiz. After that, any graded activity (assignment, quiz) throws the error "more than one record in fetch()".  Prior to the edit, there is a single record in the grade_items table with the itemtype = 'course' and the iteminstance = the course ID.  When the quiz is updated, the following happens: the grade_item course (itemtype="course") record is duplicated but the itemtype is set to "category", and any grade_item category (itemtype="category") records are duplicated, but the itemtype is set to "course".  


I have done searches on the error, of course, but it looks like this item was deemed "resolved" in 2012 (with an update I can't link to because I'm a new forum user).  Something must have happened in the interim that is causing this error to recur now.

Average of ratings: -