Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.9.9
-
Moodle 1.9.9 (Build: 20100609), Debian Linux, Apache
Apache/2.2.9 (Debian) mod_jk/1.2.26 PHP/5.2.6-1+lenny9 with Suhosin-Patch proxy_html/3.0.0 mod_ssl/2.2.9 OpenSSL/0.9.8g Server at 172.17.1.27 Port 80
-
MySQL
-
MOODLE_19_STABLE
-
MOODLE_19_STABLE
-
Easy
Description
Moodle 1.9.9 (Build: 20100609)
Developing an import script, which imports courses into Moodle from a database of a custom software.
I import and create courses, then doing the following for each course:
- adding forum module,
- adding chat module,
- adding resource (file subtype, used for creating http link) module,
- setting a description to section 0 of each course
Creating of courses are done in a loop, and everything works fine, if just one loop is done.
When doing multiple loops, the execution stopped when /moodle/mod/resource/mod_form.php was executed 2nd time, only one full loop was executed, 2nd loop was stopped.
I tracked down the bug and found, that execution stops at /moodle/mod/resource/mod_form.php line 25
when "resource.class.php" is required.
After changing required to required_once , the loops did not stop at mod_form.php line 25, and all loops was executed, successfully.
BUGFIX in
/moodle/mod/resource/mod_form.php
line 25
require($CFG->dirroot.'/mod/resource/type/'.$type.'/resource.class.php');
change to
require_once($CFG->dirroot.'/mod/resource/type/'.$type.'/resource.class.php');
Please include this BUGFIX into
- Moodle v1.9.13
and - Moodle 2.0.4
Thanks in advance.