Set correct settings class in tools.yml + fix php errors

pull/3844/head
Julio Montoya 5 years ago
parent e8175f793e
commit dd6d9c6899
  1. 2
      src/CoreBundle/EventListener/CourseListener.php
  2. 1
      src/CoreBundle/Form/Type/ResourceRightType.php
  3. 8
      src/CoreBundle/Resources/config/tools.yml
  4. 9
      src/CoreBundle/Tool/AbstractTool.php

@ -328,7 +328,7 @@ class CourseListener
//$request->setLocale($request->getPreferredLanguage()); //$request->setLocale($request->getPreferredLanguage());
} }
private function generateCourseUrl(?Course $course, int $sessionId, int $groupId, string $origin): string private function generateCourseUrl(?Course $course, int $sessionId, int $groupId, ?string $origin): string
{ {
if (null !== $course) { if (null !== $course) {
$cidReqURL = '&cid='.$course->getId(); $cidReqURL = '&cid='.$course->getId();

@ -6,6 +6,7 @@ declare(strict_types=1);
namespace Chamilo\CoreBundle\Form\Type; namespace Chamilo\CoreBundle\Form\Type;
use Chamilo\CoreBundle\Entity\ResourceRight;
use Chamilo\CoreBundle\Entity\ToolResourceRight; use Chamilo\CoreBundle\Entity\ToolResourceRight;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;

@ -15,7 +15,7 @@ services:
- 'global' - 'global'
- '' - ''
- '' - ''
- '' - ~
- -
urls: urls:
repository: Chamilo\CoreBundle\Repository\Node\AccessUrlRepository repository: Chamilo\CoreBundle\Repository\Node\AccessUrlRepository
@ -32,7 +32,7 @@ services:
- 'asset' - 'asset'
- '' - ''
- '' - ''
- '' - ~
- -
illustrations: illustrations:
repository: Chamilo\CoreBundle\Repository\Node\IllustrationRepository repository: Chamilo\CoreBundle\Repository\Node\IllustrationRepository
@ -135,7 +135,7 @@ services:
- 'course_tool' - 'course_tool'
- 'admin' - 'admin'
- '/resources/course_tool/links' - '/resources/course_tool/links'
- '' - ~
- -
links: links:
repository: Chamilo\CourseBundle\Repository\CToolRepository repository: Chamilo\CourseBundle\Repository\CToolRepository
@ -362,7 +362,7 @@ services:
- 'shortcut' - 'shortcut'
- '' - ''
- '' - ''
- '' - ~
- -
shortcuts: shortcuts:
repository: Chamilo\CourseBundle\Repository\CShortcutRepository repository: Chamilo\CourseBundle\Repository\CShortcutRepository

@ -28,8 +28,13 @@ abstract class AbstractTool implements ToolInterface
*/ */
protected string $scope; protected string $scope;
public function __construct(string $name, string $category, string $link, SchemaInterface $settings = null, array $resourceTypes = []) public function __construct(
{ string $name,
string $category,
string $link,
?SchemaInterface $settings = null,
?array $resourceTypes = []
) {
$this->name = $name; $this->name = $name;
$this->category = $category; $this->category = $category;
$this->link = $link; $this->link = $link;

Loading…
Cancel
Save