just enabling this bundle breaks Assetic #126

Closed
lenar opened this Issue Sep 9, 2011 · 8 comments

Comments

Projects
None yet
3 participants
@lenar
Contributor

lenar commented Sep 9, 2011

This is with (symfony|assetic|AsseticBundle|FOSRestBundle)/master.

Just enabling FOSRestBundle changes he behavior of Assetic (no additional config).
The Content-Type of assets sent to browser is always text/html although Assetic route
is like this:

[router] Route "_assetic_8539787_2"
Name         _assetic_8539787_2
Pattern      /css/8539787_jquery.colorbox_3.css
Class        Symfony\Component\Routing\CompiledRoute
Defaults     _controller: assetic.controller:render
             _format: css
             name: 8539787
             pos: 2
Requirements 
Options      compiler_class: Symfony\Component\Routing\RouteCompiler
Regex        #^
                 /css/8539787_jquery\.colorbox_3\.css
             $#x

That's because call to $request->getRequestFormat() in ResponseListener starts to return html
as soon as FOSRestBundle is just enabled.

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 Sep 9, 2011

Member

what is the accept header that is send with the given requests? you may need to either: add css/js to the default priorities or you need to set enable prefer_extension (the later was a recent behavior change, that we might need to revert).

Member

lsmith77 commented Sep 9, 2011

what is the accept header that is send with the given requests? you may need to either: add css/js to the default priorities or you need to set enable prefer_extension (the later was a recent behavior change, that we might need to revert).

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 Sep 9, 2011

Member

ok prefer_extension is now on by default.

Member

lsmith77 commented Sep 9, 2011

ok prefer_extension is now on by default.

@lsmith77 lsmith77 closed this Sep 9, 2011

@lenar

This comment has been minimized.

Show comment
Hide comment
@lenar

lenar Sep 9, 2011

Contributor

In Firefox&Chrome both: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Setting prefer_extension to true cures the behavior. Thanks.

Contributor

lenar commented Sep 9, 2011

In Firefox&Chrome both: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Setting prefer_extension to true cures the behavior. Thanks.

@najiasup

This comment has been minimized.

Show comment
Hide comment
@najiasup

najiasup May 10, 2012

Hi,
i want to use FOSRestBundle in my project, for this i followed the this web-site:" http://blog.logicexception.com/2012/04/setting-up-symfony2-rest-service-with.html" but i got the following error: " Fatal error: Class 'JMS\SerializerBundle\JMSSerializerBundle' not found in ...\app\AppKernel.php"
but in my file AppKernel.php i added this ligne: new JMS\SerializerBundle\JMSSerializerBundle($this),

thank's for your help

Hi,
i want to use FOSRestBundle in my project, for this i followed the this web-site:" http://blog.logicexception.com/2012/04/setting-up-symfony2-rest-service-with.html" but i got the following error: " Fatal error: Class 'JMS\SerializerBundle\JMSSerializerBundle' not found in ...\app\AppKernel.php"
but in my file AppKernel.php i added this ligne: new JMS\SerializerBundle\JMSSerializerBundle($this),

thank's for your help

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 May 10, 2012

Member

please follow the installation instructions .. this bundle requires that you install JMSSerializerBundle ..

Member

lsmith77 commented May 10, 2012

please follow the installation instructions .. this bundle requires that you install JMSSerializerBundle ..

@najiasup

This comment has been minimized.

Show comment
Hide comment
@najiasup

najiasup May 10, 2012

i got my error
thank's :)

i got my error
thank's :)

@najiasup

This comment has been minimized.

Show comment
Hide comment
@najiasup

najiasup May 10, 2012

in the final, i got this error:
2/2 FileLoaderLoadException: Cannot import resource "...\app/config\config.yml" from "...\app/config/config_dev.yml"

1/2 InvalidArgumentException: There is no extension able to load the configuration for "acme_user_rest" (in ...\app/config\config.yml). Looked for namespace "acme_user_rest", found "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "assetic", "sensio_framework_extra", "jms_security_extra", "comback", "fos_user", "jms_serializer", "fos_rest", "acme_demo", "web_profiler", "sensio_distribution"

:(

in the final, i got this error:
2/2 FileLoaderLoadException: Cannot import resource "...\app/config\config.yml" from "...\app/config/config_dev.yml"

1/2 InvalidArgumentException: There is no extension able to load the configuration for "acme_user_rest" (in ...\app/config\config.yml). Looked for namespace "acme_user_rest", found "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "assetic", "sensio_framework_extra", "jms_security_extra", "comback", "fos_user", "jms_serializer", "fos_rest", "acme_demo", "web_profiler", "sensio_distribution"

:(

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 May 10, 2012

Member

this is unrelated to this bundle ..

Member

lsmith77 commented May 10, 2012

this is unrelated to this bundle ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment