If resource node doesnt't have a file, hide download button.

pull/3124/head
Julio Montoya 5 years ago
parent c1edf43c5e
commit 5c908c976a
  1. 5
      src/CoreBundle/Controller/ResourceController.php

@ -308,6 +308,11 @@ class ResourceController extends AbstractResourceController implements CourseCon
);
$setNodeDownloadParameters = function (RowAction $action, Row $row) use ($routeParams) {
/** @var ResourceNode $resourceNode */
$resourceNode = $row->getEntity()->getResourceNode();
if (false === $resourceNode->hasResourceFile()) {
return null;
}
$id = $row->getEntity()->getResourceNode()->getId();
$routeParams['id'] = $id;
$action->setRouteParameters($routeParams);

Loading…
Cancel
Save