From 9c6405cb73a0ab263c8c283dfe3a4e109e3066bb Mon Sep 17 00:00:00 2001 From: Julio Date: Wed, 19 Sep 2018 10:16:34 +0200 Subject: [PATCH] Minor - onKernelController doesn't set the objects in session --- .../EventListener/CourseListener.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/CourseBundle/EventListener/CourseListener.php b/src/CourseBundle/EventListener/CourseListener.php index 835159f6f0..744a3bbdd8 100644 --- a/src/CourseBundle/EventListener/CourseListener.php +++ b/src/CourseBundle/EventListener/CourseListener.php @@ -249,12 +249,15 @@ class CourseListener global $cidReset; //$cidReset = $sessionHandler->get('cid_reset', false); - // This controller implements ToolInterface? Then set the course/session +// This controller implements ToolInterface? Then set the course/session if (is_array($controllerList) && ( - $controllerList[0] instanceof CourseControllerInterface + $controllerList[0] instanceof CourseControllerInterface || + $controllerList[0] instanceof ResourceController + + //|| $controllerList[0] instanceof LegacyController - ) && $cidReset === false + ) ) { $controller = $controllerList[0]; @@ -269,12 +272,12 @@ class CourseListener // Legacy code $courseCode = $course->getCode(); - $courseInfo = api_get_course_info($courseCode); - $container->get('twig')->addGlobal('course', $course); + //$courseInfo = api_get_course_info($courseCode); + //$container->get('twig')->addGlobal('course', $course); - $sessionHandler->set('_real_cid', $course->getId()); - $sessionHandler->set('_cid', $course->getCode()); - $sessionHandler->set('_course', $courseInfo); + //$sessionHandler->set('_real_cid', $course->getId()); + //$sessionHandler->set('_cid', $course->getCode()); + //$sessionHandler->set('_course', $courseInfo); } if ($session) { @@ -300,9 +303,9 @@ class CourseListener //$container->get('twig')->addGlobal('tool.name', $toolName); //$container->get('twig')->addGlobal('tool.action', $toolAction); - $sessionHandler->set('_gid', $groupId); + //$sessionHandler->set('_gid', $groupId); //$sessionHandler->set('is_allowed_in_course', true); - $sessionHandler->set('id_session', $sessionId); + //$sessionHandler->set('id_session', $sessionId); } else { $ignore = [ 'fos_js_routing.controller:indexAction',