Code Monkey home page Code Monkey logo

Comments (6)

1destiny avatar 1destiny commented on May 30, 2024 1

Breaking change here: https://github.com/laravel/nova/commit/558156753b2772638e537bc1a468b281ce361e3a#diff-4f97552ae74c24e92b54d327885cc4b4

I have quite a few patches that I use because updates to Nova constantly breaks 3rd party plugins.
Not sure if Nova::script() or Nova::style() are meant to be used with remote files but certainly filemtime() didn't appear to work with remote urls - at least, not in my tests on different versions of php with php.ini setting allow_url_fopen = On.

My (temporary & not perfect) patch for this issue:

--- vendor/laravel/nova/src/Http/Controllers/StyleController.php	2019-12-15 11:37:08.000000000 +1300
+++ vendor/laravel/nova/src/Http/Controllers/StyleController.new.php	2019-12-15 11:37:43.000000000 +1300
@@ -30,6 +30,6 @@
             [
                 'Content-Type' => 'text/css',
             ]
-        )->setLastModified(DateTime::createFromFormat('U', filemtime($path)));
+        )->setLastModified(DateTime::createFromFormat('U', @filemtime($path) ?: now()->timestamp));
     }
 }
--- vendor/laravel/nova/src/Http/Controllers/ScriptController.php	2019-12-15 11:36:13.000000000 +1300
+++ vendor/laravel/nova/src/Http/Controllers/ScriptController.new.php	2019-12-15 11:36:54.000000000 +1300
@@ -30,6 +30,6 @@
             [
                 'Content-Type' => 'application/javascript',
             ]
-        )->setLastModified(DateTime::createFromFormat('U', filemtime($path)));
+        )->setLastModified(DateTime::createFromFormat('U', @filemtime($path) ?: now()->timestamp));
     }
 }

Use the patch with patch -p0 -N < patch-file-name.

from nova-froala-field.

slavarazum avatar slavarazum commented on May 30, 2024

Could you try it now? Maybe it was an issue on cdn.jsdelivr.net

from nova-froala-field.

iaK avatar iaK commented on May 30, 2024

I don't think you can run filemtime on remote files. Probably need to include the styles in the package.

from nova-froala-field.

iaK avatar iaK commented on May 30, 2024

@1destiny - thanks. Have you PR:ed it into nova itself?

from nova-froala-field.

zippoxer avatar zippoxer commented on May 30, 2024

Do you think it's better to include the styles in the package instead of waiting for Nova to fix the remote files issue?

from nova-froala-field.

slavarazum avatar slavarazum commented on May 30, 2024

Fixed in 3.3.0

from nova-froala-field.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.