openequella / moodle-mod_openEQUELLA

Moodle module for integration with openEQUELLA
https://openequella.github.io/moodle-mod_openEQUELLA/
GNU General Public License v3.0
6 stars 16 forks source link

callbackmulti: The section passed to course_add_cm_to_section is the relative section number #17

Closed aolley closed 11 years ago

aolley commented 11 years ago

$mod->section is set to the $sectionid as it should be. However the $section param passed to course_add_cm_to_section function is meant to be the relative section number in the course, not the absolute section id.

aolley commented 11 years ago

The 'section' field in the course_module table is recorded with the course_sections.id field.

So the "section" in $mod, and the one passed to course_add_cm_to_section have to be different. So if sectionid is mean't to be the sectionnum, then the $mod->section = $sectionid needs to have the $DB call I did later. I'll amend my commit to reflect that.

dcai commented 11 years ago

Thanks @aolley I see what you meant now.

aolley commented 11 years ago

Updated my commit :)

dcai commented 11 years ago

Hi @aolley I committed df3a2b8bc5407ef1f73f0765b58f072cd50ce994 to address the issues I commented in your last commit.

aolley commented 11 years ago

"$sectionid supposed to be course_sections.id right? you got course_sections.section here."

Ah yes, I had just moved the DB call up when i amended the commit and fixed up the params, forgot to switch the field it grabs.