Explorar o código

Fix build survey question when building course - refs BT#14990

Angel Fernando Quiroz Campos %!s(int64=6) %!d(string=hai) anos
pai
achega
7d49849598

+ 6 - 0
src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php

@@ -1096,8 +1096,14 @@ class CourseBuilder
         $table_opt = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
 
         $courseId = (int) $courseId;
+        $idList = isset($this->specific_id_list['surveys']) ? $this->specific_id_list['surveys'] : [];
 
         $sql = 'SELECT * FROM '.$table_que.' WHERE c_id = '.$courseId.'  ';
+
+        if (!empty($idList)) {
+            $sql .= " AND survey_id IN (".implode(', ', $idList).")";
+        }
+
         $db_result = Database::query($sql);
         $is_required = 0;
         while ($obj = Database::fetch_object($db_result)) {