]> _ Git - cubist_cms-back.git/commitdiff
wip #7894 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 16 Jan 2026 17:20:48 +0000 (18:20 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 16 Jan 2026 17:20:48 +0000 (18:20 +0100)
src/app/Magic/Form.php
src/app/Magic/Models/CubistMagicTranslatableModel.php
src/routes/cubist/backpack/cdnproxy.php

index 5f6b0d5b1fc0d1e97c4f6a1319636303296aaf64..7a0e9a63bee7bc190328627060bc3925113875b5 100644 (file)
@@ -39,7 +39,7 @@ class Form extends SubForm
      * @return string
      */
 
-    public function render(callable $callback = null)
+    public function render(?callable $callback )
     {
         return view(CubistBackpackServiceProvider::NAMESPACE . '::form.form', ['form' => $this, 'crud' => $this->crud])->render($callback);
     }
index 6de431cd2ee34c2e2479a5a41155a4d2c2ec319a..d1c21da1f2ab2fd995d7b98638087f4942b073da 100644 (file)
@@ -63,7 +63,7 @@ class CubistMagicTranslatableModel extends CubistMagicAbstractModel
         return $field;
     }
 
-    public function getTranslations(string $key = null, array $allowedLocales = null): array
+    public function getTranslations(?string $key, ?array $allowedLocales): array
     {
         if ($key !== null) {
 //            $measure_label = 'Get translation in ' . get_class($this);
index 8cdeb6e5016e27e502db31bd97cc44829f23c1e2..657ee28dfaf8251e6dc83876a80eb62ec8750309 100644 (file)
@@ -23,7 +23,9 @@ Route::group([
         $cache = \Cubist\Util\Files\Files::mkdir(storage_path('app/cache/cdnproxy')) . sha1($url) . '.' . $ext;
 
         if (!file_exists($cache) || filemtime($cache) < (time() - 604800)) {
-            copy($url, $cache);
+            if (!@copy($url, $cache) && $ext=='map') {
+                return false;
+            }
         }
         return \Cubist\Backpack\Http\Controllers\Base\XSendFileController::sendfile($cache);
     })->where(['url' => '.*'])->name('cdnproxy')->withoutMiddleware(["App\Http\Middleware\CheckIfAdmin"]);