ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 2 replies, has 3 voices, and was last updated by Ivan Klymenko Ivan Klymenko 1 year, 5 months ago.

  • Creator
    Topic
  • #7002

    Pavel Levin
    Participant

    Hello guys!
    I tried to add field with country name to Contact entity, but have problem. I dont want create my dictionary for country and want use oro_dictionary_country. (I know about addressBundle, but i need only one country field).

    1. With Migration
    $this->extendExtension->addManyToOneRelation(
    $schema,
    'orocrm_contact',
    'country',
    'oro_dictionary_country',
    'iso2_code',
    ['extend' => ['without_default' => true, 'is_extend' => true, 'owner' => ExtendScope::OWNER_CUSTOM]]
    );

    when i execute app/console oro:migration:load –force, i have got error:
    [Doctrine\DBAL\Schema\SchemaException]
    The target column name must be "id". Relation column: "orocrm_contact::country_id". Target column name: "iso2_code".

    2. With Entity Manager
    Entity Managament->Contact->Create Field->Name: Country, Type: ManyToOne, Target Entity: OroAddressBundle:Country, Target Field: iso2_code->Save and Close->Update Schema

    After this, i found error in app/logs/dev.log:
    [2014-11-13 14:16:18] app.ERROR:

    [Doctrine\ORM\ORMException]
    Column name `id` referenced for relation from OroCRM\Bundle\ContactBundle\Entity\Contact towards Oro\Bundle\AddressBundle\Entity\Country does not exist.

    [] []
    [2014-11-13 14:16:18] app.ERROR: oro:entity-extend:update-schema [--dry-run] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env="..."] [--no-debug] [--jms-job-id="..."] [--current-user="..."] [--current-organization="..."] [--disabled-listeners="..."] command

    Then when i open any contact detail page i have error:
    SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.country_id' in 'field list'

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #15240

    Skun-ky
    Participant

    Hi!
    I have the same problem right now.
    Did you find the solution ?
    Thank you !

    #15242
    Ivan Klymenko
    Ivan Klymenko
    Oro Core

    Hello guys, thank you for the reported issue!
    We had included it into queue and will provide a fix in one of the the following releases.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.