Skip to content

Potential conflict with mongodb bundle for directory prefix  #152

@benglass

Description

@benglass

This may be a non-issue but I just ran into it on SonataMediaBundle. Both the extensions for PHPCRBundle and MongoDBBundle have their extension class with the method getMappingObjectDefaultName which returns the string 'Document'.

This causes auto-mapping for both of these bundles to assume anything in the Document namespace must have accompanying mapping. You can get around this by disabling auto mapping and explicitly specifying the prefix for documents. It seems unlikely people will use both of these bundles concurrently since they are both ODM bundles but I suppose its possible.

This could also cause issues with any bundle that has a Document namespace causing exceptions because mapping info wont be found. This of course exists for the MongoDB namespace as well and of course you can get around it by not using auto mapping.

https://github.com/doctrine/DoctrineMongoDBBundle/blob/master/DependencyInjection/DoctrineMongoDBExtension.php#L343

https://github.com/doctrine/DoctrinePHPCRBundle/blob/master/DependencyInjection/DoctrinePHPCRExtension.php#L465

There may be nothing that can or should be done about this but I figured I'd log it here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions