Keep getting "Invalid Course Module ID" error

Keep getting "Invalid Course Module ID" error

by Justin Reeve -
Number of replies: 0

I can't figure this out. I have a process that automatically creates page instances and course module/sections. Basically, it touches mdl_page, mdl_course_modules, and mdl_course_sections. However, when I try to access modedit.php/update={cmid} it gives me the "Invalid Course Module ID" error.

I've tried creating the same pages through the normal modedit.php?add=page... form, and it works fine that way. I can't figure out what I'm missing. Here's an example of the database records created by my process.

mdl_course_modules
id: 286
course: 4
module: 13 (page)
instance: 187
section: 225
idnumber: NULL
visible: 1

mdl_course_sections
id: 225
course: 4
section: 187
sequence: 295,286

mdl_page
id: 187
course: 4
name: Test Page
intro: <p>Test Page</p>
content: <p>Test Page</p>

There aren't any other tables that should be touched by this process, are there? I didn't see any in modedit.php.

(It's just a coincidence that the instance/mdl_page id and section # are the same.)

Average of ratings: -