From c752bfe1a6b39f409c3d4c900b338b4da922291c Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Fri, 4 Dec 2020 10:02:39 +0100 Subject: [PATCH] FIX 12.0 - set entity to $conf->entity (instead of 1 by default) when creating a survey; otherwise the survey cannot be listed from the entity it was created on unless it is the main entity --- htdocs/opensurvey/class/opensurveysondage.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index c971b69b208..83902f8c678 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -128,6 +128,7 @@ class Opensurveysondage extends CommonObject */ public function create(User $user, $notrigger = 0) { + global $conf; $error = 0; // Clean parameters @@ -153,7 +154,8 @@ class Opensurveysondage extends CommonObject $sql .= "mailsonde,"; $sql .= "allow_comments,"; $sql .= "allow_spy,"; - $sql .= "sujet"; + $sql .= "sujet,"; + $sql .= "entity"; $sql .= ") VALUES ("; $sql .= "'".$this->db->escape($this->id_sondage)."',"; $sql .= " ".(empty($this->commentaires) ? 'NULL' : "'".$this->db->escape($this->commentaires)."'").","; @@ -165,7 +167,8 @@ class Opensurveysondage extends CommonObject $sql .= " ".$this->db->escape($this->mailsonde).","; $sql .= " ".$this->db->escape($this->allow_comments).","; $sql .= " ".$this->db->escape($this->allow_spy).","; - $sql .= " '".$this->db->escape($this->sujet)."'"; + $sql .= " '".$this->db->escape($this->sujet)."',"; + $sql .= " '".$conf->entity."',"; $sql .= ")"; $this->db->begin();