Check resource visibility in course from course session

pull/4002/head
Angel Fernando Quiroz Campos 3 years ago
parent ecd33b5b8a
commit 323b19c637
  1. 6
      src/CoreBundle/Entity/AbstractResource.php

@ -410,6 +410,12 @@ abstract class AbstractResource
public function isVisible(Course $course, Session $session = null): bool
{
$link = $this->getFirstResourceLinkFromCourseSession($course, $session);
if (null === $link) {
if ((new ReflectionClass($this))->hasProperty('loadCourseResourcesInSession')) {
$link = $this->getFirstResourceLinkFromCourseSession($course);
}
}
if (null === $link) {
return false;
}

Loading…
Cancel
Save