Restore course insert

Restore course insert

by David CATERINA -
Number of replies: 0

Hello, I'm working on a course duplication feature (from a restoration). I use at one point this function with 3 parameters restore_dbops :: create_new_course ($ coursename, $ shortname, $ coursecategory) but the insertion in the course table is not done ($ courseid = $ DB-> insert_record ('course', $ course));

I do not understand where the error comes from I debug and redo the insertion manually with phpmyadmin and this inserts. Do you have any ideas?

$ courseid goes to +1 but no data in the table

My var_dump before insertion into the race table:

object (stdClass) # 178 (7) {["fullname"] => string (6) "test" ["shortname"] => string (12) "test" ["category"] => int (3) [ "sortorder"] => int (0) ["timecreated"] => int (1584718512) ["timemodified"] => int (1584718512) ["visible"] => int (0)}

restore_dbops :: create_new_course is used again when you restore a course (backup) and i have no errors...

Thanks in advance.

Average of ratings: -