From 74130e5df4f15b5dfafbe88482c567a42db6553e Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 7 Jul 2021 13:06:18 +0200 Subject: [PATCH] Fix entity repository --- public/main/exercise/hotspot_answers.as.php | 2 +- public/main/gamification/my_progress.php | 3 ++- public/main/inc/lib/banner.lib.php | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/main/exercise/hotspot_answers.as.php b/public/main/exercise/hotspot_answers.as.php index 7e29b31f5f..093045dc79 100644 --- a/public/main/exercise/hotspot_answers.as.php +++ b/public/main/exercise/hotspot_answers.as.php @@ -227,7 +227,7 @@ if (!$hideExpectedAnswer) { $data['answers'] = []; $rs = $em - ->getRepository('ChamiloCoreBundle:TrackEHotspot') + ->getRepository(TrackEHotspot::class) ->findBy( [ 'hotspotQuestionId' => $questionId, diff --git a/public/main/gamification/my_progress.php b/public/main/gamification/my_progress.php index 4831e704fe..615a074df4 100644 --- a/public/main/gamification/my_progress.php +++ b/public/main/gamification/my_progress.php @@ -1,6 +1,7 @@ getRepository('ChamiloCoreBundle:TrackECourseAccess'); + $trackCourseAccessRepository = $entityManager->getRepository(TrackECourseAccess::class); $lastCourseAccess = $trackCourseAccessRepository->getLastAccessByUser($user); $lastSessionId = 0; if ($lastCourseAccess) { diff --git a/public/main/inc/lib/banner.lib.php b/public/main/inc/lib/banner.lib.php index 378bec4281..73f10b8c81 100644 --- a/public/main/inc/lib/banner.lib.php +++ b/public/main/inc/lib/banner.lib.php @@ -348,8 +348,7 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) if (!empty($courseInfo) && !isset($_GET['hide_course_breadcrumb'])) { $sessionName = ''; if (!empty($sessionId)) { - /** @var \Chamilo\CoreBundle\Entity\Session $session */ - $session = Database::getManager()->find('ChamiloCoreBundle:Session', $sessionId); + $session = api_get_session_entity($sessionId); $sessionName = $session ? ' ('.cut($session->getName(), MAX_LENGTH_BREADCRUMB).')' : ''; }