Minor - flint fixes

pull/3016/head
Julio Montoya 6 years ago
parent 3e3f6e435d
commit 53f765f335
  1. 2
      main/inc/lib/CoursesAndSessionsCatalog.class.php
  2. 6
      main/inc/lib/document.lib.php
  3. 9
      src/CoreBundle/Entity/Resource/ResourceFile.php
  4. 4
      src/CoreBundle/Migrations/Schema/V200/Version20.php

@ -10,7 +10,7 @@ use Doctrine\ORM\Query\Expr\Join;
*/
class CoursesAndSessionsCatalog
{
const PAGE_LENGTH = 12;
public const PAGE_LENGTH = 12;
/**
* Check the configuration for the courses and sessions catalog.

@ -11,8 +11,8 @@ use Chamilo\CourseBundle\Entity\CGroupInfo;
use Chamilo\UserBundle\Entity\User;
use ChamiloSession as Session;
use Sonata\MediaBundle\Extra\ApiMediaFile;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* Class DocumentManager
@ -6364,8 +6364,6 @@ class DocumentManager
// Only create a ResourceFile and Media if there's a file involved
if ($fileType === 'file') {
$mediaManager = Container::$container->get('sonata.media.manager.media');
//$mediaManager->create();
/** @var League\Flysystem\Adapter\Local $mediaManager */
$mediaManager = Container::$container->get('oneup_flysystem.resources_filesystem');
/** @var League\Flysystem\Adapter\Local $mediaManager */
@ -6379,8 +6377,6 @@ class DocumentManager
if ($content instanceof UploadedFile) {
error_log('UploadedFile');
//$file = $content;
//$media->setSize($file->getSize());
} else {
// $path points to a file in the directory
if (file_exists($realPath) && !is_dir($realPath)) {

@ -38,16 +38,18 @@ class ResourceFile
protected $name;
/**
* @ORM\Column(type="integer")
* @var int
*
* @var integer
* @ORM\Column(type="integer")
*
*/
protected $size;
/**
* @Vich\UploadableField(mapping="resources", fileNameProperty="name", size="size")
* @var File
*
* @Vich\UploadableField(mapping="resources", fileNameProperty="name", size="size")
*
*/
protected $file;
@ -398,7 +400,6 @@ class ResourceFile
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $file
*
*/
public function setFile(File $file = null): void
{

@ -933,8 +933,7 @@ class Version20 extends AbstractMigrationChamilo
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('exercise_invisible_in_session','false','No')");
}
$result = $connection
->executeQuery("SELECT COUNT(1) FROM settings_current WHERE variable = 'configure_exercise_visibility_in_course' AND category = 'Session'");
$result = $connection->executeQuery("SELECT COUNT(1) FROM settings_current WHERE variable = 'configure_exercise_visibility_in_course' AND category = 'Session'");
$count = $result->fetch()[0];
if (empty($count)) {
@ -945,7 +944,6 @@ class Version20 extends AbstractMigrationChamilo
//ALTER TABLE resource_file ADD name VARCHAR(255) NOT NULL, ADD size INT NOT NULL;
//ALTER TABLE resource_file_audit ADD name VARCHAR(255) DEFAULT NULL, ADD size INT DEFAULT NULL;
}
/**

Loading…
Cancel
Save