0
Welcome Guest! Login
0 items Join Now

SOLVED Gantry 5: Set Absolute Resource URL: Fatal Error Whoops.css

  • SOLVED Gantry 5: Set Absolute Resource URL: Fatal Error Whoops.css

    Posted 6 years 5 months ago
    • Where to I change the address for Gantry5 resources from relative to absolute?


      I realize this is not a "normal" setup issue, but I really need some help so I can keep using RocketTheme's new templates in my business.


      Context:
      I have many sites running off a shared codebase via symlink.
      Gantry4 works fine, but I'm in over my head with Gantry5.

      The server permissions will not allow slave sites to use symlinked http resources from the master site.
      Relative links to files in symlinked directories will not display the file.
      It handles php and xml perfeclty, but images, css and js resources that are called via http must have a absolute URL to the codebase.

      Gantry4 Example: templates/rt_chimera/less/variables.less
      Template Fonts were not accessible as written:
      @font-face {
          font-family: 'Roboto';
          src: url('../fonts/Roboto-Regular-webfont.eot');
          src: url('../fonts/Roboto-Regular-webfont.eot?#iefix') format('embedded-opentype'),
               url('../fonts/Roboto-Regular-webfont.woff') format('woff'),
               url('../fonts/Roboto-Regular-webfont.ttf') format('truetype'),
               url('../fonts/Roboto-Regular-webfont.svg#Roboto') format('svg');
          font-weight: normal;
          font-style: normal;
      }

      But a minor adjustment to make the resource location absolute solved it:
      @font-face {
          font-family: 'Roboto';
          src: url('http://example-code-repository.com/templates/rt_chimera/fonts/Roboto-Regular-webfont.eot');
          src: url('http://example-code-repository.com/templates/rt_chimera/fonts/Roboto-Regular-webfont.eot?#iefix') format('embedded-opentype'),
               url('http://example-code-repository.com/templates/rt_chimera/fonts/Roboto-Regular-webfont.woff') format('woff'),
               url('http://example-code-repository.com/templates/rt_chimera/fonts/Roboto-Regular-webfont.ttf') format('truetype'),
               url('http://example-code-repository.com/templates/rt_chimera/fonts/Roboto-Regular-webfont.svg#Roboto') format('svg');
          font-weight: normal;
          font-style: normal;
      }

      When I fired up my first site with a Gantry5 template, Callisto, it through an error:
      [15-Jun-2015 02:16:47] PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Could not find resource 'whoops.css' in any resource paths.(searched: /home/codebase/public_html/libraries/gantry5/vendor/filp/whoops/src/Whoops/Handler/../Resources)' in /home/codebase/public_html/libraries/gantry5/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php:499
      Stack trace:
      #0 /home/codebase/public_html/libraries/gantry5/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php(125): Whoops\Handler\PrettyPageHandler->getResource('whoops.css')
      #1 /home/codebase/public_html/libraries/gantry5/vendor/filp/whoops/src/Whoops/Run.php(256): Whoops\Handler\PrettyPageHandler->handle(Object(Twig_Error_Loader))
      #2 [internal function]: Whoops\Run->handleException(Object(Twig_Error_Loader))
      #3 {main}  thrown in /home/codebase/public_html/libraries/gantry5/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php on line 499


      So I'm wondering where in the template I might be able to set the resource URL to an absolute path.

      Thank you very much for your help. I am a Rockettheme Lifer!
    • Last Edit: 6 years 5 months ago by netstepinc.
    • "The person who says it cannot be done should not interrupt the person doing it."
  • Re: SOLVED Gantry 5: Set Absolute Resource URL: Fatal Error Whoops.css

    Posted 6 years 5 months ago
    • Could someone attempt to tell me where I can set the resource path for Gantry5?
    • "The person who says it cannot be done should not interrupt the person doing it."
  • Re: SOLVED Gantry 5: Set Absolute Resource URL: Fatal Error Whoops.css

    Posted 6 years 4 months ago
    • Hey bro!
      I'll try to help you out. I just tried to do what you're saying there and I got a successful result.
      You gotta create a custom.scss under "your_template/custom/scss/custom.scss".
      This is the file you use and its where you'll do that coding right there. I simulated your exact code and downloaded the Roboto font and uploaded all files to a folder I created: "your_template/custom/fonts/roboto/" and it worked fine.

      The only tricky step I had to do before my custom.scss file worked was to uncomment the imports in some custom_10.css in the compiled folders. but I don't think this is an issue anymore.

      Hope it helps!
    • Matias Griese's Avatar
    • Matias Griese
    • Sr. Rocketeer
    • Posts: 228
    • Thanks: 91
    • Lead Developer

    Re: SOLVED Gantry 5: Set Absolute Resource URL: Fatal Error Whoops.css

    Posted 6 years 4 months ago
    • Moderators pointed this topic to me so let me try to give answer to you.

      Easiest way would be to somehow allow symlinks in your slave site, see AllowOverride Options and Options FollowSymLinks. I would really recommend doing this instead of pointing the files to a common master site as it requires no hacks and is a clean way to do it. I'm relaying on symlinks every day and I just couldn't use server setup with such limitations.

      Though the error suggests to me that the issue isn't above one. The error not even coming from our code, but 3rd party library we are using. Error suggests that there is whoops.css file missing in /home/codebase/public_html/libraries/gantry5/vendor/filp/whoops/src/Whoops/Resources or it cannot be accessed from the current site. That hints that there may be something wrong in the setup, missing symlink or file maybe? Or bad permissions... Actually it should look into JROOT/media/gantry5/assets/css but the directory doesn't exist?

      I think you have some missing symlinks that prevent Gantry 5 from working. Gantry 5 needs a few of them; full list is in github.com/gantry/gantry5/blob/develop/hebe.json -- although that is for our repository, so just use locations specified in the destination field and remove common and joomla sub-folders from any path you see.

      Back to the another subject,

      Gantry 5 uses streams to allow us to abstract the file locations. Basically streams do the same what you are trying to do (but without a need to change the files). It allows us to move the files around without changing the "address" of the file. Basically we could have gantry-theme://images/myimage.jpg, which points to a file that can be in a few different locations. Those locations could also be changed, so instead of loading the file from the template, it could use JROOT/images.

      Basically it is also this system that prevents you from just changing the urls in scss files; you need to know where the files are located in the filesystem or the another site in order to change them. On the other hand it also means that it might be possible to write small amount of code to do all of that automatically.

      But let's attempt to fix that first issue first; we need to get rid of any fatal errors because of missing files in the filesystem.
    • Last Edit: 6 years 4 months ago by Matias Griese.
    • The following users have thanked you: netstepinc

    • Gantry 5, enjoy!
    • Kat05's Avatar
    • Kat05
    • Preeminent Rocketeer
    • Posts: 25898
    • Thanks: 334

    Re: SOLVED Gantry 5: Set Absolute Resource URL: Fatal Error Whoops.css

    Posted 6 years 4 months ago
    • hi,

      i am moving this topic to the new gantry 5 forum board.

      kat :)
    • Kat05 / QA Lead & Support / Germany
  • Re: SOLVED Gantry 5: Set Absolute Resource URL: Fatal Error Whoops.css

    Posted 6 years 4 months ago
    • Easiest way would be to somehow allow symlinks in your slave site, see AllowOverride Options and Options FollowSymLinks. I would really recommend doing this instead of pointing the files to a common master site as it requires no hacks and is a clean way to do it. I'm relaying on symlinks every day and I just couldn't use server setup with such limitations.
      Thank you for your help.

      I use symlinks.
      The issue is that accessing http://... resources via symlink is not allowed on my cPanel server.
      All the php files work fine but anything accessed by the browser is served off a repository URL.

      Though I truly appreciate your effort here, I have decided I do not want to rebuild my business to accomodate Gantry5.
      I will be moving to a different framework, T3 or something like it, that will be less complicated to manage.
    • "The person who says it cannot be done should not interrupt the person doing it."

Time to create page: 0.126 seconds