Skip to content
Permalink
Browse files

TICKET 0008057: Check Connection with configuration containing Custom…

… Field - Crash asXML()
  • Loading branch information...
fmancardi committed Aug 18, 2017
1 parent 0d65036 commit 7df0dc0984fe56a1149d499bd5be7bacaf6e482a
@@ -33,6 +33,7 @@ abstract class issueTrackerInterface
// members to store the bugtracking information.
// Values are set in the actual subclasses
var $cfg = null; // simpleXML object
var $xmlCfg = null; // xml string
var $name = null;
var $tlCharSet = null;
@@ -110,11 +111,11 @@ function setCfg($xmlString)
return false;
}
$xmlCfg = "<?xml version='1.0'?> " . $xmlString;
$this->xmlCfg = "<?xml version='1.0'?> " . $xmlString;
libxml_use_internal_errors(true);
try
{
$this->cfg = simplexml_load_string($xmlCfg);
$this->cfg = simplexml_load_string($this->xmlCfg);
if (!$this->cfg)
{
$msg = $signature . " - Failure loading XML STRING\n";
@@ -114,8 +114,9 @@ function completeCfg()
if( property_exists($this->cfg,'custom_fields') )
{
$cf = $this->cfg->custom_fields;
$this->cfg->custom_fields = (string)$cf->asXML();
libxml_use_internal_errors(true);
$xcfg = simplexml_load_string($this->xmlCfg);
$this->cfg->custom_fields = (string)$xcfg->custom_fields->asXML();
}
}
@@ -430,7 +431,7 @@ public function addIssue($summary,$description,$opt=null)
{
$msg = "Create REDMINE Ticket FAILURE => " . $e->getMessage();
tLog($msg, 'WARNING');
$ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue));
$ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($op));
}
return $ret;
}

0 comments on commit 7df0dc0

Please sign in to comment.
You can’t perform that action at this time.