sonata-project / ecommerce

[Abandoned] E-Commerce solution provided by Sonata
https://sonata-project.org
MIT License
165 stars 139 forks source link

Discriminator map error #261

Closed andrewnester closed 8 years ago

andrewnester commented 10 years ago

Hi I am receiveing Entity 'Application\Sonata\ProductBundle\Entity\Product' has to be part of
the discriminator map of 'Application\Sonata\ProductBundle\Entity\Product'
to be properly mapped in the inheritance hierarchy. Alternatively you can m
ake 'Application\Sonata\ProductBundle\Entity\Product' an abstract class to
avoid this exception from occurring.

Yes, I created Product Prototype and Yes, it extends Product class

Here is my config

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: @ApplicationSonataProductBundle/Resources/config/product.yml }

framework:
    #esi:             ~
    #translator:      { fallback: "%locale%" }
    secret:          "%secret%"
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    templating:
        engines: ['twig']
        #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    trusted_hosts:   ~
    trusted_proxies: ~
    session:
        # handler_id set to null will use default session handler from php.ini
        handler_id:  ~
    fragments:       ~
    http_method_override: true

# Twig Configuration
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"

# Assetic Configuration
assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    bundles:        [ ]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        #closure:
        #    jar: "%kernel.root_dir%/Resources/java/compiler.jar"
        #yui_css:
        #    jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

# Doctrine Configuration
doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8
        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: "%kernel.root_dir%/data/data.db3"
        # path:     "%database_path%"

        types:
          json: Sonata\Doctrine\Types\JsonType
          currency: Sonata\Component\Currency\CurrencyDoctrineType
    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        auto_mapping: true
        mappings:
          SonataMediaBundle: ~
          ApplicationSonataProductBundle: ~
          SonataProductBundle: ~

# Swiftmailer Configuration
swiftmailer:
    transport: "%mailer_transport%"
    host:      "%mailer_host%"
    username:  "%mailer_user%"
    password:  "%mailer_password%"
    spool:     { type: memory }

fos_user:
    db_driver: orm
    firewall_name: main
    user_class:     Application\Sonata\UserBundle\Entity\User
    group:
        group_class:   Application\Sonata\UserBundle\Entity\Group
        group_manager: sonata.user.orm.group_manager

sonata_block:
    default_contexts: [cms]
    blocks:
        # Enable the SonataAdminBundle block
        sonata.admin.block.admin_list:
            contexts:   [admin]

sonata_user:
    security_acl: true
    manager_type: orm
    profile:
        menu:
            - { route: 'sonata_user_profile_edit', label: 'link_edit_profile', domain: 'SonataUserBundle'}
            - { route: 'sonata_user_profile_edit_authentication', label: 'link_edit_authentication', domain: 'SonataUserBundle'}
            - { route: 'sonata_order_index', label: 'order_list', domain: 'SonataOrderBundle'}

sonata_media:
    default_context: default
    db_driver: doctrine_orm
    contexts:
        default:
            providers:
                - sonata.media.provider.image
                - sonata.media.provider.file

            formats:
                small: { width: 100 , quality: 70}
                big:   { width: 500 , quality: 70}

    cdn:
        server:
            path: /uploads/media

    filesystem:
        local:
            directory:  %kernel.root_dir%/../web/uploads/media
            create:     false

sonata_price:
    currency: USD

sonata_delivery:
  services:
      free_address_required:
          name: Free
          enabled: true
          priority: 1
          code: free

sonata_payment:
    services:
        pass:
            name:    Pass
            enabled: true
            code:    pass
            browser: sonata.payment.browser.curl

            transformers:
                basket: sonata.payment.transformer.basket
                order:  sonata.payment.transformer.order

            options:
                shop_secret_key: assdsds
                url_callback:    sonata_payment_callback
                url_return_ko:   sonata_payment_error
                url_return_ok:   sonata_payment_confirmation
    # service which find the correct payment methods for a basket
    selector: sonata.payment.selector.simple

    # service which generate the correct order and invoice number
    generator: sonata.payment.generator.mysql

    transformers:
        order:  sonata.payment.transformer.order
        basket: sonata.payment.transformer.basket

sonata_product:
    products:
        sonata.shop.product.crewneck:
            provider: sonata.shop.product.crewneck.type
            manager: sonata.shop.product.crewneck.manager
    class:
        product:              Application\Sonata\ProductBundle\Entity\Product
        package:              Application\Sonata\ProductBundle\Entity\Package
        product_category:     Application\Sonata\ProductBundle\Entity\ProductCategory
        product_collection:   Application\Sonata\ProductBundle\Entity\ProductCollection
        category:             Application\Sonata\ClassificationBundle\Entity\Category
        collection:           Application\Sonata\ClassificationBundle\Entity\Collection
        delivery:             Application\Sonata\ProductBundle\Entity\Delivery
        gallery:              Application\Sonata\MediaBundle\Entity\Gallery
dnzmsc commented 10 years ago

Hi, did you solve your problem? I have the same!

andrewnester commented 10 years ago

@dnzmsc Yes, I have just made 'Application\Sonata\ProductBundle\Entity\Product' class abstract

dnzmsc commented 10 years ago

Thank you very much! But do you think it is a Sonata ecommerce error, or other? Il giorno 17/lug/2014, alle ore 10:01, Nester notifications@github.com ha scritto:

@dnzmsc Yes, I have just made 'Application\Sonata\ProductBundle\Entity\Product' class abstract

— Reply to this email directly or view it on GitHub.

eko commented 10 years ago

Hi @andrewnester,

Yes, you should have a Application\Sonata\ProductBundle\Entity\Crewneck entity which extends a Application\Sonata\ProductBundle\Entity\Product abstract class.

dnzmsc commented 10 years ago

Perfect, thanks!

Andrea Cammoranesi

Il giorno 17/lug/2014, alle ore 12:04, Vincent Composieux notifications@github.com ha scritto:

Hi @andrewnester,

Yes, you should have a Application\Sonata\ProductBundle\Entity\Crewneck entity which extends a Application\Sonata\ProductBundle\Entity\Product abstract class.

— Reply to this email directly or view it on GitHub.

core23 commented 8 years ago

This issue is very old. Can you please check this against the latest master version?

Feel free to reopen if this error still exists.

MaraScott commented 8 years ago

Hi,

I have extended SonataProductBundle form sonata-poroject/ecommerce:2.x-dev and I get the same error

When extending this Bundle the abstract class is not extended as abstract, is that possible to make it so ?