Moodle 3.2.1+: error during brand new installation (in admin/tool/usertours)

Moodle 3.2.1+: error during brand new installation (in admin/tool/usertours)

by Leônidas Brandão -
Number of replies: 0
Dear all,

I tried to install a new version of Moodle 3.2.1+ and experienced problems with the package 'Tours' (inside './admin/tool/usertour').

I experienced 2 problems related to empty object. To complete the Moodle installation, it was necessary to change one function inside the following 2 files:

./admin/tool/usertours/classes/manager.php: inside the function 'import_tour_from_json'
   After '$tour->persist(true);', I inserted a test
  'if ($steps == null) return $tour; '

./admin/tool/usertours/classes/tour.php: inside the function 'persist'
   I provided an artificial entry to avoid problem, of insertion with null fields, I put something like this:
   'if ($record->name == null && $record->enabled == null) { $record->name = "nothing"; $record->description = "2017/02/20"; $record->enabled = 1; $record->configdata = "2017/02/20"; }'

I am using PHP Version 5.6.30-0+deb8u1 on Debian-Linux.

Is this a real problem of this version?

Best regards,
Leônidas
http://www.matematica.br

PS: The first error presented after I pressed the button to complete the installation, the verification page presented an error:

...
tool_uploaduser
Success

tool_usertours

Error writing to database

More information about this error

It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the ins
tallation.
Debug info: Column 'enabled' cannot be null
INSERT INTO md_tool_usertours_tours (name,description,pathmatch,enabled,sortorder,configdata) VALUES(?,?,?,?,?,?)
[array (
0 => '',
1 => '',
2 => NULL,
3 => NULL,
4 => 0,
5 => 'null',
)]
Error code: dmlwriteexception
Stack trace:

    line 482 of /lib/dml/moodle_database.php: dml_write_exception thrown
    line 1178 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
    line 1224 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
    line 521 of /adminleo/tool/usertours/classes/tour.php: call to mysqli_native_moodle_database->insert_record()
    line 612 of /adminleo/tool/usertours/classes/manager.php: call to tool_usertours\tour->persist()
    line 826 of /adminleo/tool/usertours/classes/manager.php: call to tool_usertours\manager::import_tour_from_json()
    line 78 of /adminleo/tool/usertours/db/install.php: call to tool_usertours\manager::update_shipped_tours()
    line 531 of /lib/upgradelib.php: call to xmldb_tool_usertours_install()
    line 1748 of /lib/upgradelib.php: call to upgrade_plugins()
    line 693 of /adminleo/index.php: call to upgrade_noncore()
Average of ratings: -