From 0168d5d7ec18bd8c451d6f07e9a08421dba7b8fd Mon Sep 17 00:00:00 2001 From: "tristan.champomier" Date: Tue, 27 Apr 2021 06:27:10 +0200 Subject: [PATCH] Fixed issue with AddCom object and NodeSettings class --- lib/object_coordination/addcom/addcom.php | 4 ++-- lib/object_coordination/adminnode/adminnode.php | 3 ++- .../nodesettings/ressource/nodesettingsmanagerdb.php | 2 +- lib/system/system_plugin/plugin.php | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/object_coordination/addcom/addcom.php b/lib/object_coordination/addcom/addcom.php index bc0f117..a4fc036 100755 --- a/lib/object_coordination/addcom/addcom.php +++ b/lib/object_coordination/addcom/addcom.php @@ -395,7 +395,6 @@ function execAdmin() $Node->setHasPublic( ((isset($_POST["haspublic"]))?($_POST["haspublic"]):0) ); $Node->setMailNode( ((isset($_POST["user_mail"]))?($_POST["user_mail"]):"") ); - $NodeSettings->setId($Node->getId()); $NodeSettings->setEmail( ((isset($_POST["node_email"]))?($_POST["node_email"]):"") ); $NodeSettings->setGit( ((isset($_POST["node_git"]))?($_POST["node_git"]):"") ); $NodeSettings->setMastodon( ((isset($_POST["node_mastodon"]))?($_POST["node_mastodon"]):"") ); @@ -422,6 +421,7 @@ function execAdmin() $Group->setIdPere(1); //On laisse les pictos par défaut $Node =$GLOBALS["SYSTEM_MANAGER"]["NODE"]->insertInstance($Node); + $NodeSettings->setId($Node->getId()); $NodeSettings =$GLOBALS["SYSTEM_MANAGER"]["NODESETTINGS"]->insertInstance($NodeSettings); $Group =$GLOBALS["SYSTEM_MANAGER"]["GROUP"]->insertInstance($Group); @@ -670,7 +670,7 @@ function execAdmin() # Insertion des informations de description de la communauté en bdd - $sql="INSERT INTO ".DATA_ACCES_TABLE_PREFIX.DATA_ACCES_OBJECT_PREFIX."textentrynode (textentrynode_text, textentrynode_resume, node_id, langue_id) VALUES ('".$_POST['contentTextInfos']."','".$_POST['contentResumeInfos']."',".recupCommunity().",".$GLOBALS["SYSTEM_USER_SESSION"]->langue->getId().")"; + $sql="INSERT INTO ".DATA_ACCES_TABLE_PREFIX.DATA_ACCES_OBJECT_PREFIX."textentrynode (textentrynode_text, textentrynode_resume, node_id, langue_id) VALUES ('".$_POST['contentTextInfos']."','".$_POST['contentResumeInfos']."',".$Node->getId().",".$GLOBALS["SYSTEM_USER_SESSION"]->langue->getId().")"; # Exécution de Requete $result=$GLOBALS['SYSTEM_DATABASE_CONN']->sql_query($sql); diff --git a/lib/object_coordination/adminnode/adminnode.php b/lib/object_coordination/adminnode/adminnode.php index c4c8150..211991d 100755 --- a/lib/object_coordination/adminnode/adminnode.php +++ b/lib/object_coordination/adminnode/adminnode.php @@ -808,7 +808,8 @@ Class AdminNode extends CoordinationObj $GLOBALS["SYSTEM_MANAGER"]["TREE_NODE_CACHE"]->emptyCache(); $GLOBALS["SYSTEM_MANAGER"]["LIST_USER_GROUP_CACHE"]->emptyCache(); $GLOBALS["SYSTEM_MANAGER"]["LIST_USER_NODE_CACHE"]->emptyCache(); - $GLOBALS["SYSTEM_MANAGER"]["PERMISSION_CACHE"]->emptyCache(); + if( DATA_ACCES_CACHE_PERMISSION ) + $GLOBALS["SYSTEM_MANAGER"]["PERMISSION_CACHE"]->emptyCache(); systemRedirect(formatUrl($this->getId(), "AdminNode", "deleteAdmin", "msgDelete")); return ""; }else{ diff --git a/lib/system/system_data/nodesettings/ressource/nodesettingsmanagerdb.php b/lib/system/system_data/nodesettings/ressource/nodesettingsmanagerdb.php index e2f9f78..5441504 100755 --- a/lib/system/system_data/nodesettings/ressource/nodesettingsmanagerdb.php +++ b/lib/system/system_data/nodesettings/ressource/nodesettingsmanagerdb.php @@ -207,7 +207,7 @@ var $conn = null; .$this->getSqlName("nextcloud").", " .$this->getSqlName("twitter").", " .$this->getSqlName("facebook").") VALUES ("; - $sql.= $id.", '"."'".$email."', '".$git."', '".$mastodon."', '".$mobilizon."', '".$matrix."', '".$peertube."', '".$nextcloud."', '".$twitter."', '".$facebook."')"; + $sql.= $id.", '".$email."', '".$git."', '".$mastodon."', '".$mobilizon."', '".$matrix."', '".$peertube."', '".$nextcloud."', '".$twitter."', '".$facebook."')"; # Requete $result=$this->conn->sql_query($sql); diff --git a/lib/system/system_plugin/plugin.php b/lib/system/system_plugin/plugin.php index 852a7ef..f914a7a 100755 --- a/lib/system/system_plugin/plugin.php +++ b/lib/system/system_plugin/plugin.php @@ -410,7 +410,7 @@ var $comment = null; * @param object NodeSettings * @return booleen */ - function __insertNodeSettings($Node) + function __insertNodeSettings($NodeSettings) { return true; } @@ -422,7 +422,7 @@ var $comment = null; * @param object NodeSettings * @return booleen */ - function __updateNodeSettings($Node) + function __updateNodeSettings($NodeSettings) { return true; } @@ -434,7 +434,7 @@ var $comment = null; * @param object NodeSettings * @return booleen */ - function __deleteNodeSettings($Node) + function __deleteNodeSettings($NodeSettings) { return true; }