Closed Filoz closed 6 years ago
Ok, now it works! The problem was in fos_rest configuration, body_converter must be disabled
fos_rest:
body_converter:
enabled: false
I'm sorry but I have to reopen the issue;
The format "" is not supported for deserialization.
This error appears in every CMS page, instead of the Hybrid and Dynamic pages do not have this problem.
The only solution I found is to disable body_converter
fos_rest:
body_converter:
enabled: false
But I need it enabled to make my apis work. Any idea?
Thank you!
You need to specify the converter service name. Try this for MongoDb:
@ParamConverter("Article", class="AcmeDemoBundle:Article", converter="doctrine.odm")
for MySql, I think, you need something like "doctrine.orm"
Hello
I've the same problem on CMS page (not Hybrid) someone have an explanation why we should disable it, while in the documentation he's activated ?
https://sonata-project.org/bundles/page/master/doc/reference/api.html#setup
I've the problem only on projects using SonataPage, and I don't know what i could have missed.
sonata-project/admin-bundle 2.3.2 Symfony SonataAdminBundle
sonata-project/block-bundle 2.2.13 Symfony SonataBlockBundle
sonata-project/cache 1.0.4 Cache library
sonata-project/cache-bundle 2.2.0 This bundle provides caching services
sonata-project/core-bundle 2.3.1 Symfony SonataCoreBundle
sonata-project/datagrid-bundle dev-master 270ea21 Symfony SonataDatagridBundle
sonata-project/doctrine-extensions 1.0.2 Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 2.3.1 Symfony Sonata / Integrate Doctrine ORM int...
sonata-project/easy-extends-bundle 2.1.9 Symfony SonataEasyExtendsBundle
sonata-project/exporter 1.3.4 Lightweight Exporter library
sonata-project/formatter-bundle 2.3.3 Symfony SonataFormatterBundle
sonata-project/google-authenticator 1.0.2 Library to integrate Google Authenticator i...
sonata-project/intl-bundle 2.2.1 Symfony SonataIntlBundle
sonata-project/media-bundle 2.3.1 Symfony SonataMediaBundle
sonata-project/notification-bundle 2.3.0 Symfony SonataNotificationBundle
sonata-project/page-bundle 2.3.9 Symfony SonataPageBundle
sonata-project/seo-bundle 1.1.10 Symfony SonataSeoBundle
jms/aop-bundle 1.0.1 Adds AOP capabilities to Symfony2
jms/cg 1.0.0 Toolset for generating PHP code
jms/di-extra-bundle 1.5.0 Allows to configure dependency injection us...
jms/metadata 1.5.1 Class/method/property metadata management i...
jms/parser-lib 1.0.0 A library for easily creating recursive-des...
jms/security-extra-bundle 1.5.1 Enhances the Symfony2 Security Component by...
jms/serializer 0.16.0 Library for (de-)serializing data of any co...
jms/serializer-bundle 0.13.0 Allows you to easily serialize, and deseria...
friendsofsymfony/rest-bundle 1.5.3 This Bundle provides various tools to rapid...
Thanks
Is there a solution except disabling body converter?
@borNfreee for me adding Content-Type header equal to application/json solves the problem becase of that: https://github.com/FriendsOfSymfony/FOSRestBundle/blob/c1b87d933dfc9b59fc603f8e44f8064e4530a2b1/Request/RequestBodyParamConverter.php#L95
I found solution in custom ParamConverter: https://github.com/FriendsOfSymfony/FOSRestBundle/issues/1219#issuecomment-266473461
Not sure if there is something that we should fix on Sonata or it is a missing configuration on FOSRest.
Closing for now, if there is something that need to be fixed in this bundle, please ping me to reopen.
Hi, I'm trying to use sonata page bundle inside my project, unfortunately I get this exception when I try to view a page after creating it.
The problem does not occur with the routes created by sonata: page: update-core-routes - site = all whch are properly accessible.
here is the stack trace:
Composer
Thank you very mich for your help!