Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration problem when using CreateBundle alone #130

Closed
fpiccinali opened this issue Dec 11, 2014 · 4 comments
Closed

configuration problem when using CreateBundle alone #130

fpiccinali opened this issue Dec 11, 2014 · 4 comments

Comments

@fpiccinali
Copy link

I am trying to use CreateBundle only.

I want to edit entity persisted with doctrine.
I have a fresh new project with 2.6.x and i have added deps for "symfony-cmf/create-bundle": "*"

Then i follow the documentation here http://symfony.com/doc/master/cmf/bundles/create/introduction.html#installation Version 1.2
Here is my config.yml

cmf_create:
    object_mapper_service_id: ~
    persistence:
        phpcr:
            enabled:      false
            manager_name: ~
            image:
                enabled:          false
                model_class:      ~
                controller_class: Symfony\Cmf\Bundle\CreateBundle\Controller\ImageController
                basepath:         /cms/media
            delete:               false
fos_rest:
    view:
        formats:
            json: true            

When i do app/console

  [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]                                                                              
  The path "cmf_create.persistence.phpcr.image.model_class" cannot contain an empty value, but got null.

If i comment model_class line, the answer become :

 You need to either enable one of the persistence layers or set the cmf_create.object_mapper_service_id option

If i enable phpcr, a deps error appear.

Where can i find a valid configuration for cmf_create ?

I can write a memo in the documentation if you need.
Or edit composer.json to include correct deps.

@dbu
Copy link
Member

dbu commented Dec 19, 2014

sorry for the late reply, i seem to have missed the issue you created here.

the configuration you provided is the default configuration. no need to repeat that.
if you do not want to use phpcr-odm for storage, you need to provide a service for the object_mapper_service_id. this is explained a bit in the CreateBundle configuration reference

if you are using the ORM, have a look at https://github.com/flack/createphp/blob/master/src/Midgard/CreatePHP/Mapper/DoctrineOrmMapper.php . if you use something else, there is no mapper yet, but looking at those should help to get you started writing it. if its a general thing, please do a PR on the createphp repository to add it.

cmf_create:
    object_mapper_service_id: your-service

fos_rest:
    view:
        formats:
            json: true

we have had the plan to support doctrine orm conveniently in this bundle since a while ago. but there is one missing piece to properly do this, a dispatching mapper to use several mappers together.

@dbu
Copy link
Member

dbu commented Jan 21, 2015

@fpiccinali did that help, did you get things working?

@fpiccinali
Copy link
Author

@dbu thanks for your help.
I cowardly abandoned.

@dbu
Copy link
Member

dbu commented Mar 13, 2015

oh, a pitty. if you are still interested, keep an eye on #135 - the next version of this bundle should have ORM support built-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants