Explorar o código

Fix wrong id/iid see BT#12234

jmontoyaa %!s(int64=8) %!d(string=hai) anos
pai
achega
3d3528147d
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      main/work/work_list.php

+ 11 - 0
main/work/work_list.php

@@ -17,6 +17,17 @@ if (empty($workId)) {
 
 $courseInfo = api_get_course_info();
 
+// Student publications are saved with the iid in a LP
+$origin = api_get_origin();
+if ($origin == 'learnpath') {
+    $em = Database::getManager();
+    /** @var \Chamilo\CourseBundle\Entity\CStudentPublication $work */
+    $work = $em->getRepository('ChamiloCourseBundle:CStudentPublication')->find($workId);
+    if ($work) {
+        $workId = $work->getId();
+    }
+}
+
 protectWork($courseInfo, $workId);
 
 $my_folder_data = get_work_data_by_id($workId);