Moodle

Database activity import preset don't work correctly

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:
    1.9 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1
  • Database:
    PostgreSQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

When importing a database preset, there is an SQL error by an uninitialized variable.
The error shows some like this:

ERROR: invalid input syntax for integer: ""

UPDATE mdl_data SET course .....defaultsortdir = '0',editany = '0',notification = '' WHERE id = 9

the error is in the notification variable.

For solve this we must modify the file /moodle/mod/data/lib.php
and put in the function: data_update_instance($data)
this code:
if (empty($data->notification)) { $data->notification = 0; }

before call the function:
if (! update_record('data', $data)) { return false; }

See you

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Hi Antonio,

this has been fixed now in CVS, will be available in some hours (CVS access) or in next weekly release next Wednesday (http://download.moodle.org).

Anyway... I'm going to change that DB field to have a proper default = 0 to save possible future problems... I've created MDL-14548 to fix that definitively.

Thanks for the complete report, Antonio! B-)

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi Antonio, this has been fixed now in CVS, will be available in some hours (CVS access) or in next weekly release next Wednesday (http://download.moodle.org). Anyway... I'm going to change that DB field to have a proper default = 0 to save possible future problems... I've created MDL-14548 to fix that definitively. Thanks for the complete report, Antonio! B-) Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Resolving as fixed, ciao

Show
Eloy Lafuente (stronk7) added a comment - Resolving as fixed, ciao
Hide
Antonio Piedras Morente added a comment -

Thanks to you Eloy for fixed the bug
"Nos vemos en la MoodleMoot de Barcelona"

Agur

Show
Antonio Piedras Morente added a comment - Thanks to you Eloy for fixed the bug "Nos vemos en la MoodleMoot de Barcelona" Agur
Hide
Eloy Lafuente (stronk7) added a comment -

Thanks for feedback Antonio

"Allí estaremos, espero"

Agur!

Show
Eloy Lafuente (stronk7) added a comment - Thanks for feedback Antonio "Allí estaremos, espero" Agur!
Hide
Petr Škoda (skodak) added a comment -

reviewed, closing - thanks

Show
Petr Škoda (skodak) added a comment - reviewed, closing - thanks

Dates

  • Created:
    Updated:
    Resolved: