Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1540

Associations-keys not detected properly when using the XMLDriver

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.1.4
    • Fix Version/s: 2.1.5
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None

      Description

      When using the association-key attribute on an id element in an XML mapping, a MappingException is thrown:

      [Doctrine\ORM\Mapping\MappingException]
      No identifier/primary key specified for Entity 'Foo\BarBundle\Entity\Baz'. Every Entity must have an identifier/primary key.

      This is because in the XMLDriver.php file (version 2.1.2)

      Line 213 reads: $associationIds[(string)$idElement['fieldName']] = true;

      When it should read: $associationIds[(string)$idElement['name']] = true;

      This was fixed on master here, but has not be back ported – as I understand it master is 2.x. This is a fairly significant issues for users of the XMLDriver, currently a show stopper on our work, especially as we're using Symfony Standard distribution 2.0.6 – 2.0.7 references a version of Doctrine with another bug.

      I've confirmed that this bug exists in 2.1.2, and 2.1.4, but it probably effects more versions.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Merged

        Show
        Benjamin Eberlei added a comment - Merged

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Saem Ghani
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: