MNet upgrade: missing required not null value
authorDavid Mudrak <david.mudrak@gmail.com>
Wed, 10 Nov 2010 16:01:23 +0000 (16:01 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Wed, 10 Nov 2010 16:01:23 +0000 (16:01 +0000)
The column description in mnet_service table is set to not null and no
value is set for the insert_record(). We must explicitly provide the
empty string if the description is not defined in db/mnet.php file.

lib/upgradelib.php

index e5c3ae9..1e4ad34 100644 (file)
@@ -1507,6 +1507,7 @@ function upgrade_plugin_mnet_functions($component) {
                 } else {
                     $serviceobj = new stdClass();
                     $serviceobj->name        = $service['servicename'];
+                    $serviceobj->description = empty($service['description']) ? '' : $service['description'];
                     $serviceobj->apiversion  = $service['apiversion'];
                     $serviceobj->offer       = 1;
                     $serviceobj->id          = $DB->insert_record('mnet_service', $serviceobj);