From c59d3cc62440353a23d3ac83f560ebbaee5e783f Mon Sep 17 00:00:00 2001 From: Molkobain Date: Mon, 1 Apr 2019 16:52:22 +0200 Subject: [PATCH 01/14] Fix unreachable log message on exception --- setup/ajax.dataloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/ajax.dataloader.php b/setup/ajax.dataloader.php index 127873410..36485bdc0 100644 --- a/setup/ajax.dataloader.php +++ b/setup/ajax.dataloader.php @@ -150,8 +150,8 @@ try $sAuthent = utils::ReadParam('authent', '', false, 'raw_data'); if (!file_exists(APPROOT.'data/setup/authent') || $sAuthent !== file_get_contents(APPROOT.'data/setup/authent')) { - throw new SecurityException('Setup operations are not allowed outside of the setup'); SetupPage::log_error("Setup operations are not allowed outside of the setup"); + throw new SecurityException('Setup operations are not allowed outside of the setup'); } switch($sOperation) From 34c030b501a4788aab3f92c8d49a095829ad5b7e Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 4 Apr 2019 10:56:15 +0200 Subject: [PATCH 02/14] =?UTF-8?q?N=C2=B02070=20Extend=20ModelFactory=20imp?= =?UTF-8?q?lementations=20to=20optionally=20check=20meta=20classes=20(PHP)?= =?UTF-8?q?=20along=20with=20regular=20XML=20classes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/modelfactory.class.inc.php | 41 ++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index cecdbb221..9bcd3904f 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -1078,13 +1078,17 @@ class ModelFactory /** * Check if the class specified by the given name already exists in the loaded DOM + * * @param string $sClassName The node corresponding to the class to load - * @throws Exception + * @param bool $bIncludeMetas Look for $sClassName also in meta declaration (PHP classes) if not found in XML classes + * + * @throws \Exception + * * @return bool True if the class exists, false otherwise */ - protected function ClassNameExists($sClassName) + protected function ClassNameExists($sClassName, $bIncludeMetas = false) { - return !is_null($this->GetClass($sClassName)); + return !is_null($this->GetClass($sClassName, $bIncludeMetas)); } /** @@ -1190,14 +1194,22 @@ EOF { return $this->GetNodes("/itop_design/classes//class[@id][@_created_in='$sModuleName']"); } - + /** * List all classes from the DOM - * @throws Exception + * + * @param bool $bIncludeMetas Also look for meta declaration (PHP classes) in addition to XML classes + * + * @return \DOMNodeList */ - public function ListAllClasses() + public function ListAllClasses($bIncludeMetas = false) { - return $this->GetNodes("/itop_design/classes//class[@id]"); + $sXPath = "/itop_design/classes//class[@id]"; + if($bIncludeMetas === true) + { + $sXPath .= "|/itop_design/meta/classes/class[@id]"; + } + return $this->GetNodes($sXPath); } /** @@ -1210,13 +1222,22 @@ EOF } /** - * @param $sClassName + * @param string $sClassName + * @param bool $bIncludeMetas Look for $sClassName also in meta declaration (PHP classes) if not found in XML classes * - * @return \DOMElement + * @return null|\DOMElement */ - public function GetClass($sClassName) + public function GetClass($sClassName, $bIncludeMetas = false) { + // Check if class among XML classes $oClassNode = $this->GetNodes("/itop_design/classes//class[@id='$sClassName']")->item(0); + + // If not, check if class among exposed meta classes (PHP classes) + if(is_null($oClassNode) && ($bIncludeMetas === true)) + { + $oClassNode = $this->GetNodes("/itop_design/meta/classes/class[@id='$sClassName']")->item(0); + } + return $oClassNode; } From 40151c7a43214e178b5fb5e146e5e88d228ddff9 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 5 Apr 2019 16:25:26 +0200 Subject: [PATCH 03/14] =?UTF-8?q?N=C2=B02147=20Fix=20non=20working=20impac?= =?UTF-8?q?t=20relation=20when=20based=20on=20default=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/forms.class.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php index 283965be9..83f17c6ab 100644 --- a/application/forms.class.inc.php +++ b/application/forms.class.inc.php @@ -1334,7 +1334,8 @@ class DesignerIconSelectionField extends DesignerFormField $sPostUploadTo = ($this->sUploadUrl == null) ? 'null' : "'{$this->sUploadUrl}'"; if (!$this->IsReadOnly()) { - $sValue = "defaultValue}\"/>"; + $sDefaultValue = ($this->defaultValue !== '') ? : $this->aAllowedValues[$idx]['value']; + $sValue = ""; $oP->add_ready_script( << Date: Tue, 26 Mar 2019 15:01:42 +0100 Subject: [PATCH 04/14] Better output --- application/utils.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/utils.inc.php b/application/utils.inc.php index 9cafd760c..371b07fe1 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -602,17 +602,19 @@ class utils /** * Format a value into a more friendly format (KB, MB, GB, TB) instead a juste a Bytes amount. * - * @param type $value + * @param int $value * @return string */ public static function BytesToFriendlyFormat($value) { $sReturn = ''; + $iPrecision = 0; // Kilobytes if ($value >= 1024) { $sReturn = 'K'; $value = $value / 1024; + $iPrecision = 1; } // Megabytes if ($value >= 1024) @@ -633,7 +635,7 @@ class utils $value = $value / 1024; } - $value = round($value, 1); + $value = round($value, $iPrecision); return $value . '' . $sReturn . 'B'; } From 9ec36a76f63f3643e1187d64b4afaaee7fd8649b Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 10 Apr 2019 12:12:31 +0200 Subject: [PATCH 05/14] =?UTF-8?q?Carbon:=20N=C2=B01589=20-=20Check=20migra?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/modelfactory.class.inc.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index 9bcd3904f..acce73681 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -615,8 +615,8 @@ class ModelFactory if (!$oTargetParentNode) { - echo "Dumping target doc - looking for '$sParentId'
\n"; - $this->oDOMDocument->firstChild->Dump(); + // echo "Dumping target doc - looking for '$sParentId'
\n"; + // $this->oDOMDocument->firstChild->Dump(); $sPath = MFDocument::GetItopNodePath($oSourceNode); $iLine = $oSourceNode->getLineNo(); throw new MFException($sPath.' at line '.$iLine.": parent class '$sParentId' could not be found", MFException::PARENT_NOT_FOUND, $iLine, $sPath, $sParentId); @@ -633,8 +633,8 @@ class ModelFactory } else { - echo "Dumping target doc - looking for '".$oSourceNode->getAttribute('id')."'
\n"; - $this->oDOMDocument->firstChild->Dump(); + // echo "Dumping target doc - looking for '".$oSourceNode->getAttribute('id')."'
\n"; + // $this->oDOMDocument->firstChild->Dump(); $sPath = MFDocument::GetItopNodePath($oSourceNode); $iLine = $oSourceNode->getLineNo(); throw new MFException($sPath.' at line '.$iLine.": could not be found", MFException::NOT_FOUND, $iLine, $sPath); @@ -2307,8 +2307,8 @@ class MFElement extends Combodo\iTop\DesignElement { if ($bMustExist) { - echo "Dumping parent node
\n"; - $oContainer->Dump(); + //echo "Dumping parent node
\n"; + //$oContainer->Dump(); throw new Exception(MFDocument::GetItopNodePath($this).' at line '.$this->getLineNo().": could not be found"); } if (!$bIfExists) From dcf4963e0c3a41e6b127af689225bec8fed61ea7 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 16 Apr 2019 17:15:15 +0200 Subject: [PATCH 06/14] =?UTF-8?q?N=C2=B02152=20Fix=20bad=20XML=20generatio?= =?UTF-8?q?n=20when=20adding=20a=20dashboard=20attribute=20on=20a=20new=20?= =?UTF-8?q?class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/modelfactory.class.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index acce73681..be5483bed 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -2379,6 +2379,7 @@ class MFElement extends Combodo\iTop\DesignElement case 'added': case 'replaced': case 'needed': + case 'forced': // marked as added or modified, just reset the flag $oNode->removeAttribute('_alteration'); break; From 22342cdc052e94fb4d4c829da4effc03bd2a5a52 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 25 Apr 2019 12:42:16 +0200 Subject: [PATCH 07/14] =?UTF-8?q?:bug:=20N=C2=B02184=20Fix=20validation=20?= =?UTF-8?q?issue=20when=20several=20label=20fiels=20in=20a=20dashlet/desig?= =?UTF-8?q?ner=20form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/forms.class.inc.php | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php index 83f17c6ab..a9aca9836 100644 --- a/application/forms.class.inc.php +++ b/application/forms.class.inc.php @@ -845,25 +845,47 @@ class DesignerFormField class DesignerLabelField extends DesignerFormField { + /** @var int $iCount A counter to automatically make the field code */ + protected static $iCount = 0; + /** @var string $sDescription */ protected $sDescription; - + + /** + * @inheritdoc + */ public function __construct($sLabel, $sDescription) { - parent::__construct('', $sLabel, ''); + // Increase counter + static::$iCount++; + + parent::__construct('label_number_' . static::$iCount, $sLabel, ''); $this->sDescription = $sDescription; } - + + /** + * @param \WebPage $oP + * @param string $sFormId + * @param string $sRenderMode + * + * @return array + */ public function Render(WebPage $oP, $sFormId, $sRenderMode='dialog') { $sId = $this->oForm->GetFieldId($this->sCode); $sName = $this->oForm->GetFieldName($this->sCode); return array('label' => $this->sLabel, 'value' => $this->sDescription); } - + + /** + * @param array $aValues + */ public function ReadParam(&$aValues) { } - + + /** + * @inheritdoc + */ public function IsVisible() { return true; From 78b6c03af766bd9e0b184579505cb8d0844deec4 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 25 Apr 2019 12:46:57 +0200 Subject: [PATCH 08/14] :bulb: Add some PHPDoc --- application/forms.class.inc.php | 109 ++++++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 18 deletions(-) diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php index a9aca9836..a537aba17 100644 --- a/application/forms.class.inc.php +++ b/application/forms.class.inc.php @@ -679,18 +679,34 @@ class DesignerTabularForm extends DesignerForm class DesignerFormField { + /** @var string $sLabel */ protected $sLabel; + /** @var string $sCode */ protected $sCode; + /** @var mixed $defaultValue */ protected $defaultValue; /** @var \DesignerForm $oForm */ protected $oForm; + /** @var bool $bMandatory */ protected $bMandatory; + /** @var bool $bReadOnly */ protected $bReadOnly; + /** @var bool $bAutoApply */ protected $bAutoApply; + /** @var array $aCSSClasses */ protected $aCSSClasses; + /** @var bool $bDisplayed */ protected $bDisplayed; + /** @var array $aWidgetExtraParams */ protected $aWidgetExtraParams; - + + /** + * DesignerFormField constructor. + * + * @param string $sCode + * @param string $sLabel + * @param mixed $defaultValue + */ public function __construct($sCode, $sLabel, $defaultValue) { $this->sLabel = $sLabel; @@ -703,7 +719,10 @@ class DesignerFormField $this->bDisplayed = true; $this->aWidgetExtraParams = array(); } - + + /** + * @return string + */ public function GetCode() { return $this->sCode; @@ -712,69 +731,108 @@ class DesignerFormField /** * @param \DesignerForm $oForm */ - public function SetForm(\DesignerForm $oForm) + public function SetForm(DesignerForm $oForm) { $this->oForm = $oForm; } - + /** + * @param bool $bMandatory + */ public function SetMandatory($bMandatory = true) { $this->bMandatory = $bMandatory; } + /** + * @param bool $bReadOnly + */ public function SetReadOnly($bReadOnly = true) { $this->bReadOnly = $bReadOnly; } - + + /** + * @return bool + */ public function IsReadOnly() { return ($this->oForm->IsReadOnly() || $this->bReadOnly); } + /** + * @param bool $bAutoApply + */ public function SetAutoApply($bAutoApply) { $this->bAutoApply = $bAutoApply; } + /** + * @return bool + */ public function IsAutoApply() { return $this->bAutoApply; } + /** + * @param bool $bDisplayed + */ public function SetDisplayed($bDisplayed) { $this->bDisplayed = $bDisplayed; } + /** + * @return bool + */ public function IsDisplayed() { return $this->bDisplayed; } + /** + * @return string + */ public function GetFieldId() { return $this->oForm->GetFieldId($this->sCode); } - + + /** + * @return string + */ public function GetWidgetClass() { return 'property_field'; } - + + /** + * @return array + */ public function GetWidgetExtraParams() { return $this->aWidgetExtraParams; } - + + /** + * @param \WebPage $oP + * @param string $sFormId + * @param string $sRenderMode + * + * @return array + */ public function Render(WebPage $oP, $sFormId, $sRenderMode='dialog') { $sId = $this->oForm->GetFieldId($this->sCode); $sName = $this->oForm->GetFieldName($this->sCode); return array('label' => $this->sLabel, 'value' => "defaultValue, ENT_QUOTES, 'UTF-8')."\">"); } - + + /** + * @param array $aValues + */ public function ReadParam(&$aValues) { if ($this->IsReadOnly()) @@ -801,12 +859,18 @@ class DesignerFormField } } } - + + /** + * @return bool + */ public function IsVisible() { return true; } - + + /** + * @param string $sCSSClass + */ public function AddCSSClass($sCSSClass) { $this->aCSSClasses[] = $sCSSClass; @@ -814,6 +878,8 @@ class DesignerFormField /** * A way to set/change the default value after constructing the field + * + * @param array $aAllDefaultValue */ public function SetDefaultValueFrom($aAllDefaultValue) { @@ -822,7 +888,12 @@ class DesignerFormField $this->defaultValue = $aAllDefaultValue[$this->GetCode()]; } } - + + /** + * @param $sFieldCode + * + * @return \DesignerFormField|false + */ public function FindField($sFieldCode) { if ($this->sCode == $sFieldCode) @@ -832,11 +903,17 @@ class DesignerFormField return false; } + /** + * @return string + */ public function GetHandlerEquals() { return 'null'; } + /** + * @return string + */ public function GetHandlerGetValue() { return 'null'; @@ -863,11 +940,7 @@ class DesignerLabelField extends DesignerFormField } /** - * @param \WebPage $oP - * @param string $sFormId - * @param string $sRenderMode - * - * @return array + * @inheritdoc */ public function Render(WebPage $oP, $sFormId, $sRenderMode='dialog') { @@ -877,7 +950,7 @@ class DesignerLabelField extends DesignerFormField } /** - * @param array $aValues + * @inheritdoc */ public function ReadParam(&$aValues) { From 2f71570390c781bb66a4e91a5c1599671425afbd Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 30 Apr 2019 12:02:13 +0200 Subject: [PATCH 09/14] =?UTF-8?q?Carbon:=20N=C2=B01855=20-=20fix=20"depend?= =?UTF-8?q?s=20on"=20displaying=20fields=20from=20children?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/forms.class.inc.php | 1 + js/property_field.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php index a537aba17..908c00f1b 100644 --- a/application/forms.class.inc.php +++ b/application/forms.class.inc.php @@ -395,6 +395,7 @@ EOF { foreach($aFields as $oField) { + /** @var \DesignerFormField $oField */ $oField->ReadParam($aValues); } } diff --git a/js/property_field.js b/js/property_field.js index 2b07818fa..5512d28da 100644 --- a/js/property_field.js +++ b/js/property_field.js @@ -259,11 +259,11 @@ $(function() oData[oVal.name] = oVal.value; } }); - oPostedData = this.options.submit_parameters; + var oPostedData = this.options.submit_parameters; oPostedData.params = oData; oPostedData.params.updated = [ $('#'+this.options.field_id, this.element).attr('name') ]; // only one field updated in this case oPostedData.params.previous_values = {}; - oPostedData.params.previous_values[oPostedData.params.updated] = this.previous_value; // pass also the previous value(s) + oPostedData.params.previous_values[$('#'+this.options.field_id, this.element).attr('name')] = this.previous_value; // pass also the previous value(s) $.post(this.options.submit_to, oPostedData, function(data) { $('#prop_submit_result').html(data); From 0a48696cd88dc8a0711e0bed430a77669134dfa7 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 30 Apr 2019 15:46:44 +0200 Subject: [PATCH 10/14] =?UTF-8?q?Carbon:=20N=C2=B01855=20-=20Fix:=20Cannot?= =?UTF-8?q?=20remove=20last=20'dependencies'=20with=20UI=20Note=20that=20m?= =?UTF-8?q?ulti-select=20value=20when=20no=20entry=20is=20selected=20is=20?= =?UTF-8?q?""=20and=20not=20[]=20in=20order=20to=20be=20posted,=20so=20mul?= =?UTF-8?q?ti-select=20values=20are=20not=20always=20arrays.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/property_field.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/property_field.js b/js/property_field.js index 5512d28da..6e79589c6 100644 --- a/js/property_field.js +++ b/js/property_field.js @@ -256,14 +256,14 @@ $(function() if (oWidget && oWidget._is_visible()) { var oVal = oWidget._get_committed_value(); - oData[oVal.name] = oVal.value; + oData[oVal.name] = me._get_value_for_post(oVal.value); } }); var oPostedData = this.options.submit_parameters; oPostedData.params = oData; oPostedData.params.updated = [ $('#'+this.options.field_id, this.element).attr('name') ]; // only one field updated in this case oPostedData.params.previous_values = {}; - oPostedData.params.previous_values[$('#'+this.options.field_id, this.element).attr('name')] = this.previous_value; // pass also the previous value(s) + oPostedData.params.previous_values[$('#'+this.options.field_id, this.element).attr('name')] = me._get_value_for_post(this.previous_value); // pass also the previous value(s) $.post(this.options.submit_to, oPostedData, function(data) { $('#prop_submit_result').html(data); @@ -293,6 +293,14 @@ $(function() oWidget = element.data('itopSelector_property_field'); } return oWidget; + }, + _get_value_for_post(value) + { + if ((typeof value == "object") && (Object.keys(value).length === 0)) + { + return ""; + } + return value; } }); }); From 91f410a85c3cbbee8ac6d0b99be598585d427c06 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 2 May 2019 16:42:21 +0200 Subject: [PATCH 11/14] :lipstick: Fix images being too large in icon selector (dashboards and Designer) Note: The widget still needs a more aggressive refactoring to render nicely... --- css/light-grey.css | 11 +++++++++++ css/light-grey.scss | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/css/light-grey.css b/css/light-grey.css index 009882f23..30d3237fb 100644 --- a/css/light-grey.css +++ b/css/light-grey.css @@ -2927,6 +2927,17 @@ table.listResults .originColor { .menu-icon-select > .ui-menu-item { padding: 0.3em 3%; } +.menu-icon-select > .ui-menu-item > * { + width: 100%; + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; +} +.menu-icon-select > .ui-menu-item > * > img { + max-width: 80px; + max-height: 45px; + margin-right: 10px; +} .attribute.attribute-set .attribute-set-item::after { content: ","; margin-right: 0.5em; diff --git a/css/light-grey.scss b/css/light-grey.scss index 62150812a..ab733ad74 100644 --- a/css/light-grey.scss +++ b/css/light-grey.scss @@ -3353,6 +3353,19 @@ table.listResults .originColor{ } .menu-icon-select > .ui-menu-item{ padding: .3em 3%; + + > *{ + width: 100%; + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; + + > img{ + max-width: 80px; + max-height: 45px; + margin-right: 10px; + } + } } ////////////////////// From 2d6251e5dfcd059b37230a49a0398fc8536cd18b Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 15 May 2019 17:53:48 +0200 Subject: [PATCH 12/14] :lipstick: Add warning message CSS class (like error message) --- css/light-grey.css | 6 ++++++ css/light-grey.scss | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/css/light-grey.css b/css/light-grey.css index 30d3237fb..978f9d95c 100644 --- a/css/light-grey.css +++ b/css/light-grey.css @@ -2398,6 +2398,12 @@ a.summary, a.summary:hover { background: url(../images/ok.png?v=v2.6.1) 1em 1em no-repeat #cfc; padding-left: 3em; } +.message_warning { + border: 1px solid #ec9800; + background: url(../images/error.png?v=v2.6.1) 1em 1em no-repeat #ffd78d; + color: #000; + padding-left: 3em; +} .message_error { border: 1px solid #933; background: url(../images/error.png?v=v2.6.1) 1em 1em no-repeat #fcc; diff --git a/css/light-grey.scss b/css/light-grey.scss index ab733ad74..9077f73fe 100644 --- a/css/light-grey.scss +++ b/css/light-grey.scss @@ -2762,6 +2762,12 @@ a.summary, a.summary:hover { background: url(../images/ok.png?v=#{$version}) 1em 1em no-repeat #cfc; padding-left: 3em; } +.message_warning { + border: 1px solid #ec9800; + background: url(../images/error.png?v=#{$version}) 1em 1em no-repeat #ffd78d; + color: #000; + padding-left: 3em; +} .message_error { border: 1px solid #933; background: url(../images/error.png?v=#{$version}) 1em 1em no-repeat #fcc; From b6418d95e73764cc312a7c9ed46d5c2f8ff8a056 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 28 May 2019 10:36:18 +0200 Subject: [PATCH 13/14] Add PHPDoc for type hinting as iTop replaces \DOMDocument with \MFDocument --- setup/modelfactory.class.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index be5483bed..ca202a25c 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -1785,6 +1785,7 @@ EOF; /** * MFElement: helper to read/change the DOM * @package ModelFactory + * @property \MFDocument $ownerDocument This is only here for type hinting as iTop replaces \DOMDocument with \MFDocument */ class MFElement extends Combodo\iTop\DesignElement { From b0414748cb296a790c3c8eed5130bff1cbf23bb8 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 13 Jun 2019 11:55:10 +0200 Subject: [PATCH 14/14] Typo --- js/property_field.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/property_field.js b/js/property_field.js index 6e79589c6..c02c5ef20 100644 --- a/js/property_field.js +++ b/js/property_field.js @@ -294,7 +294,7 @@ $(function() } return oWidget; }, - _get_value_for_post(value) + _get_value_for_post: function(value) { if ((typeof value == "object") && (Object.keys(value).length === 0)) {