Browse Source

Corrections DuplicateCourse

Mael ETIENNE 3 years ago
parent
commit
0d4b90bb86
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      Services/ScormEngine.php

+ 3
- 1
Services/ScormEngine.php View File

@@ -392,10 +392,12 @@ class ScormEngine implements ContainerAwareInterface
392 392
         // COURS
393 393
         $newCourse = clone $originalCourse;
394 394
         $newCourse->setCourseKey($newCourseKey);
395
+        $newCourse->setMaxVersion(1);
395 396
         $em->persist($newCourse);
396 397
 
397 398
         // Récupération de l'objet Zip
398
-        $originalMapping = $originalCourse->getMapCourseZipfiles();
399
+        $mappingRepository = $em->getRepository(MapCourseZipfile::class);
400
+        $originalMapping = $mappingRepository->findOneBy(array('course' => $originalCourse), array('mapCourseZipfileId' => 'desc'));
399 401
         $zipFile = $originalMapping->getZipFile();
400 402
 
401 403
         // Mapping Zip/Cours

Loading…
Cancel
Save