[DDC-1548] One to one entity badly populated Created: 19/Dec/11  Updated: 19/Dec/11  Resolved: 19/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.1.5, 2.2
Security Level: All

Type: Bug Priority: Critical
Reporter: Asmir Mustafic Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None
Environment:

ubuntu php 5.3.8


Attachments: File 1548.php    

 Description   

One to one entity over populated



 Comments   
Comment by Asmir Mustafic [ 19/Dec/11 ]

I have created a test.

the bug may be in \Doctrine\ORM\Internal\Hydration\AbstractHydrator at line 246.

i think...

remove
if ( ! isset($rowData[$dqlAlias][$cache[$key]['fieldName']]) || $value !== null) {

and replace with :

if ( ! isset($rowData[$dqlAlias][$cache[$key]['fieldName']]) && $value !== null) {

this will fix the bug

Comment by Guilherme Blanco [ 19/Dec/11 ]

Fixed since this commit: https://github.com/doctrine/doctrine2/commit/68663fac4b5619643b8a140d6bbe7031e4fa2ad5

Thanks a lot for the report and patch! =D

Comment by Benjamin Eberlei [ 19/Dec/11 ]

Update fix version, this was merged into 2.1.5





[DDC-1545] Update on loaded association not detected upon flush() Created: 18/Dec/11  Updated: 19/Dec/11  Resolved: 19/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.1.5, 2.2
Security Level: All

Type: Bug Priority: Critical
Reporter: Bernhard Schussek Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

If an association is joined during fetching and then updated in-memory, the update is not detected during flushing. I made the following test cases:

Association is joined:

  • change NULL → entity: does not work
  • change entity → NULL: works
  • change entity1 → entity2: does not work

Assocation is not joined:

  • change NULL → entity: works
  • change entity → NULL: works
  • change entity1 → entity2: works


 Comments   
Comment by Bernhard Schussek [ 18/Dec/11 ]

See here for the test case: https://github.com/bschussek/doctrine-orm/tree/DDC-1545

Comment by Guilherme Blanco [ 19/Dec/11 ]

Increasing priority

Comment by Guilherme Blanco [ 19/Dec/11 ]

Issue fixed since this commit:

https://github.com/doctrine/doctrine2/commit/a8478d5766e2cc4185612af680b7f6bcd83af61e

Thanks a lot for the bug reporting. It was the second time someone reported me this issue and I could not reproduce! =)

Comment by Benjamin Eberlei [ 19/Dec/11 ]

This issue is referenced in Github Pull-Request GH-229
https://github.com/doctrine/doctrine2/pull/229

Comment by Benjamin Eberlei [ 19/Dec/11 ]

Related Pull Request was closed: https://github.com/doctrine/doctrine2/pull/229

Comment by Benjamin Eberlei [ 19/Dec/11 ]

Fixed properly now. Will be merged into 2.1.x

Comment by Benjamin Eberlei [ 19/Dec/11 ]

Update fix version, this was merged into 2.1.5





[DDC-1540] Associations-keys not detected properly when using the XMLDriver Created: 14/Dec/11  Updated: 15/Dec/11  Resolved: 15/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: 2.1.2, 2.1.4
Fix Version/s: 2.1.5
Security Level: All

Type: Bug Priority: Major
Reporter: Saem Ghani Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
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.



 Comments   
Comment by Benjamin Eberlei [ 15/Dec/11 ]

Merged





[DDC-1527] Problem when searching for complex types using a repository Created: 12/Dec/11  Updated: 12/Dec/11  Resolved: 12/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.4
Fix Version/s: 2.1.5
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

See issue here https://github.com/symfony/symfony/issues/2336#issuecomment-3102931



 Comments   
Comment by Benjamin Eberlei [ 12/Dec/11 ]

Fixed





[DDC-1525] Merge fails with "Maximum function nesting level reached" fatal error Created: 09/Dec/11  Updated: 09/Dec/11  Resolved: 09/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.1.5
Security Level: All

Type: Bug Priority: Major
Reporter: Aigars Gedroics Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

It is because of the line https://github.com/doctrine/doctrine2/commit/a99ffc126f3ec3fa45fa806bfdba4fc31f1afaa4#L0R1460 where non-strict comparison is done for collection objects.

I would suggest traversing the elements of the both collections and comparing them using the strict "===" operator.



 Comments   
Comment by Aigars Gedroics [ 09/Dec/11 ]

The https://github.com/doctrine/doctrine2/commit/954b5077e495aa9fa4eb54ef4cb8ac309e9415ae by guilhermeblanco fixes the issue.





[DDC-1520] UnitOfWork->triggerEagerLoads raises SqlException Created: 06/Dec/11  Updated: 13/Dec/11  Resolved: 13/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.4
Fix Version/s: 2.1.5
Security Level: All

Type: Bug Priority: Major
Reporter: Andreas Hörnicke Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

If all entities that are marked to be loaded eagerly are loaded through other references before UnitOfWork->triggerEagerLoads is executed an exception will be thrown as the value of the array is empty.

    public function triggerEagerLoads()
    {
        if (!$this->eagerLoadingEntities) {
            return;
        }

        // avoid infinite recursion
        $eagerLoadingEntities = $this->eagerLoadingEntities;
        $this->eagerLoadingEntities = array();

        foreach ($eagerLoadingEntities AS $entityName => $ids) {
            $class = $this->em->getClassMetadata($entityName);
            $this->getEntityPersister($entityName)->loadAll(array_combine($class->identifier, array(array_values($ids))));
        }
    }


 Comments   
Comment by Benjamin Eberlei [ 13/Dec/11 ]

Fixed.





[DDC-1519] Get a catchable error when trying to find an entity by composite PK which contains association key in the identity map Created: 04/Dec/11  Updated: 15/Dec/11  Resolved: 15/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.1.5
Security Level: All

Type: Bug Priority: Major
Reporter: Denis Vasilev Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 1
Labels: None


 Description   

I got a сatchable error when merging entity that has a composite PK with association FK:

Catchable Fatal Error: Object of class TestBundle\Entity\Foo could not be converted to string in /home/context/httpd/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php line 2606

Entities and their mapping:

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * @ORM\Entity
 */
class Foo
{
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue
     */
    public $id;

    /**
     * @ORM\Column(type="string", nullable=true)
     */
    public $name;

    /**
     * @ORM\OneToMany(targetEntity="FooHasBar", mappedBy="foo", cascade={"persist", "remove", "merge"})
     */
    public $children;

    public function __construct()
    {
        $this->children = new ArrayCollection();
    }
}

/**
 * @ORM\Entity
 */
class Bar
{
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue
     */
    public $id;

    /**
     * @ORM\Column(type="string", nullable=true)
     */
    public $name;
}

/**
 * @ORM\Entity
 */
class FooHasBar
{
    /**
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity="Foo", inversedBy="children")
     * @ORM\JoinColumn(name="foo_id", referencedColumnName="id", nullable=false)
     */
    public $foo;

    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     */
    public $mode;

    /**
     * @ORM\ManyToOne(targetEntity="Bar")
     * @ORM\JoinColumn(name="bar_id", referencedColumnName="id", nullable=false)
     */
    public $bar;

    public function __construct(Foo $foo, Bar $bar, $mode)
    {
        $this->foo = $foo;
        $this->bar = $bar;
        $this->mode = $mode;
    }
}


 Comments   
Comment by Benjamin Eberlei [ 15/Dec/11 ]

Merged.





[DDC-1515] [Regression] Entities with composite PKs and no other scalar fields are not hydrated Created: 29/Nov/11  Updated: 11/Dec/11  Resolved: 11/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.4
Fix Version/s: 2.1.5
Security Level: All

Type: Bug Priority: Critical
Reporter: Glen Ainscow Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None

Attachments: File Test.php     File Test1.php     File Test2.php    

 Description   

Test entities attached.



 Comments   
Comment by Benjamin Eberlei [ 01/Dec/11 ]

Marked as critical

Comment by Guilherme Blanco [ 04/Dec/11 ]

Just as a comment... in 2.2 this issue does not exist.

Comment by Benjamin Eberlei [ 11/Dec/11 ]

Confirmed for 2.1 and 2.2

Comment by Benjamin Eberlei [ 11/Dec/11 ]

Fixed





[DDC-1514] Invalid hydration on multiple joins cross the same table Created: 29/Nov/11  Updated: 15/Dec/11  Resolved: 15/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.3, 2.1.4, 2.1.5
Fix Version/s: 2.1.5
Security Level: All

Type: Bug Priority: Major
Reporter: Piotr Śliwa Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None

Attachments: File DDC1514Test.php    

 Description   

Simillar issue to DDC-1452. Somtime (yes, this bug is not easy to reproduce...) when you fetch objects with multiple join cross the same table (as in DDC-1452 issue), some joins are ignored and multiple queries are necessary to lazy load relations.

I will attach falling test case soon.



 Comments   
Comment by Piotr Śliwa [ 29/Nov/11 ]

Falling test case.

Comment by Benjamin Eberlei [ 15/Dec/11 ]

Verified and i know why it happens.

The entities ba are created before c's are created. That is why doctrine sees a proxy already and then does not fill it with the data.

Comment by Benjamin Eberlei [ 15/Dec/11 ]

Fixed.





[DDC-1512] ClassMetadataFactory::isTransient is not shortcut notation aware Created: 28/Nov/11  Updated: 28/Nov/11  Resolved: 28/Nov/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.4
Fix Version/s: 2.1.5
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Comments   
Comment by Benjamin Eberlei [ 28/Nov/11 ]

Fixed





Generated at Tue Jul 29 00:59:21 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.