Olivier Massot 9 hónapja
szülő
commit
f94e8c6b7c

+ 2 - 2
src/Entity/Core/File.php

@@ -556,12 +556,12 @@ class File
         return $this;
     }
 
-    public function getQrCode(): Parameters
+    public function getQrCode(): ?Parameters
     {
         return $this->qrCode;
     }
 
-    public function setQrCode(Parameters $qrCode): self
+    public function setQrCode(?Parameters $qrCode): self
     {
         $this->qrCode = $qrCode;
 

+ 1 - 1
src/Entity/Organization/Parameters.php

@@ -149,7 +149,7 @@ class Parameters
     #[ORM\Column(options: ['default' => false])]
     private bool $studentsAreAdherents = false;
 
-    #[ORM\OneToOne(inversedBy: 'qrCode', targetEntity: File::class, cascade: ['persist'], fetch: 'EAGER')]
+    #[ORM\OneToOne(targetEntity: File::class, inversedBy: 'qrCode', cascade: ['persist'], fetch: 'EAGER')]
     #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
     private ?File $qrCode = null;
 

+ 1 - 1
src/Service/File/Factory/ImageFactory.php

@@ -29,7 +29,7 @@ class ImageFactory
      */
     public function createImageContent(File $file, string $filterName, bool $uncropped = false): void
     {
-        $filters_options = !$uncropped ? $this->getCropFilterOptions($file->getConfig()) : [];
+        $filters_options = $uncropped ? [] : $this->getCropFilterOptions($file->getConfig());
         $path = $file->getSlug();
         $this->createAndStore($path, $filterName, $filters_options);
     }

+ 4 - 0
src/Service/File/Storage/ApiLegacyStorage.php

@@ -46,6 +46,10 @@ class ApiLegacyStorage implements FileStorageInterface
     {
         $url = sprintf('api/files/%s/download/%s?relativePath=1', $file->getId(), $size);
 
+        if ($uncropped) {
+            $url .= '&noCache=true';
+        }
+
         // L'url interne est l'équivalent d'un chemin relatif dans ce cas
         $baseUrl = $relativePath ? $this->legacyBaseUrl : $this->publicLegacyBaseUrl;