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

Propel / Edit w. many to many #257

Open
lionelbzv opened this issue Feb 19, 2016 · 0 comments
Open

Propel / Edit w. many to many #257

lionelbzv opened this issue Feb 19, 2016 · 0 comments

Comments

@lionelbzv
Copy link
Contributor

Env: SF2.8 / Propel Bundle 1.5 / Generator 2.0.4

Continuing the SF2.8 migration, I've now got problem to create/edit many to many related objects.

Example: CmsContent with n:m CmsType

CmsContent-generator.yml

    edit:
        params:
            title: "You're editing the object \"%object%\"|{ %object%: CmsContent.title }|"
            display:
                "Fields":            [ cms_category, cms_types, title ]
            fields:
                cms_types:
                    formType:                   model
                    addFormOptions:
                        multiple:               true
                        class:                  Model\CmsType
                        query:                  \Model\CmsTypeQuery::create()->orderById() 

This config throws Fatal error: Call to a member function getTableMap() on string in in vendor/propel/propel-bundle/Form/ChoiceList/ModelChoiceList.php at line 105.

The problem is in the BaseEditType->getOptionsCmsTypes where the query is not instanciate as an object but is only a simple string.

I've updated my "test propel repo" w. a new "manytomany" branch if you want to easily reproduce the problem: https://github.com/Lionel09/project-sf2.8

I you find how to fix this one, you can also update the "model" form_types for propel: it's now Propel\Bundle\PropelBundle\Form\Type\ModelType w. the propel-bundle 1.5 (the one for sf2.8).

Thanks

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

1 participant