Reply
Mapping error in ccdn forum bundle 2.0.3
Replies: 4   Views: 2165  Subscribers: 2

Posted by Denipsys · 16-02-2014 - 13:39

Hello everyone!

I'm trying to integrate CCDN Forum Bundle 2 in my Symfony 2.4.2 project. I'm configurring using steps from manual but   getting   "The class 'DDD\PrintplusonlineBundle\Entity\User' was not found in the chain configured namespaces CCDNForum\ForumBundle\Entity, FOS\UserBundle\Model" error when trying to dump sql.

I see that this problem was solved ­here­ but as I understand the configuration changed on new version.

My Doctrine ORM config:

­
orm:
        auto_generate_proxy_classes: %kernel.debug%
        default_entity_manager: default
        resolve_target_entities:
            Symfony\Component\Security\Core\User\UserInterface: DDD\PrintplusonlineBundle\Entity\User
        entity_managers:
            default:
                mappings:
                    CCDNForumForumBundle:
                        mapping:              true
                        type:                 yml
                        dir:                  "Resources/config/doctrine"
                        alias:                ~
                        prefix:               CCDNForum\ForumBundle\Entity
                        is_bundle:            true­
Thank you in advance!­

Posted by reece · 19-02-2014 - 00:21

Hmm is this happening when working on the console doing something like:

­
$ php app/console doctrine:schema:update --dump-sql­
I am wondering if FOSUserBundle is fully configured, i would recommend disabling the forum bundle first and ensuring that FOSUserBundle is properly configured before you attempt to configure the forum bundle, as i suspect this is where the issue lies. The other issue, could be this line "DDD\PrintplusonlineBundle\Entity\User", where plusonline is, are they meant to be all lower case, or is there some camel case involved? It could be that the class exists but the namespace is incorrect. I think its best that you setup FOSUserBundle and your other bundles first to eliminate a misconfiguration in the Forum Bundle. Let me know how it goes.­

Posted by Denipsys · 01-03-2014 - 08:11

Thank you for reply!

Yes, this error appears when I try to run doctrine update console function. The site is actually running for a while and FOSUserBundle is doing OK. I think if there weren't any problems with it before, it is configured properly.

The name of bundle in config file is spelled correctly.­

Posted by reece · 13-03-2014 - 14:17

Take a look at ­this topic here­, i think it might help. Someone else had an issue and they just needed to change the mapping type to annotation if thats what they were using to override some stuff. 

Hope this helps.­

Posted by Denipsys · 17-03-2014 - 20:06

Thank you! It is a really working solution. Here is a config that I've added:

­
entity_managers:
            default:
                mappings:
                    FOSUserBundle: ~
                    PponlineBundle:
                        mapping:              true
                        type:                 annotation
                        alias:                ~
                        prefix:               DDD\PrintplusonlineBundle\Entity
                        is_bundle:            true
                    CCDNForumForumBundle:
                        mapping:              true
                        type:                 yml
                        dir:                  "Resources/config/doctrine"
                        alias:                ~
                        prefix:               CCDNForum\ForumBundle\Entity
                        is_bundle:            true­