From 00acf271e213dffd566a79d331b85426e2f2eb77 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Tue, 7 Dec 2021 16:12:00 +0100 Subject: [PATCH 1/2] =?UTF-8?q?N=C2=B04481=20Fix=20wrong=20attribute=20nam?= =?UTF-8?q?e=20used=20in=20SLA=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datamodel.itop-service-mgmt-provider.xml | 2 +- .../2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datamodels/2.x/itop-service-mgmt-provider/datamodel.itop-service-mgmt-provider.xml b/datamodels/2.x/itop-service-mgmt-provider/datamodel.itop-service-mgmt-provider.xml index 8cd0dd04a..b5273f5e0 100755 --- a/datamodels/2.x/itop-service-mgmt-provider/datamodel.itop-service-mgmt-provider.xml +++ b/datamodels/2.x/itop-service-mgmt-provider/datamodel.itop-service-mgmt-provider.xml @@ -1610,7 +1610,7 @@ public function PrefillSearchForm(&$aContextParam) } $oQuery = DBSearch::FromOQL($sOql, $aQueryParams); $oResultSql = new DBObjectSet($oQuery); - $oResultSql->OptimizeColumnLoad(['ccs' => ['ccs.customercontract_name','ccs.service_name']]); + $oResultSql->OptimizeColumnLoad(['ccs' => ['customercontract_name','service_name']]); if ($aCurrentRow = $oResultSql->Fetch()) { $this->m_aCheckIssues[] = Dict::Format('Class:SLA/Error:UniqueLnkCustomerContractToService',$aCurrentRow->Get('customercontract_name'),$aCurrentRow->Get('service_name')); diff --git a/datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml b/datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml index 53aa4ece8..f6a9072d1 100755 --- a/datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml +++ b/datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml @@ -1604,7 +1604,7 @@ public function PrefillSearchForm(&$aContextParam) } $oQuery = DBSearch::FromOQL($sOql, $aQueryParams); $oResultSql = new DBObjectSet($oQuery); - $oResultSql->OptimizeColumnLoad(['ccs' => ['ccs.customercontract_name','ccs.service_name']]); + $oResultSql->OptimizeColumnLoad(['ccs' => ['customercontract_name','service_name']]); if ($aCurrentRow = $oResultSql->Fetch()) { $this->m_aCheckIssues[] = Dict::Format('Class:SLA/Error:UniqueLnkCustomerContractToService',$aCurrentRow->Get('customercontract_name'),$aCurrentRow->Get('service_name')); From c89c47d67185328d48e8191a1f24edd24a7d27b3 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Tue, 7 Dec 2021 17:01:05 +0100 Subject: [PATCH 2/2] Fix mkdir race condition See https://github.com/kalessil/phpinspectionsea/blob/master/docs/probable-bugs.md#mkdir-race-condition --- setup/setuputils.class.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/setuputils.class.inc.php b/setup/setuputils.class.inc.php index 902c40064..7db2cfd84 100644 --- a/setup/setuputils.class.inc.php +++ b/setup/setuputils.class.inc.php @@ -768,7 +768,9 @@ class SetupUtils { $parent = dirname($dir); self::builddir($parent); - mkdir($dir); + if (!mkdir($dir) && !is_dir($dir)) { + throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir)); + } } }