Fatal error in backup since upgrading to 1.9

Fatal error in backup since upgrading to 1.9

by Charles Dewar -
Number of replies: 0
I get the following error when trying to perform a course backup since upgrading to 1.9. I followed the upgrade instructions carefully and the install script went without a hitch. Everything else is running like a charm.

This is the error:

Fatal error: Call to a member function get_calculation() on a non-object in /mounted-storage/home70c/sub001/sc19551-RBTH/charlesdewar.com/moodle/backup/backuplib.php on line 1526

This is the section that is crashing with the line in bold:

//Begin grade_item
fwrite ($bf,start_tag("GRADE_ITEM",4,true));
//Output individual fields

fwrite ($bf,full_tag("ID",5,false,$grade_item->id));
fwrite ($bf,full_tag("CATEGORYID",5,false,$grade_item->categoryid));
fwrite ($bf,full_tag("ITEMNAME",5,false,$grade_item->itemname));
fwrite ($bf,full_tag("ITEMTYPE",5,false,$grade_item->itemtype));
fwrite ($bf,full_tag("ITEMMODULE",5,false,$grade_item->itemmodule));
fwrite ($bf,full_tag("ITEMINSTANCE",5,false,$grade_item->iteminstance));
fwrite ($bf,full_tag("ITEMNUMBER",5,false,$grade_item->itemnumber));
fwrite ($bf,full_tag("ITEMINFO",5,false,$grade_item->iteminfo));
fwrite ($bf,full_tag("IDNUMBER",5,false,$grade_item->idnumber));
// use [idnumber] in calculation instead of [#giXXX#]
fwrite ($bf,full_tag("CALCULATION",5,false,$grade_item->get_calculation()));
fwrite ($bf,full_tag("GRADETYPE",5,false,$grade_item->gradetype));
fwrite ($bf,full_tag("GRADEMAX",5,false,$grade_item->grademax));
fwrite ($bf,full_tag("GRADEMIN",5,false,$grade_item->grademin));
fwrite ($bf,full_tag("SCALEID",5,false,$grade_item->scaleid));
fwrite ($bf,full_tag("OUTCOMEID",5,false,$grade_item->outcomeid));
fwrite ($bf,full_tag("GRADEPASS",5,false,$grade_item->gradepass));
fwrite ($bf,full_tag("MULTFACTOR",5,false,$grade_item->multfactor));
fwrite ($bf,full_tag("PLUSFACTOR",5,false,$grade_item->plusfactor));
fwrite ($bf,full_tag("AGGREGATIONCOEF",5,false,$grade_item->aggregationcoef));
fwrite ($bf,full_tag("DISPLAY",5,false,$grade_item->display));
fwrite ($bf,full_tag("DECIMALS",5,false,$grade_item->decimals));
fwrite ($bf,full_tag("HIDDEN",5,false,$grade_item->hidden));
fwrite ($bf,full_tag("LOCKED",5,false,$grade_item->locked));
fwrite ($bf,full_tag("LOCKTIME",5,false,$grade_item->locktime));
fwrite ($bf,full_tag("NEEDSUPDATE",5,false,$grade_item->needsupdate));
fwrite ($bf,full_tag("TIMECREATED",5,false,$grade_item->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",5,false,$grade_item->timemodified));
Average of ratings: -