[DDC-3560] [GH-1300] [2.4] #1169 DDC-3343 one-to-omany persister deletes only on EXTRA_LAZY plus orphanRemoval Created: 05/Feb/15  Updated: 16/Feb/15  Resolved: 16/Feb/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: 2.4.7
Fix Version/s: 2.4.8
Security Level: All

Type: Bug Priority: Blocker
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: extra-lazy, onetomany, orphanRemoval, persistent-collection, persister

Issue Links:
Dependency
is required for DDC-3343 `PersistentCollection::removeElement`... Resolved

 Description   

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/doctrine2/pull/1300

Message:

As per #1169 and DDC-3343 ( http://www.doctrine-project.org/jira/browse/DDC-3343 ), `EXTRA_LAZY` `PersistentCollection#removeElement()` calls should only affect the database if `orphanRemoval=true` is specified in the mappings.

Otherwise, being the `one-to-many` the inverse side, no action should be performed.



 Comments   
Comment by Doctrine Bot [ 05/Feb/15 ]

A related Github Pull-Request [GH-1300] was labeled:
https://github.com/doctrine/doctrine2/pull/1300

Comment by Doctrine Bot [ 05/Feb/15 ]

A related Github Pull-Request [GH-1300] was assigned:
https://github.com/doctrine/doctrine2/pull/1300

Comment by Doctrine Bot [ 16/Feb/15 ]

A related Github Pull-Request [GH-1300] was assigned:
https://github.com/doctrine/doctrine2/pull/1300

Comment by Doctrine Bot [ 16/Feb/15 ]

A related Github Pull-Request [GH-1300] was unassigned:
https://github.com/doctrine/doctrine2/pull/1300

Comment by Doctrine Bot [ 16/Feb/15 ]

A related Github Pull-Request [GH-1300] was merged:
https://github.com/doctrine/doctrine2/pull/1300





[DDC-3549] [GH-1292] Mark getSelectConditionStatementColumnSQL method as private Created: 28/Jan/15  Updated: 29/Jan/15  Resolved: 29/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: bc, persister


 Description   

This issue is created automatically through a Github pull request on behalf of goetas:

Url: https://github.com/doctrine/doctrine2/pull/1292

Message:

The `Doctrine/\ORM\Persisters\BasicEntityPersister::getSelectConditionStatementColumnSQL` method has been marked as `private`.

The current `protected` mark is a bit unuseful since everything is already handled into the public method `getSelectConditionStatementSQL`.



 Comments   
Comment by Doctrine Bot [ 29/Jan/15 ]

A related Github Pull-Request [GH-1292] was merged:
https://github.com/doctrine/doctrine2/pull/1292





[DDC-3535] Allow binding `Parameter` value object to statements, removing the need for explicit value and type passing Created: 24/Jan/15  Updated: 24/Jan/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Task Priority: Critical
Reporter: Marco Pivetta Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: binding, criteria, parameters, persister, repository, type


 Comments   
Comment by Marco Pivetta [ 24/Jan/15 ]

We currently have a lot of locations in the code where we use list($values, $types) = $this->computeParameters(); (pseudo-code).

This leads to a lot of code duplication and complexity.

Maybe a Parameter VO may be used instead, or a ParameterCollection with a fixed $types and a mutable $values, and with minimal internal validation.





[DDC-3534] [GH-1280] [DDC-3346] #1277 find one with eager loads is failing Created: 23/Jan/15  Updated: 25/Mar/15  Resolved: 25/Mar/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: collection, eager, fetch, hydrator, lazy-loading, many-to-many, onetomany, persister

Issue Links:
Dependency
is required for DDC-3346 findOneBy returns an object with part... Resolved
is required for DDC-3531 [GH-1277] [DDC-3346] Failing test for... Resolved

 Description   

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/doctrine2/pull/1280

Message:

Ping @scaytrase

Note that this is a first revision and needs refactoring, so please consider helping out with that if you can.

Ping @guilhermeblanco: please check the `CachedPersisterContext` stuff: it's dirty as heck, but that's because the persister internal generated SQL caching is inconsistent as heck too.

Resolution path for 2.4.x will be to throw an exception if there is an offset or a limit.



 Comments   
Comment by Doctrine Bot [ 23/Jan/15 ]

A related Github Pull-Request [GH-1277] was assigned:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 23/Jan/15 ]

A related Github Pull-Request [GH-1277] was closed:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1280] was labeled:
https://github.com/doctrine/doctrine2/pull/1280

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1277] was labeled:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1280] was assigned:
https://github.com/doctrine/doctrine2/pull/1280

Comment by Doctrine Bot [ 25/Jan/15 ]

A related Github Pull-Request [GH-1280] was merged:
https://github.com/doctrine/doctrine2/pull/1280





[DDC-3531] [GH-1277] [DDC-3346] Failing test for issue (bad findOneBy behaviour with eager fetch) Created: 22/Jan/15  Updated: 25/Jan/15  Resolved: 23/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: Git Master, 2.4.7
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: collection, eager, fetch, hydration, many-to-many, onetomany, persister

Issue Links:
Dependency
depends on DDC-3534 [GH-1280] [DDC-3346] #1277 find one w... Resolved
is required for DDC-3346 findOneBy returns an object with part... Resolved

 Description   

This issue is created automatically through a Github pull request on behalf of scaytrase:

Url: https://github.com/doctrine/doctrine2/pull/1277

Message:

Here is the test for DDC-3346(http://www.doctrine-project.org/jira/browse/DDC-3346) issue



 Comments   
Comment by Doctrine Bot [ 23/Jan/15 ]

A related Github Pull-Request [GH-1277] was assigned:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 23/Jan/15 ]

A related Github Pull-Request [GH-1277] was closed:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1280] was labeled:
https://github.com/doctrine/doctrine2/pull/1280

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1277] was labeled:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1280] was assigned:
https://github.com/doctrine/doctrine2/pull/1280

Comment by Doctrine Bot [ 25/Jan/15 ]

A related Github Pull-Request [GH-1280] was merged:
https://github.com/doctrine/doctrine2/pull/1280





[DDC-3517] [GH-1265] Fix error undefined index "targetEntity" in persister Created: 18/Jan/15  Updated: 28/Jan/15  Resolved: 18/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: inheritance, one-to, onetoone, persister, sti


 Description   

This issue is created automatically through a Github pull request on behalf of andersonamuller:

Url: https://github.com/doctrine/doctrine2/pull/1265

Message:



 Comments   
Comment by Doctrine Bot [ 18/Jan/15 ]

A related Github Pull-Request [GH-1265] was assigned:
https://github.com/doctrine/doctrine2/pull/1265

Comment by Doctrine Bot [ 18/Jan/15 ]

A related Github Pull-Request [GH-1265] was merged:
https://github.com/doctrine/doctrine2/pull/1265





[DDC-3504] [GH-1258] Classify persisters into more granular namespaces. Created: 15/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: persister, refactoring


 Description   

This issue is created automatically through a Github pull request on behalf of guilhermeblanco:

Url: https://github.com/doctrine/doctrine2/pull/1258

Message:



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

A related Github Pull-Request [GH-1258] was assigned:
https://github.com/doctrine/doctrine2/pull/1258

Comment by Doctrine Bot [ 15/Jan/15 ]

A related Github Pull-Request [GH-1258] was closed:
https://github.com/doctrine/doctrine2/pull/1258





[DDC-3487] [GH-1246] [WIP] Moved delete() and update() to proper locations. Created: 12/Jan/15  Updated: 13/Jan/15  Resolved: 13/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: collection, criteria, persister, refactoring


 Description   

This issue is created automatically through a Github pull request on behalf of guilhermeblanco:

Url: https://github.com/doctrine/doctrine2/pull/1246

Message:



 Comments   
Comment by Doctrine Bot [ 13/Jan/15 ]

A related Github Pull-Request [GH-1246] was assigned:
https://github.com/doctrine/doctrine2/pull/1246

Comment by Doctrine Bot [ 13/Jan/15 ]

A related Github Pull-Request [GH-1246] was merged:
https://github.com/doctrine/doctrine2/pull/1246





[DDC-3413] Types are always ignored when performing a one to many statement Created: 26/Nov/14  Updated: 12/Mar/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Edouard COLE Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: persister


 Description   

BasicEntityPersister#getOneToManyStatement() is building an array named $criteria. This array is built this way:

$criteria[$tableAlias . "." . $targetKeyColumn] = ...;

This means this array is indexed by keys looking like that:

t0.fieldName

But the function BasicEntityPersister#expandParameters() is used in this function, and this function is NOT able to handle SQL field name as keys, but PHP attributes, because it uses BasicEntityPersister#getType() which is doing this:

case (isset($this->class->fieldMappings[$field])):
case (isset($this->class->associationMappings[$field])):

I think the $criteria array should be used to call BasicEntityPersister#getSelectSQL(), but another array should be passed to expandParameters. Here is a potential fix:

$cleanCriteria[$owningAssoc['fieldName']] = $criteria[$tableAlias . "." . $targetKeyColumn] = ...;

And $cleanCriteria should be passed to expandParameters.



 Comments   
Comment by Marco Pivetta [ 27/Nov/14 ]

Edouard COLE I suggest you to open a pull request with a failing test case, otherwise this issue is hard to follow/understand.

Comment by Edouard COLE [ 12/Mar/15 ]

I think this issue is fixed since https://github.com/doctrine/doctrine2/commit/ce446a6f033ca46fc65911e6f40299336ddace74





[DDC-3387] [GH-1182] #1086 identifier type in proxies Created: 11/Nov/14  Updated: 17/Jan/15  Resolved: 17/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL, ORM
Affects Version/s: 2.4.6
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: hydration, jti, persister, sti

Issue Links:
Dependency
is required for DDC-3223 Failing test (get id return string type) Resolved
Reference
is referenced by DDC-3394 UOW CreateEntity failure with zerofil... Resolved

 Description   

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/doctrine2/pull/1182

Message:

See #1086. This fix simply ensures that the column type for identifiers of proxies of STI/JTI are kept consistent with the DBAL types they are mapped to.

May be related/colliding with #1178

Ping @jaspernbrouwer



 Comments   
Comment by Doctrine Bot [ 17/Jan/15 ]

A related Github Pull-Request [GH-1182] was assigned:
https://github.com/doctrine/doctrine2/pull/1182

Comment by Doctrine Bot [ 17/Jan/15 ]

A related Github Pull-Request [GH-1182] was closed:
https://github.com/doctrine/doctrine2/pull/1182





[DDC-3380] [GH-1178] Fixing associations using UUIDs Created: 09/Nov/14  Updated: 24/Jan/15  Resolved: 17/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, Mapping Drivers, ORM
Affects Version/s: Git Master
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: association, composite-identifier, custom-dbal-type, identifier, persister

Issue Links:
Dependency
is required for DDC-3373 [GH-1174] Fix associations with a cus... Resolved
Duplicate
is duplicated by DDC-3239 [GH-1097] `expandParameters`/`getType... Resolved
is duplicated by DDC-3373 [GH-1174] Fix associations with a cus... Resolved
Reference
relates to DDC-3239 [GH-1097] `expandParameters`/`getType... Resolved

 Description   

This issue is created automatically through a Github pull request on behalf of jaspernbrouwer:

Url: https://github.com/doctrine/doctrine2/pull/1178

Message:

This is a port of #1174.

I was running an experiment using a custom DBAL type, which converts a UUID string (in PHP) to 16 bytes binary string (in SQL) and vice versa, as identifier for a couple of entities. I noticed some associations weren't loaded correctly. This PR attempts to fix that issue.

_Remaining issue_

There are 2 tests that involve OneToOne and OneToMany associations with composite ids of which one is a foreign one. When the owning side is fetched from the DB, a Proxy object is created for the inversed side. But this Proxy contains incorrect identifiers:

public $id => string(36) "12345678-9abc-def0-1234-56789abcdef0"
public $foreignEntity => string(16) "????????????????"

Those question-marks represent 16 bytes of binary data. The thing is that `$foreignEntity` should contain another Proxy object (or perhaps the UUID of the foreign entity, I'm not sure).

I'm at a loss here Hopefully someone can point me to where identity through foreign Entities is managed!



 Comments   
Comment by Doctrine Bot [ 09/Nov/14 ]

A related Github Pull-Request [GH-1178] was closed:
https://github.com/doctrine/doctrine2/pull/1178

Comment by Doctrine Bot [ 09/Nov/14 ]

A related Github Pull-Request [GH-1178] was reopened:
https://github.com/doctrine/doctrine2/pull/1178

Comment by Doctrine Bot [ 10/Nov/14 ]

A related Github Pull-Request [GH-1178] was assigned:
https://github.com/doctrine/doctrine2/pull/1178

Comment by Jasper N. Brouwer [ 10/Nov/14 ]

Affects Versions: master (2.5) and 2.4 are confirmed, but I suspect this goes back to all versions.

Comment by Doctrine Bot [ 17/Jan/15 ]

A related Github Pull-Request [GH-1178] was closed:
https://github.com/doctrine/doctrine2/pull/1178





[DDC-3346] findOneBy returns an object with partial collection for the properties with mapping oneToMany/Fetch Eager Created: 10/Oct/14  Updated: 28/Jan/15  Resolved: 25/Jan/15

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

Type: Bug Priority: Critical
Reporter: Adrien Russo Assignee: Marco Pivetta
Resolution: Fixed Votes: 2
Labels: collection, eager, fetch, lazy-loading, many-to-many, onetomany, persister

Issue Links:
Dependency
depends on DDC-3531 [GH-1277] [DDC-3346] Failing test for... Resolved
depends on DDC-3534 [GH-1280] [DDC-3346] #1277 find one w... Resolved

 Description   

findOneBy returns an object with partial collection for the properties with mapping oneToMany/Fetch Eager. This bug appear only for entities without inheritance.

Mapping
       
Test\Bar:
    type: entity
    table: bar
    fields:
        code:
            type: string
    oneToMany:
        posts:
            targetEntity: Test\Post
            fetch: EAGER
            mappedBy: bar
            cascade: ['all']
    
Test\Post:
    type: entity
    table: post
    fields:
        content:
            type: text
    manyToOne:
        bar:
            targetEntity: Test\Bar
            cascade: []
            joinColumn:
                name: bar_id
                referencedColumnName: id
Data
    
$bar = new \Test\Bar('foo');
$bar->addPost(
  new Test\Post('toto')
);
$bar->addPost(
  new Test\Post('tata')
);
 
$bar->getPosts()->count(); #value is 2
$manager->persist($bar);
$manager->flush();
FindOneBy with fetch eager
$bar = $repository->findOneBy(['code' => 'foo']);
$bar->getPosts()->count(); #value is 1
FindOneBy with fetch Lazy
$bar = $repository->findOneBy(['code' => 'foo']);
$bar->getPosts()->count(); #value is 2

I think this bug is due to the LIMIT 1 clause happening on findOneBy which also applies on joins generated here.

For instance, the generated SQL statement generated might look like

Sql Statement
SELECT
	t0. ID AS id_1,
	t0.code AS code_2,
	t1. ID AS id_3,
	t1.content AS content_4,
	t1.bar_id AS bar_id_5
FROM
	bar t0
LEFT JOIN post t1 ON t1.bar_id = t0. ID
WHERE
	t0. code = 'foo'
LIMIT 1


 Comments   
Comment by Pavel Batanov [ 22/Jan/15 ]

Still expiriencing it at 2.5.0-alpha (b889e18a9a15c36eac7349b06cb4b0f955a9da57). findOneBy cuts many-to-many association with fetch eager by 'LIMIT 1'

Comment by Marco Pivetta [ 22/Jan/15 ]

Pavel Batanov yeah, we don't have a fix for it yet: I suggest providing a PR with the failing test first, and if we can't get to it, trying to patch it yourself, or at least find out which code bit affects this behavior.

Comment by Pavel Batanov [ 22/Jan/15 ]

I'm finishing such PR now. Will supply it to github soon

Comment by Pavel Batanov [ 22/Jan/15 ]

here it is
https://github.com/doctrine/doctrine2/pull/1277
http://www.doctrine-project.org/jira/browse/DDC-3531

Here is the failed travis build
https://travis-ci.org/scaytrase/doctrine2/jobs/47921568

Comment by Doctrine Bot [ 23/Jan/15 ]

A related Github Pull-Request [GH-1277] was assigned:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 23/Jan/15 ]

A related Github Pull-Request [GH-1277] was closed:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1280] was labeled:
https://github.com/doctrine/doctrine2/pull/1280

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1277] was labeled:
https://github.com/doctrine/doctrine2/pull/1277

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1280] was assigned:
https://github.com/doctrine/doctrine2/pull/1280

Comment by Doctrine Bot [ 25/Jan/15 ]

A related Github Pull-Request [GH-1280] was merged:
https://github.com/doctrine/doctrine2/pull/1280

Comment by Marco Pivetta [ 25/Jan/15 ]

Handled in DDC-3534

Comment by Matteo Beccati [ 28/Jan/15 ]

FYI the test is failing on: https://revive.beccati.com/bamboo/browse/PHP-DOCTR-PHP54-249/test/case/18357533

As far as I can tell from https://www.sqlite.org/lang_select.html SQLite doesn't support OFFSET w/o LIMIT.

Doctrine\Tests\ORM\Functional\Ticket\DDC3346Test::testFindWithEagerFetchAndOffsetWillNotHydrateLimitedCollection
Exception: [Doctrine\DBAL\Exception\SyntaxErrorException] An exception occurred while executing 'SELECT t0.id AS id_1, t0.username AS username_2 FROM ddc3346_users t0 WHERE t0.username = ? OFFSET 0' with params ["bwoogy"]:

SQLSTATE[HY000]: General error: 1 near "OFFSET": syntax error

With queries:
6. SQL: '"COMMIT"' Params: 
5. SQL: 'INSERT INTO ddc3346_articles (user_id) VALUES (?)' Params: '1'
4. SQL: 'INSERT INTO ddc3346_articles (user_id) VALUES (?)' Params: '1'
3. SQL: 'INSERT INTO ddc3346_users (username) VALUES (?)' Params: 'bwoogy'
2. SQL: '"START TRANSACTION"' Params: 

Trace:
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:116
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:838
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:875
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/lib/Doctrine/ORM/EntityRepository.php:181
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3346Test.php:53
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/phpunit/phpunit/src/Framework/TestCase.php:860
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/phpunit/phpunit/src/Framework/TestCase.php:737
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/phpunit/phpunit/src/Framework/TestResult.php:609
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/phpunit/phpunit/src/Framework/TestCase.php:693
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/phpunit/phpunit/src/Framework/TestSuite.php:716
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/phpunit/phpunit/src/Framework/TestSuite.php:716
/home/atlassian/bamboo/xml-data/build-dir/PHP-DOCTR-PHP54/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:398
phar:///home/atlassian/bin/phpunit.phar/phpunit/TextUI/Command.php:179
phar:///home/atlassian/bin/phpunit.phar/phpunit/TextUI/Command.php:132
/home/atlassian/bin/phpunit.phar:584
Comment by Steve Müller [ 28/Jan/15 ]

Matteo Beccati I believe this is fixed already by https://github.com/doctrine/dbal/pull/782

Comment by Matteo Beccati [ 28/Jan/15 ]

My mistake. The build wasn't cleaning up the vendor dir before running composer update, so it was still using an old dbal.





[DDC-3258] [GH-1113] Added support for composite primary key on findBy methods and Criteria Created: 18/Aug/14  Updated: 16/Feb/15  Resolved: 16/Feb/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM, Second Level Cache
Affects Version/s: None
Fix Version/s: 2.5
Security Level: All

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: association, associationKey, composite-identifier, persister, second-level-cache

Issue Links:
Duplicate
is duplicated by DDC-3260 [GH-1114] Composite pk break test Resolved
is duplicated by DDC-3316 [GH-1141] Always allow proxies on ToO... Resolved

 Description   

This issue is created automatically through a Github pull request on behalf of goetas:

Url: https://github.com/doctrine/doctrine2/pull/1113

Message:

Hi!
I tried to implement the matching of entities that uses composite primary keys...

Any suggestion?



 Comments   
Comment by Doctrine Bot [ 22/Oct/14 ]

A related Github Pull-Request [GH-1113] was assigned:
https://github.com/doctrine/doctrine2/pull/1113

Comment by Doctrine Bot [ 18/Jan/15 ]

A related Github Pull-Request [GH-1113] was closed:
https://github.com/doctrine/doctrine2/pull/1113

Comment by Doctrine Bot [ 18/Jan/15 ]

A related Github Pull-Request [GH-1113] was reopened:
https://github.com/doctrine/doctrine2/pull/1113

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1113] was labeled:
https://github.com/doctrine/doctrine2/pull/1113

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1113] was labeled:
https://github.com/doctrine/doctrine2/pull/1113

Comment by Doctrine Bot [ 16/Feb/15 ]

A related Github Pull-Request [GH-1113] was closed:
https://github.com/doctrine/doctrine2/pull/1113





[DDC-3239] [GH-1097] `expandParameters`/`getType` in BasicEntityPersister seems to really cover just few cases Created: 01/Aug/14  Updated: 24/Jan/15  Resolved: 17/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, Mapping Drivers, ORM
Affects Version/s: Git Master, 2.4.7
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: association, composite-identifier, custom-dbal-type, identifier, persister

Issue Links:
Duplicate
duplicates DDC-3380 [GH-1178] Fixing associations using U... Resolved
Reference
is referenced by DDC-3380 [GH-1178] Fixing associations using U... Resolved

 Description   

This issue is created automatically through a Github pull request on behalf of kamazee:

Url: https://github.com/doctrine/doctrine2/pull/1097

Message:

The test case below seems fairly simple, but I believe that it might uncover a bigger issue.

It seems odd that [`getType` (and, hence, `expandParameters`)](https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L1731-1795) in BasicEntityPersister clearly expects field name but often gets different things.

Just set a breakpoint there and watch values through the test suite. There might be not just field name, but a column with alias as well. This works:
![screenshot from 2014-08-01 14 03 44](https://cloud.githubusercontent.com/assets/231518/3778796/c5cc3e66-1979-11e4-9279-5c322b7e8402.png)

But this, apparently, doesn't:
![screenshot from 2014-08-01 14 07 29](https://cloud.githubusercontent.com/assets/231518/3778816/20da192c-197a-11e4-90b4-4c37ee454fb6.png)

There are multiple places (more than one) that call `expandParameters` with criteria that can't be resolved with `getType`. Is this situation expected or worth further investigation/fixing?



 Comments   
Comment by Marco Pivetta [ 17/Jan/15 ]

Handled in DDC-3380

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1097] was labeled:
https://github.com/doctrine/doctrine2/pull/1097

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1097] was labeled:
https://github.com/doctrine/doctrine2/pull/1097

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1097] was assigned:
https://github.com/doctrine/doctrine2/pull/1097

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-1097] was closed:
https://github.com/doctrine/doctrine2/pull/1097





[DDC-3062] [GH-997] [FIX] Allow to use ManyToMany with all operators Created: 31/Mar/14  Updated: 25/Mar/15  Resolved: 25/Mar/15

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

Type: Bug Priority: Critical
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Incomplete Votes: 0
Labels: collection, criteria, many-to-many, persister


 Description   

This issue is created automatically through a Github pull request on behalf of bakura10:

Url: https://github.com/doctrine/doctrine2/pull/997

Message:

Hi,

ping @guillhermoblanco : I think this may be blocking for 2.5

I introduced not so long ago support for ManyToMany for Criteria. However, I realized my implementation was really incomplete, because I hard-coded the "=" operator (https://github.com/doctrine/doctrine2/pull/885/files#diff-982b7374bbe9d5f4b6b71f4869a446eaR575). This means that it fails in a lot of cases when you use something different than "eq" for Criteria.

This PR fixes that, however it's a bit hacky. The SqlExpressionVisitor was made by type hinting for a BasicEntityPersister, preventing us from using us for a collection persister. Therefore I added a new interface to keep BC.

There is also a lot of code duplication (the whole "getSelectConditionSQL" was copied from the BasicEntityPersister), but without trait or BC, I have no idea about how to solve it.

All tests pass, test were added for other operators.



 Comments   
Comment by Doctrine Bot [ 13/Jan/15 ]

A related Github Pull-Request [GH-997] was assigned:
https://github.com/doctrine/doctrine2/pull/997

Comment by Doctrine Bot [ 13/Jan/15 ]

A related Github Pull-Request [GH-997] was unassigned:
https://github.com/doctrine/doctrine2/pull/997

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-997] was labeled:
https://github.com/doctrine/doctrine2/pull/997

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-997] was labeled:
https://github.com/doctrine/doctrine2/pull/997

Comment by Doctrine Bot [ 24/Jan/15 ]

A related Github Pull-Request [GH-997] was unlabeled:
https://github.com/doctrine/doctrine2/pull/997





[DDC-2965] Error after changing IdGenerator to AssignedGenerator when for this entity class insert has been already executed Created: 08/Feb/14  Updated: 09/Feb/14  Resolved: 09/Feb/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Piotr Śliwa Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: mapping, persister

Issue Links:
Reference
is referenced by DDC-2966 [GH-942] DDC-2965 - Changing ID gener... Resolved

 Description   

When you persist and flush entity and then change id generator to AssignedGenerator (and id generator type to NONE) for this entity class and then you persist and flush new entity with assigned id, below error will occur:

Exception: [Doctrine\DBAL\Exception\DriverException] An exception occurred while executing 'INSERT INTO cms_emails (email) VALUES ' with params [13, "example@example.com"]:

SQLSTATE[HY000]: General error: 25 bind or column index out of range

There is test that reproduces this issue:

    public function testPersistEntityAndThenSwitchToAssignedIdGenerator()
    {
        $email = new \Doctrine\Tests\Models\CMS\CmsEmail();
        $email->email = 'example5@example.com';

        $this->_em->persist($email);
        $this->_em->flush();

        $this->assertNotNull($email->id);

        $classMetadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsEmail');
        $classMetadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE);
        $classMetadata->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());

        $id = 13;

        $newEmail = new \Doctrine\Tests\Models\CMS\CmsEmail();
        $newEmail->email = 'example@example.com';
        $newEmail->id = $id;

        $this->_em->persist($newEmail);
        $this->_em->flush();
        $this->_em->clear();

        $newEmail = $this->_em->find('Doctrine\Tests\Models\CMS\CmsEmail', $id);

        $this->assertNotNull($newEmail);
    }

The problem is in BasicEntityPersister because insertSql is cached and is not cleared after changing id generator. Binded parameters count doesn't match with insert query because there is new parameter: id.



 Comments   
Comment by Marco Pivetta [ 09/Feb/14 ]

Provided a possible fix at https://github.com/doctrine/doctrine2/pull/942

Comment by Doctrine Bot [ 09/Feb/14 ]

A related Github Pull-Request [GH-942] was closed:
https://github.com/doctrine/doctrine2/pull/942

Comment by Benjamin Eberlei [ 09/Feb/14 ]

It is not a supported use case to change metadata after loading them.





[DDC-2579] BasicEntityPersister - delete bug Created: 29/Jul/13  Updated: 10/Aug/13  Resolved: 30/Jul/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3.4
Fix Version/s: 2.4, 2.3.5
Security Level: All

Type: Bug Priority: Major
Reporter: Jan Pecek Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: orm, persister
Environment:

PHP 5.4.4, PostgreSQL 9.2



 Description   

I think, in BasicEntityPersister is bug in detecting types:
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L583

The $types array is not defined inside closure function. This makes problem with deleting entity with two and more primary keys which one of them references to another entity with reference too.
My relationship (example):
User(id,name)
Person(user_id,birthdate)
Email(user_id, email) but FK (and @manyToOne relation) on user_id field references to Person table/entity, not User. FK in Person entity references to User of course.
Trying delete the Email entity record throws exception based a few lines later.



 Comments   
Comment by Fabio B. Silva [ 30/Jul/13 ]

Fixed : https://github.com/doctrine/doctrine2/commit/7055ccbf9bc9bd72b184734bcbeb72e682bf642b

Comment by Jan Pecek [ 30/Jul/13 ]

I agree with fix. I've done the same at my local repo and it works well. Thanks for confirmation.





[DDC-2089] Modify OneToMany to allow unidirectional associations without the need of a JoinTable Created: 19/Oct/12  Updated: 13/Oct/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.x
Fix Version/s: 3.0
Security Level: All

Type: Improvement Priority: Major
Reporter: Enea Bette Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 2
Labels: onetomany, persister, unidirectional
Environment:

Debian Wheezy, Mysql 5.1, Apache2, PHP 5.4



 Description   

As I sayd in the title, it would be nice if the ORM layer could permit to map a 1:n association in the db as an unidirectional OneToMany in the classes, without using a JoinTable in the database.
This would permit us to get rid of the unnecessary database JoinTable, which creates disorder and decreases performance for no valuable reason.

Is it possible?



 Comments   
Comment by Enea Bette [ 16/Dec/12 ]

A little up... for inspiration from JPA

http://en.wikibooks.org/wiki/Java_Persistence/OneToMany#Undirectional_OneToMany.2C_No_Inverse_ManyToOne.2C_No_Join_Table_.28JPA_2.0_ONLY.29

Comment by Daniel Pitts [ 07/Oct/14 ]

This is also a big issue for Symfony2 forms. It's very difficult to make a form type for a collection of "things", where the "things" are fully owned by the parent object.





Generated at Thu Apr 02 01:39:50 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.