MDL-31436 registration: do not send false in update request
authorMarina Glancy <marina@moodle.com>
Wed, 13 Dec 2017 04:36:57 +0000 (12:36 +0800)
committerDamyon Wiese <damyon@moodle.com>
Wed, 13 Dec 2017 05:51:25 +0000 (13:51 +0800)
lib/classes/hub/registration.php

index 7dc8be6..187ab85 100644 (file)
@@ -158,8 +158,8 @@ class registration {
         $cleanhuburl = clean_param(HUB_MOODLEORGHUBURL, PARAM_ALPHANUMEXT);
         foreach (self::FORM_FIELDS as $field) {
             $siteinfo[$field] = get_config('hub', 'site_'.$field.'_' . $cleanhuburl);
-            if ($siteinfo[$field] === false && array_key_exists($field, $defaults)) {
-                $siteinfo[$field] = $defaults[$field];
+            if ($siteinfo[$field] === false) {
+                $siteinfo[$field] = array_key_exists($field, $defaults) ? $defaults[$field] : null;
             }
         }