Explorar el Código

Fix issued skills page from version 1.9.x

Angel Fernando Quiroz Campos hace 9 años
padre
commit
f626ea969a
Se han modificado 2 ficheros con 6 adiciones y 2 borrados
  1. 1 1
      main/badge/issued.php
  2. 5 1
      main/template/default/skill/issued.tpl

+ 1 - 1
main/badge/issued.php

@@ -63,7 +63,7 @@ $badgeAssertions = [];
 foreach ($userSkills as $userSkill) {
     $sessionId = 0;
     $course = $entityManager->find('ChamiloCoreBundle:Course', $userSkill->getCourseId());
-    $courseName = $course->getTitle();
+    $courseName = $course ? $course->getTitle() : '';
 
     if ($userSkill->getSessionId()) {
         $session = $entityManager->find('ChamiloCoreBundle:Session', $userSkill->getSessionId());

+ 5 - 1
main/template/default/skill/issued.tpl

@@ -11,7 +11,11 @@
                 <div class="panel-body">
                     {% for course in skill_info.courses %}
                     <p>
-                        <em class="fa fa-clock-o fa-fw"></em> {{ 'TimeXThroughCourseY'|get_lang|format(course.date_issued, course.name) }}
+                        {% if course.name %}
+                            <em class="fa fa-clock-o fa-fw"></em> {{ 'TimeXThroughCourseY'|get_lang|format(course.date_issued, course.name) }}
+                        {% else %}
+                            <em class="fa fa-clock-o fa-fw"></em> {{ course.date_issued }}
+                        {% endif %}
                     </p>
                     {% endfor %}
                 </div>