summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/locationinfo/inc/coursebackend.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend.inc.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend.inc.php b/modules-available/locationinfo/inc/coursebackend.inc.php
index 7162c885..dcd92f6f 100644
--- a/modules-available/locationinfo/inc/coursebackend.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend.inc.php
@@ -334,7 +334,7 @@ abstract class CourseBackend
{
$cleanresponse = preg_replace('/(<\/?)(\w+):([^>]*>)/', '$1$2$3', $response);
try {
- $xml = new SimpleXMLElement($cleanresponse);
+ $xml = @new SimpleXMLElement($cleanresponse); // This spams before throwing exception
} catch (Exception $e) {
$this->error = 'Could not parse reply as XML, got ' . get_class($e) . ': ' . $e->getMessage();
if (CONFIG_DEBUG) {
@@ -370,6 +370,9 @@ class BackendProperty {
* @param mixed $current current value of this property.
*/
public function initForRender($current = null) {
+ if ($current === null) {
+ $current = $this->default;
+ }
if (is_array($this->type)) {
$this->template = 'dropdown';
$this->select_list = [];
@@ -391,7 +394,7 @@ class BackendProperty {
} elseif ($this->type === 'password') {
$this->inputtype = Property::getPasswordFieldType();
}
- $this->currentvalue = $current === null ? $this->default : $current;
+ $this->currentvalue = $current;
}
public $inputtype;
public $template;