0
votes

I'm currently facing a problem with assetic (symfony)

Whenever I do: app/console assetic:dump --env=dev

All resources folders in all vendor-bundles are purged (in the /vendor/vendorname/bundle/ folder) and empty css/js assets are generated.

To get them back I need to delete the whole folder and do a composer update.

What I'm trying to accomplish is getting the fmelfinder-bundle integration in ckeditor (egeloen) back working. It stopped doing so after a recent composer update (ElFinder window has no stylesheets).

What I have tried:

  • I have tried all FMElfinderBundle version from 1.0 to 2.1 with plenty of ways of configuration (compression: false, include_assets: false/true etc.)
  • Clearing cache before or after assetic:dump
  • assetic:dump with --no-debug
  • assets:install
  • "debugging" with Chrome Developer Tools -> there is no css included ever

I don't get the fmelfinderbundle working again, I had version 1.* of helios-ag/FMElfinderBundle in my composer.json and that was like half a year ago and I didn't have yui compressor nor did I have to dump assets.

What has changed since it was working?

  • PHP Version updated from 5.4.x to 5.4.y
  • Folder structure of symfony project (/htdocs/web => /htdocs, /htdocs/* => /secure/*)

Has anyone had a similiar problem with assetic? How did you solve it?

1
In some configurations the source files are NOT deleted but the generated css/js files are empty.Marcel Burkhard
It seems the problem is not assetic:dump but elfinder, just managed to dump and include assets from another bundle just fine.Marcel Burkhard
Finally solved it... see my answer.Marcel Burkhard

1 Answers

0
votes

If you run into issues with assetic after changing your directory structure, make sure you configured the read_from parameter.

My assetic configuration was missing the "read_from" parameter.

I always thought this would have the same effect:

app/console assetic:dump --env=prod --no-debug /path/to/web/folder

but it doesnt!

Adapt your app/config/config.yml as follows

assetic:
    #...
    read_from:    "%kernel.root.dir%/../../htdocs" #relative path from your web folder (where app.php lives)
    #...

See bottom of this page: http://symfony.com/doc/current/cookbook/configuration/override_dir_structure.html#override-the-web-directory