2

I?m having problems with my FOSCommentBundle. I've set up my bundle and it worked for a couple of days, but today it's not working. I'm crushing my head and cant get to a solution.

The problem is that the fos_comment_script.src = '/web/js/35a8e64_comments_1.js' doesn't exist, i cant access it, so no threads are added and nothing is displayed. I'm not receiving any errors, nothing, everything looks fine but nothing is happening. I am using async.twig.html and the javascript that is generated on my page looks like this

// thread id
var fos_comment_thread_id = '309';

// api base url to use for initial requests
var fos_comment_thread_api_base_url = '/web/api/threads';

// Snippet for asynchronously loading the comments
(function() {
var fos_comment_script = document.createElement('script');
fos_comment_script.async = true;
fos_comment_script.src = '/web/js/35a8e64_comments_1.js';
fos_comment_script.type = 'text/javascript';

(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(fos_comment_script);
})();

Thank you vary much in advance.

StrikoMirko
  • 415
  • 4
  • 17
  • can you find the file manually or doesn't it exist? – Geert Wille Apr 11 '13 at 13:41
  • the file is there under the vendor/path/to/comment.js, but the '/web/js/35a8e64_comments_1.js' doesent exsit. – StrikoMirko Apr 11 '13 at 13:49
  • 1
    You probably forgot to run `php ./app/console assetic:dump --env=dev` after the cache was cleared or something. Please for more information take a look at the asset_management part of [the symfony cookbook](http://symfony.com/doc/2.0/cookbook/assetic/asset_management.html#dumping-asset-files-in-the-dev-environment) – Geert Wille Apr 11 '13 at 13:54
  • Thanks that did the trick. I lost a couple of hours on this :(, such a simple solution. Thank you vary much for yore help, joy showers my being :). – StrikoMirko Apr 11 '13 at 14:14
  • can you please accept the answer :) Glad I could help you out! – Geert Wille Apr 11 '13 at 14:24

1 Answers1

4

You probably forgot to run php ./app/console assetic:dump --env=dev after the cache was cleared or something. Please for more information take a look at the asset_management part of the symfony cookbook

Geert Wille
  • 1,656
  • 13
  • 18
  • This didn't helped, but adding `assetic: bundles: [ "FOSCommentBundle" ]` as in https://groups.google.com/forum/#!topic/symfony2/0CUeXtuJgQU and calling the command helped. May be I missed it. – Hari K T Oct 03 '15 at 17:23