From 8482be7068a0d0b4bc8c5c04ca597883dbb81f07 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 9 Dec 2019 14:56:42 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B02623=20-=20Fix=20setup=20request=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/metamodel.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index baa4b0027..2f79cc98b 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -7528,9 +7528,12 @@ abstract class MetaModel $sKey = self::DBGetKey($sClass); $sRootKey = self::DBGetKey($sRootClass); $sRootField = self::DBGetClassField($sRootClass); - // Copy the finalclass of the root table - $sRequest = "UPDATE `$sTable`,`$sRootTable` SET `$sTable`.`$sField` = `$sRootTable`.`$sRootField` WHERE `$sTable`.`$sKey` = `$sRootTable`.`$sRootKey`"; - $aRequests[] = $sRequest; + if ($sTable != $sRootTable) + { + // Copy the finalclass of the root table + $sRequest = "UPDATE `$sTable`,`$sRootTable` SET `$sTable`.`$sField` = `$sRootTable`.`$sRootField` WHERE `$sTable`.`$sKey` = `$sRootTable`.`$sRootKey`"; + $aRequests[] = $sRequest; + } } return $aRequests;