Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

"assets_output" write wrong cache file name

edited March 2016 in Bug Reports
related to Enabling "assets_output" produces wrong path. #355 on github.

my asset config is set to :

$config['assets_folders'] = array(
'images' => 'images/',
'css' => 'css/',
'js' => 'js/',
'pdf' => 'pdf/',
'swf' => 'swf/',
'media' => 'media/',
'captchas' => 'captchas/',
'docs' => 'docs/',
'cache' => 'cache/'
$config['assets_cache_folder'] = 'cache';

and my folder assets/cache is writable

but assets_output write a filename like this :

in my source html file everything seems ok :

i modified fuel/libraries/Asset.php after line number 540 like this:
$path = ('cache' === $path) ? WEB_ROOT . $assets_path . $asset_type : WEB_ROOT . $assets_path . $asset_type . $file;

and now it works fine...

could this change cause other consequences otherwise that I do not see ?

another option i imagined is to modify in fuel/libraries/Asset.php in 1129 :

$cache_dir = $this->assets_server_path($this->assets_cache_folder, 'cache', $module);

what's the best solution ? Or does it exist another thing to do ?

thank you for any suggestion or response.
have a nice day.


  • edited 8:21AM
    I believe this is updated in the develop branch of fuel:
  • edited 8:21AM
    sorry, unless I am mistaken. it seems that this is the same behavior with this branch.

    the written file in assets/cache is named like this

    and the link href : 53fe7151c0bafa59f1e25d6e6a1df1fc_1456873200.php
  • edited 8:21AM
    You are correct. That looks to be a bug. I've pushed a fix for this into the develop branch for you to test out:
  • edited 8:21AM
    thank you for the fix.
    but i tried this before starting this thread : it doesn't write anything in the assets_cache_folder...
    before i posted, i worked around a little and the simplest way i found was :

    in Asset.php:540
    $path = ('cache' === $path) ? WEB_ROOT . $assets_path . $asset_type : WEB_ROOT . $assets_path . $asset_type . $file;

    but i'm not sure of the consequences on other parts.

    by the way i am very pleased to work with fuelcms for few years now. it's the best solution for my works.
    thank you.
  • edited 8:21AM
    Try adding a slash at the end of the assets_cache_folder config parameter in fuel/application/config/asset.php
    $config['assets_cache_folder'] = 'cache/';
    I've pushed a fix for this to account for with or without since by default it is without.
  • edited 8:21AM
    with the fix :
    1- $config['assets_cache_folder'] = 'cache/'; produces links with href to the assets directory root and no cache file in assets directory root (no writable)
    2- $config['assets_cache_folder'] = 'cache'; produces the right links to assets/cache/ with no cache file in both assets or assets/cache directories

    Don't spend time about this for me. I can wait with my workaround above.
Sign In or Register to comment.