Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9
-
Fix Version/s: 1.9.1
-
Component/s: Database activity module
-
Labels:None
-
Environment:Windows Server 2003
Apache 2.0.59
PHP 5.2.5
MySQL 5.0.51a
-
Database:MySQL
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
I'm running into an error where the database preset is not importing templates, but it is importing the fields. if I try to import the buzz preset (http://moodle.org/mod/forum/discuss.php?d=84050#p371801 ) with debugging set to all I get the following error:
Notice: Array to string conversion in C:\Program Files\Apache Group\Apache2\htdocs\Moodle\moodle19\lib\datalib.php on line 28
Incorrect integer value: '' for column 'notification' at row 1
It seems that the notification field requires an integer value and will not accept a Null value (like the one being passed). This causes the import to fail (but it actually displays a message saying that the preset was applied successfully)
I've attached a screenshot of the error.
I'm seeing this on Moodle 1.9+ (Build 20080410)
Attachments
Issue Links
| This issue will be resolved by: | ||||
| MDL-14540 | Database activity import preset don't work correctly |
|
|
|
| This issue has a non-specific relationship to: | ||||
| MDL-14548 | Modify the notification field in data module to be NOT NULL and to have a nice (0) default |
|
|
|
| This issue has been marked as being related by: | ||||
| MDL-12439 | Templates not imported in database preset import |
|
|
|
The problem seems to have been introduced by MDL-8377
Line 38 of mod/data/db/install.xml reads:
<FIELD NAME="notification" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="Notify people when things change" PREVIOUS="editany"/>
I found that if it has a default value that is an integer and in place of a default of NULL, the import works properly: I would propose to change it to:
<FIELD NAME="notification" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" DEFAULT = "0" SEQUENCE="false" ENUM="false" COMMENT="Notify people when things change" PREVIOUS="editany"/>
I don't think this will break anything as it does not look like the notification field is currently being used