Moodle

Database Presets do not import templates

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.1
  • 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)

Issue Links

Activity

Hide
Stephen Bourget added a comment -

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

Show
Stephen Bourget added a comment - 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
Hide
Eloy Lafuente (stronk7) added a comment -

Hi, I'm going to fix this as suggested by MDL-14540 .... will be back soon.

Show
Eloy Lafuente (stronk7) added a comment - Hi, I'm going to fix this as suggested by MDL-14540 .... will be back soon.
Hide
Eloy Lafuente (stronk7) added a comment -

Hi again, Stephen,

I've applied one temporal fix for this problem as part of MDL-14540. Also, I've addressed MDL-14548 to fix the problem definitively under Moodle 2.0.

Resolving this as fixed... ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi again, Stephen, I've applied one temporal fix for this problem as part of MDL-14540. Also, I've addressed MDL-14548 to fix the problem definitively under Moodle 2.0. Resolving this as fixed... ciao
Hide
Dongsheng Cai added a comment -

Thanks

Show
Dongsheng Cai added a comment - Thanks

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: