[DDC-2392] [GH-644] Fixed typos Created: 06/Apr/13  Updated: 20/Aug/14  Resolved: 06/Apr/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 20/Aug/14 ]

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

Comment by Doctrine Bot [ 20/Aug/14 ]

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





[DDC-2693] Attribute/association overrides should be ignored when generating entities Created: 19/Sep/13  Updated: 19/Aug/14

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

Type: Bug Priority: Minor
Reporter: Joris van de Sande Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 4
Labels: command

Issue Links:
Duplicate
is duplicated by DDC-3109 [Doctrine\ORM\Mapping\MappingExceptio... Open

 Description   

The "orm:generate-entities" command fails when doctrine attribute and/or association overrides are used. So from the moment that you use an attribute/association override, it is implossible to use the generate entities command. I think that the solution to this problem is to ignore the overrides when generating entities.

The exception given in case of an attribute override is (this is executed within a Symfony2 project doctrine:generate:entities):

Generating entity "My\AppBundle\Entity\Job"

  [Doctrine\ORM\Mapping\MappingException]
  Invalid field override named 'value' for class 'My\AppBundle\Entity\Job'.

Exception trace:
 () at /path/to/project/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:89
 Doctrine\ORM\Mapping\MappingException::invalidOverrideFieldName() at /path/to/project/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1922
 Doctrine\ORM\Mapping\ClassMetadataInfo->setAttributeOverride() at /path/to/project/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php:564
 Doctrine\ORM\Mapping\Driver\YamlDriver->loadMetadataForClass() at /path/to/project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php:104
 Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain->loadMetadataForClass() at /path/to/project/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:113
 Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadMetadata() at /path/to/project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:302
 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata() at /path/to/project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:212
 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor() at /path/to/project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:112
 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getAllMetadata() at /path/to/project/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/MetadataFactory.php:196
 Doctrine\Bundle\DoctrineBundle\Mapping\MetadataFactory->getAllMetadata() at /path/to/project/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/MetadataFactory.php:176
 Doctrine\Bundle\DoctrineBundle\Mapping\MetadataFactory->getMetadataForClass() at /path/to/project/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/MetadataFactory.php:76
 Doctrine\Bundle\DoctrineBundle\Mapping\MetadataFactory->getClassMetadata() at /path/to/project/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php:106
 Doctrine\Bundle\DoctrineBundle\Command\GenerateEntitiesDoctrineCommand->execute() at /path/to/project/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:242
 Symfony\Component\Console\Command\Command->run() at /path/to/project/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:200
 Symfony\Component\Console\Application->doRun() at /path/to/project/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:83
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /path/to/project/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:106
 Symfony\Component\Console\Application->run() at /path/to/project/app/console:19


 Comments   
Comment by Rein Baarsma [ 27/Feb/14 ]

I have the same issue and it's easy to reproduce with a clean Symfony 2 setup with FOSUserBundle.
Once you add

 * @ORM\AttributeOverrides({
 *      @ORM\AttributeOverride(name="usernameCanonical",
 *          column=@ORM\Column(
 *              name     = "username_canonical",
 *              type     = "string",
 *              length   = 255,
 *              unique   = false
 *          )
 *      )
 * })

It will properly do doc:schema:update --force
But it will fail on doc:gen:entities (YourEntity)

Comment by Andy Waterman [ 13/Aug/14 ]

Not sure I agree this is minor - might not affect many users, but it's pretty blocking if you do run into it. Any ideas on a fix?

Comment by Marco Pivetta [ 13/Aug/14 ]

Andy Waterman you are supposed to manually edit generated entities anyway

Comment by Andy Waterman [ 19/Aug/14 ]

" you are supposed to manually edit generated entities anyway"

This applies to creating new entities as well as adapting old ones. Ie. Once you use an AttributeOverride anywhere in your project, you then cannot use generate:entities anywhere else.

Comment by Marco Pivetta [ 19/Aug/14 ]

Andy Waterman yes, and you are supposed to avoid the generator after the first run.





[DDC-3259] Second level & UnitOfWork inconsistencies Created: 19/Aug/14  Updated: 19/Aug/14

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

Type: Improvement Priority: Major
Reporter: Asmir Mustafic Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: second-level-cache


 Description   

Hi!

I have a lot of entities with entity associations as keys and I'm trying to use second level cache.

Looking at the method: UnitOfWork::createEntity($className, array $data, &$hints = array())

  • $className: contains the class name
  • $data: contains the raw data (the row coming from the database)

Enabling the second level cache, DefaultQueryCache::get calls the createEntity method passing a $data that contains object entities and some raw data (https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Cache/DefaultQueryCache.php#L155).

I think that DefaultQueryCache should not introduce a variant of $data and should create a compatible version of $data.



 Comments   
Comment by Marco Pivetta [ 19/Aug/14 ]

Asmir Mustafic do you have any example of where this may be happening?

Comment by Asmir Mustafic [ 19/Aug/14 ]

https://github.com/doctrine/doctrine2/pull/1114

This is the same branch of https://github.com/doctrine/doctrine2/pull/1113, plus this commit (https://github.com/goetas/doctrine2/commit/bfbbb9123fd28f7fa053b76895eaa77e00095aa6) that simply involves the second level cache too.
Travis should fail soon.

Comment by Doctrine Bot [ 19/Aug/14 ]

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

Comment by Asmir Mustafic [ 19/Aug/14 ]

Here the failure https://travis-ci.org/doctrine/doctrine2/jobs/32972996#L402





[DDC-2901] entity-listeners are not propagated to children of mapped superclasses Created: 09/Jan/14  Updated: 19/Aug/14

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

Type: Bug Priority: Major
Reporter: Stuart Carnie Assignee: Fabio B. Silva
Resolution: Unresolved Votes: 0
Labels: mapping


 Description   

If I have event-listeners set on the subclass and mapped superclass, event-listeners will not be propagated, per this code. Conversely, lifecycle events are, per this



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

Stuart Carnie I lost the code references that you linked, since the code changed and the line numbers don't match anymore.

Any chance that you can provide a failing test for this issue, as well as update the links to reference a fixed commit hash or tag?

Comment by Stuart Carnie [ 19/Aug/14 ]

Marco Pivetta, I've updated the URIs in the description to the right tree

Comment by Marco Pivetta [ 19/Aug/14 ]

The code explicitly forbids inheriting listeners when the child class does not have any.

Fabio B. Silva can you provide any insight on why this decision was made?





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

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by DDC-3260 [GH-1114] Composite pk break test 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?






[DDC-3260] [GH-1114] Composite pk break test Created: 19/Aug/14  Updated: 19/Aug/14  Resolved: 19/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates DDC-3258 [GH-1113] Added support for composite... Open

 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 19/Aug/14 ]

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





[DDC-2439] [GH-662] Fixed a code block. Created: 09/May/13  Updated: 19/Aug/14  Resolved: 09/May/13

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

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


 Description   

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

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

Message:

Last code block in the [Keeping your Modules independent](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/resolve-target-entity-listener.html) cookbook is broken.

Sphinx does not like the way code was indented. Building the documentation raises the following error:

en/cookbook/resolve-target-entity-listener.rst:121: ERROR: Unexpected indentation.



 Comments   
Comment by Doctrine Bot [ 09/May/13 ]

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

Comment by Doctrine Bot [ 19/Aug/14 ]

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

Comment by Doctrine Bot [ 19/Aug/14 ]

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





[DDC-1624] Locking CTI doesnt work on SQL Server Created: 29/Jan/12  Updated: 19/Aug/14  Resolved: 19/Aug/14

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Duplicate
is duplicated by DBAL-559 SQL Server Platform error on LOCK MOD... Resolved

 Description   

The WITH Keyowrd is appended to the whole FROM .. JOIN .. block instead of behind the FROM block.



 Comments   
Comment by William Schaller [ 03/Oct/13 ]

Is there a better workaround for this issue than this?

diff --git a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
index c9af278..2f192ea 100644
--- a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+++ b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
@@ -1020,7 +1020,7 @@ class SQLServerPlatform extends AbstractPlatform
                 $lockClause = '';
         }
 
-        return $fromClause . $lockClause;
+        return $fromClause;// . $lockClause;
     }
 
     /**

I've just been keeping my own fork of DBAL to work around this bug, but it would be nice if it was fixed. Bad thing is that I see no convenient or non-obfuscated way of doing it, so I don't feel comfortable submitting a patch.

This is pretty severe, as it completely breaks select queries against entities with inheritance.

Comment by William Schaller [ 19/Aug/14 ]

I think this is fixed in 2.4...

Comment by Marco Pivetta [ 19/Aug/14 ]

Already solved in 2.4 indeed.





[DDC-2331] [GH-600] [PreUpdateEventArgs] Allows to add a new value on the entity changeset Created: 05/Mar/13  Updated: 19/Aug/14  Resolved: 05/Mar/13

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

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


 Description   

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

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

Message:

Hey!

I propose to add a `addNewValue` method on the `PreUpdateEventArgs`. This method allows to add a new value on the entity changeset when the entity changeset does not wrap the field.

In one of my app, I need to update a field if an entity is updated but the field is not updated at the beginning.



 Comments   
Comment by Benjamin Eberlei [ 05/Mar/13 ]

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

Comment by Doctrine Bot [ 16/May/14 ]

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

Comment by Doctrine Bot [ 02/Aug/14 ]

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

Comment by Doctrine Bot [ 19/Aug/14 ]

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





[DDC-3117] [GH-1027] Support for Partial Indexes for PostgreSql and Sqlite Created: 07/May/14  Updated: 19/Aug/14

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: mapping, postgresql, sqlite

Issue Links:
Dependency
depends on DBAL-900 [GH-600] Support for Partial Indexes ... Resolved

 Description   

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

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

Message:

Support for Partial Indexes was available in Doctrine 1 following
http://www.doctrine-project.org/jira/browse/DC-82. This commit
reintroduce support for Doctrine 2. We use the same syntax with an
optionnal "where" attribute for Index and UniqueConstraint.

It is unit-tests covered and documented in manual. This Pull Request depends on https://github.com/doctrine/dbal/pull/600. So they should both be merged or rejected together.

Thanks for your time !



 Comments   
Comment by Adrien Crivelli [ 07/May/14 ]

This patch depends on DBAL-900. So they should both be merged or rejected together.

Comment by Doctrine Bot [ 16/May/14 ]

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

Comment by Doctrine Bot [ 02/Aug/14 ]

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

Comment by Doctrine Bot [ 19/Aug/14 ]

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





[DDC-2695] Order by clause left in subquery when using MSSQL and Paginator Created: 20/Sep/13  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Paul Mansell Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows, Microsoft SQL Server



 Description   

When using the Doctrine paginator and Fetch Join Collections = true and when the original query has an "ORDER BY" clause in it - the subquery created is something like "SELECT DISTINCT FROM (.... ORDER BY ....) as dctrn_result" - when using Microsoft SQL server having the "ORDER BY" clause in a subquery throws an error. This is a similar problem to http://doctrine-project.org/jira/browse/DDC-2282 but that was for the Count Walker - this is for the LimitSubqueryOutputWalker. The fix is the same.



 Comments   
Comment by Paul Mansell [ 20/Sep/13 ]

Problem still occurs in 2.4 - but different error message,

Query :

SELECT * FROM (SELECT DISTINCT id0, ROW_NUMBER() OVER (ORDER BY c1_.iccid ASC) AS doctrine_rownum FROM (SELECT w0_.id AS id0, w0_.batch_id AS batch_id1, c1_.id AS id2, c1_.iccid AS iccid3, c2_.id AS id4, c2_.msisdn AS msisdn5, c3_.id AS id6, c3_.name AS name7, c4_.id AS id8, c5_.id AS id9, c5_.name AS name10, w6_.id AS id11, w6_.created AS created12, w7_.id AS id13, w7_.ident AS ident14, w8_.id AS id15, w8_.ident AS ident16, c9_.id AS id17, c10_.id AS id18, c10_.contract_length AS contract_length19, c10_.rental AS rental20, w11_.id AS id21, w11_.ident AS ident22 FROM workflow_request w0_ WITH (NOLOCK) INNER JOIN core_sim c1_ ON w0_.sim = c1_.id LEFT JOIN core_connection c2_ ON c1_.active_connection_id = c2_.id INNER JOIN core_billing_account c3_ ON c1_.billing_account_id = c3_.id INNER JOIN core_mno_account c4_ ON c1_.mno_account_id = c4_.id INNER JOIN core_mno c5_ ON c4_.mno_id = c5_.id INNER JOIN workflow_request_log w6_ ON w0_.id = w6_.request INNER JOIN workflow_action w7_ ON w0_.action = w7_.id INNER JOIN workflow_request_status w8_ ON w0_.status = w8_.id INNER JOIN core_customer_solution c9_ ON w0_.customer_solution = c9_.id INNER JOIN core_customer_tariff c10_ ON c9_.customer_tariff_id = c10_.id INNER JOIN workflow_request_action w11_ ON w6_.request_action = w11_.id WHERE w7_.ident IN (?) AND w8_.ident = ? AND w11_.ident = ?) dctrn_result) AS doctrine_tbl WHERE doctrine_rownum BETWEEN 1 AND 25' with params ["activate", "network", "approved"]

Error :

SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]The multi-part identifier "c1_.iccid" could not be bound.





[DDC-2701] Collections in originalEntityData gets over written Created: 23/Sep/13  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Thomas Klein Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I was trying to use the UnitOfWork::getOriginalEntityData method and i noticed that if there is a collection in that object, it changes in the uow original datas when i change it on my original object

In my case the collection is ManyToMany unidirectional

I think this happens because both the uow and the object work with the same reference to the collection
maybe adding a clone of the collection instead of the real one, i don't know if it is possible

Thank you for taking a look and for Doctrine!

Tom



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

This issue needs a test case in order to be reproduced.





[DDC-2689] Doctrine ORM test suite failing on MySQL Created: 19/Sep/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Flip Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 7 Professional 64 bits
PHP 5.4.11 (cli) (built: Jan 16 2013 20:26:26)
Doctrine dev-master from 18-9-2013
mysql-5.6.13-winx64
Commit for doctrine/common d9dea98243c733ff589aab10e321de4f14a63ab4


Issue Links:
Duplicate
is duplicated by DDC-2690 Doctrine ORM test suite failing on Po... Resolved

 Description   

This issue is related to http://www.doctrine-project.org/jira/browse/DDC-2690

PHPUnit 3.7.27 by Sebastian Bergmann.

Configuration read from C:\inetpub\symfony23\vendor\doctrine\orm\mysql.phpunit.xml

......................SSSSSS.................................   61 / 2074 (  2%)
.............................................................  122 / 2074 (  5%)
.....................................................S.......  183 / 2074 (  8%)
.............................................................  244 / 2074 ( 11%)
.............................................................  305 / 2074 ( 14%)
.............................................................  366 / 2074 ( 17%)
.............................................................  427 / 2074 ( 20%)
............................................SE...............  488 / 2074 ( 23%)
.............................................................  549 / 2074 ( 26%)
.............................................................  610 / 2074 ( 29%)
......SSSSSS.............S..............................S...S  671 / 2074 ( 32%)
...........S..............................S................E.  732 / 2074 ( 35%)
...........................S.................................  793 / 2074 ( 38%)
.............................................................  854 / 2074 ( 41%)
.....S..SS...................................................  915 / 2074 ( 44%)
.............................................................  976 / 2074 ( 47%)
............................................................. 1037 / 2074 ( 50%)
............................................................. 1098 / 2074 ( 52%)
............................................................. 1159 / 2074 ( 55%)
.................................................S........... 1220 / 2074 ( 58%)
..................................S.......................... 1281 / 2074 ( 61%)
............................................................. 1342 / 2074 ( 64%)
............................................................. 1403 / 2074 ( 67%)
............................................................. 1464 / 2074 ( 70%)
............................................................. 1525 / 2074 ( 73%)
............................................................. 1586 / 2074 ( 76%)
............................................................. 1647 / 2074 ( 79%)
............................................................. 1708 / 2074 ( 82%)
............................................................. 1769 / 2074 ( 85%)
............................................................. 1830 / 2074 ( 88%)
............................................................. 1891 / 2074 ( 91%)
...................................................S......... 1952 / 2074 ( 94%)
....S...............................S........................ 2013 / 2074 ( 97%)
..................................

Time: 39.42 seconds, Memory: 79.50Mb

There were 2 errors:

1) Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest::testPersistUpdate
Exception: [Doctrine\Common\Proxy\Exception\OutOfBoundsException] Missing value for primary key id on Doctrine\Tests\Models\CMS\CmsUser

With queries:
5. SQL: '"COMMIT"' Params: 
4. SQL: 'INSERT INTO cms_users (status, username, name, email_id) VALUES (?, ?, ?, ?)' Params: '', 'ocramius', 'Marco', ''
3. SQL: '"START TRANSACTION"' Params: 
2. SQL: 'CREATE TABLE cms_users (id INT AUTO_INCREMENT NOT NULL, email_id INT DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_3AF03EC5F85E0677 (username), UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB' Params: 

Trace:
C:\inetpub\symfony23\vendor\doctrine\common\lib\Doctrine\Common\Proxy\AbstractProxyFactory.php:125
C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest.php:51
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:983
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:838
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestResult.php:648
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:783
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:775
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:745
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:705
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\TestRunner.php:349
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:176
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:129
C:\inetpub\symfony23\vendor\phpunit\phpunit\phpunit.php:46


C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\OrmFunctionalTestCase.php:477
C:\inetpub\symfony23\vendor\doctrine\common\lib\Doctrine\Common\Proxy\AbstractProxyFactory.php:125
C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest.php:51

Caused by
Doctrine\Common\Proxy\Exception\OutOfBoundsException: Missing value for primary key id on Doctrine\Tests\Models\CMS\CmsUser

C:\inetpub\symfony23\vendor\doctrine\common\lib\Doctrine\Common\Proxy\Exception\OutOfBoundsException.php:41
C:\inetpub\symfony23\vendor\doctrine\common\lib\Doctrine\Common\Proxy\AbstractProxyFactory.php:125
C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest.php:51

2) Doctrine\Tests\ORM\Functional\Ticket\DDC1514Test::testIssue
Exception: [PHPUnit_Framework_Error_Notice] Trying to get property of non-object

With queries:
14. SQL: '"COMMIT"' Params: 
13. SQL: 'INSERT INTO DDC1514EntityB (entityAFrom_id, entityATo_id) VALUES (?, ?)' Params: '2', '1'
12. SQL: 'INSERT INTO DDC1514EntityB (entityAFrom_id, entityATo_id) VALUES (?, ?)' Params: '1', '2'
11. SQL: 'INSERT INTO DDC1514EntityA (title, entityC_id) VALUES (?, ?)' Params: 'bar', '1'
10. SQL: 'INSERT INTO DDC1514EntityA (title, entityC_id) VALUES (?, ?)' Params: 'foo', ''
9. SQL: 'INSERT INTO DDC1514EntityC (title) VALUES (?)' Params: 'baz'
8. SQL: '"START TRANSACTION"' Params: 
7. SQL: 'ALTER TABLE DDC1514EntityB ADD CONSTRAINT FK_B7F2235B64DC3373 FOREIGN KEY (entityATo_id) REFERENCES DDC1514EntityA (id)' Params: 
6. SQL: 'ALTER TABLE DDC1514EntityB ADD CONSTRAINT FK_B7F2235B4D8FF1AD FOREIGN KEY (entityAFrom_id) REFERENCES DDC1514EntityA (id)' Params: 
5. SQL: 'ALTER TABLE DDC1514EntityA ADD CONSTRAINT FK_2EFB72E12014DB0 FOREIGN KEY (entityC_id) REFERENCES DDC1514EntityC (id)' Params: 
4. SQL: 'CREATE TABLE DDC1514EntityC (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB' Params: 
3. SQL: 'CREATE TABLE DDC1514EntityB (id INT AUTO_INCREMENT NOT NULL, entityAFrom_id INT DEFAULT NULL, entityATo_id INT DEFAULT NULL, INDEX IDX_B7F2235B4D8FF1AD (entityAFrom_id), INDEX IDX_B7F2235B64DC3373 (entityATo_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB' Params: 
2. SQL: 'CREATE TABLE DDC1514EntityA (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, entityC_id INT DEFAULT NULL, INDEX IDX_2EFB72E12014DB0 (entityC_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB' Params: 

Trace:
C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\Ticket\DDC1514Test.php:60
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:983
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:838
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestResult.php:648
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:783
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:775
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:745
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:705
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\TestRunner.php:349
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:176
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:129
C:\inetpub\symfony23\vendor\phpunit\phpunit\phpunit.php:46


C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\OrmFunctionalTestCase.php:477
C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\Ticket\DDC1514Test.php:60

Caused by
Trying to get property of non-object

C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\Ticket\DDC1514Test.php:60

FAILURES!
Tests: 2047, Assertions: 7035, Errors: 2, Skipped: 28.



 Comments   
Comment by Flip [ 30/Sep/13 ]

First error is the same as this one: http://www.doctrine-project.org/jira/browse/DDC-2690#comment-21186

Second error has a bugfix here: https://github.com/doctrine/doctrine2/pull/805

Comment by Marco Pivetta [ 18/Aug/14 ]

This was fixed in master





[DDC-2690] Doctrine ORM test suite failing on PostgresSQL Created: 19/Sep/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Flip Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 7 Professional 64 bits
PHP 5.4.11 (cli) (built: Jan 16 2013 20:26:26)
Doctrine dev-master from 18-9-2013
PostgreSQL 9.2.4 build 1600, 64-bits
Commit for doctrine/common d9dea98243c733ff589aab10e321de4f14a63ab4


Issue Links:
Duplicate
duplicates DDC-2689 Doctrine ORM test suite failing on MySQL Resolved

 Description   

This issue is related to: http://www.doctrine-project.org/jira/browse/DDC-2689

PHPUnit 3.7.27 by Sebastian Bergmann.

Configuration read from C:\inetpub\symfony23\vendor\doctrine\orm\postgres.phpunit.xml

......................SSSSSS.................................   61 / 2074 (  2%)
.............................................................  122 / 2074 (  5%)
.....................................................S.......  183 / 2074 (  8%)
.............................................................  244 / 2074 ( 11%)
.............................................................  305 / 2074 ( 14%)
.............................................................  366 / 2074 ( 17%)
.............................................................  427 / 2074 ( 20%)
.............................................E...............  488 / 2074 ( 23%)
.............................................................  549 / 2074 ( 26%)
.............................................................  610 / 2074 ( 29%)
..SSSS..................................................S....  671 / 2074 ( 32%)
.............................................................  732 / 2074 ( 35%)
...........................S................................S  793 / 2074 ( 38%)
.............................................................  854 / 2074 ( 41%)
.....S..SS.................................S.................  915 / 2074 ( 44%)
.............................................................  976 / 2074 ( 47%)
............................................................. 1037 / 2074 ( 50%)
............................................................. 1098 / 2074 ( 52%)
............................................................. 1159 / 2074 ( 55%)
.................................................S........... 1220 / 2074 ( 58%)
..................................S.......................... 1281 / 2074 ( 61%)
............................................................. 1342 / 2074 ( 64%)
............................................................. 1403 / 2074 ( 67%)
............................................................. 1464 / 2074 ( 70%)
............................................................. 1525 / 2074 ( 73%)
............................................................. 1586 / 2074 ( 76%)
............................................................. 1647 / 2074 ( 79%)
............................................................. 1708 / 2074 ( 82%)
............................................................. 1769 / 2074 ( 85%)
............................................................. 1830 / 2074 ( 88%)
............................................................. 1891 / 2074 ( 91%)
...................................................S......... 1952 / 2074 ( 94%)
....S...............................S........................ 2013 / 2074 ( 97%)
..................................

Time: 42.33 seconds, Memory: 83.50Mb

There was 1 error:

1) Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest::testPersistUpdate
Exception: [Doctrine\Common\Proxy\Exception\OutOfBoundsException] Missing value for primary key id on Doctrine\Tests\Models\CMS\CmsUser

With queries:
7. SQL: '"COMMIT"' Params: 
6. SQL: 'INSERT INTO cms_users (id, status, username, name, email_id) VALUES (?, ?, ?, ?, ?)' Params: '385', '', 'ocramius', 'Marco', ''
5. SQL: '"START TRANSACTION"' Params: 
4. SQL: 'SELECT NEXTVAL('cms_users_id_seq')' Params: 
3. SQL: 'CREATE TABLE cms_users (id INT NOT NULL, email_id INT DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))' Params: 
2. SQL: 'SHOW search_path' Params: 

Trace:
C:\inetpub\symfony23\vendor\doctrine\common\lib\Doctrine\Common\Proxy\AbstractProxyFactory.php:125
C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest.php:51
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:983
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:838
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestResult.php:648
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:783
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:775
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:745
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:705
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\TestRunner.php:349
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:176
C:\inetpub\symfony23\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:129
C:\inetpub\symfony23\vendor\phpunit\phpunit\phpunit.php:46


C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\OrmFunctionalTestCase.php:477
C:\inetpub\symfony23\vendor\doctrine\common\lib\Doctrine\Common\Proxy\AbstractProxyFactory.php:125
C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest.php:51

Caused by
Doctrine\Common\Proxy\Exception\OutOfBoundsException: Missing value for primary key id on Doctrine\Tests\Models\CMS\CmsUser

C:\inetpub\symfony23\vendor\doctrine\common\lib\Doctrine\Common\Proxy\Exception\OutOfBoundsException.php:41
C:\inetpub\symfony23\vendor\doctrine\common\lib\Doctrine\Common\Proxy\AbstractProxyFactory.php:125
C:\inetpub\symfony23\vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest.php:51

FAILURES!
Tests: 2047, Assertions: 7055, Errors: 1, Skipped: 23.



 Comments   
Comment by Flip [ 30/Sep/13 ]

How can this possibly pass on the travis-ci builds ?? Maybe this is an indication that something is wrong with the travis setup.

This is the setup/input: https://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php#L51

This is where execution fails: https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php#L125

Comment by Flip [ 01/Oct/13 ]

This is a related PR https://github.com/doctrine/common/pull/298





[DDC-2751] [GH-823] Elaborate description of the classIsNotAValidEntityOrMappedSuperClass ex... Created: 20/Oct/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

...ception



 Comments   
Comment by Doctrine Bot [ 02/Jan/14 ]

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





[DDC-2771] [GH-834] Add example use of repositoryClass in YAML Created: 01/Nov/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 04/Nov/13 ]

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





[DDC-2797] [GH-848] eliminate duplicate placeholders in "walkComparison" function within Que... Created: 18/Nov/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Incomplete Votes: 0
Labels: None


 Description   

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

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

Message:

...ryExpressionVisitor

I've run into an issue when using Criteria with QueryBuilder when Criteria uses multiple checks on same variable in different context, example:
field1 = value OR (field1 in values AND field2 = true)... what happens is field 1 placeholder is duplicated, and an error occures in code complaining about invalid # of parameters. The fix eliminates this issue, making sure parametername is unique.

I have not had time to check any other possible issues this may cause, but a review of the code doesn't appear to impact any other function.



 Comments   
Comment by Doctrine Bot [ 18/Nov/13 ]

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





[DDC-2799] [GH-850] Event listener to programmatically attach entity listeners. Created: 18/Nov/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

This patch adds a event listener to programmatically attach entity listeners.

Especially useful to attach listeners to external bundles/modules..



 Comments   
Comment by Doctrine Bot [ 25/Nov/13 ]

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





[DDC-2811] [GH-854] fix relative path to doctrine/common Created: 22/Nov/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Steve Müller
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

While testing your framework on HHVM I found this test doesn't pass because the path doesn't find what composer was installing into



 Comments   
Comment by Doctrine Bot [ 23/Nov/13 ]

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





[DDC-2809] [GH-853] Fix for PHP entity default values generated by EntityGenerator Created: 21/Nov/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

When specifying a default value for a column in the YAML, this value should be set in the entities that are generated by the EntityGenerator. The EntityGenerator looked for the default value in the wrong place of the field mapping and therefore defaults were never set. This issue has been fixed in this branch.



 Comments   
Comment by Doctrine Bot [ 21/Nov/13 ]

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





[DDC-2813] [GH-857] free more resources Created: 22/Nov/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

use unset to free resources better



 Comments   
Comment by Doctrine Bot [ 23/Nov/13 ]

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





[DDC-2819] [GH-860] Mention SQL Anywhere in basic mapping documentation Created: 25/Nov/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Just for documentation completion of the new SQL Anywhere platform.



 Comments   
Comment by Doctrine Bot [ 25/Nov/13 ]

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





[DDC-2834] [GH-868] Added documentation section for Memcached Created: 02/Dec/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

The documentation only talked about Memcache, an old PHP extension that can now be safely replaced by Memcached.

I've add a section of documentation about Memcached because the code to have it working is not the same.



 Comments   
Comment by Doctrine Bot [ 02/Dec/13 ]

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





[DDC-2838] Leaky abstraction when applying Criteria to hydrated/non-hydrated PersistentCollection Created: 03/Dec/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: brian ridley Assignee: Marco Pivetta
Resolution: Incomplete Votes: 0
Labels: None


 Description   

When applying a Criteria to a PersistentCollection that has been hydrated the field names must be camel case, if the collection has not yet been hydrated the field names must be underscore separated.

The github repo linked here contains a simplified testcase for the matrix of hydrated/non-hydrated entities and camel case/underscore separated fields.

https://github.com/ptlis/DoctrineTestcase



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

We can't check out an entire project just to test a bug.

Please write an actual functional test case that can be integrated into the Doctrine ORM test suite.





[DDC-2835] No Lock Hint on Joins Created: 03/Dec/13  Updated: 18/Aug/14

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

Type: Improvement Priority: Major
Reporter: Paul Mansell Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Microsoft SQL Server 2008/2012



 Description   

There seems to be no lock hits added to the joins on a query. For example, take the following query :

SELECT w0_.name AS name0, w1_.name AS name1, c2_.name AS name2, count(w3_.id) AS sclr3 FROM workflow_request w3_ WITH (NOLOCK) INNER JOIN workflow_request_status w1_ ON w3_.status_id = w1_.id INNER JOIN workflow_action w0_ ON w3_.action_id = w0_.id LEFT JOIN workflow_transition w4_ ON w3_.transition_id = w4_.id INNER JOIN core_mno_account c5_ ON w4_.mno_account_id = c5_.id INNER JOIN core_mno c2_ ON c5_.mno_id = c2_.id LEFT JOIN workflow_state w6_ ON w3_.current_state_id = w6_.id WHERE w1_.ident IN (?) GROUP BY w0_.name, w1_.name, c2_.name ORDER BY w0_.name ASC, w1_.name ASC, c2_.name ASC [["waiting"]]

the with(nolock) is only added to the FROM clause .... it should be added after each join too






[DDC-2839] [GH-869] Detach objects in original object data Created: 04/Dec/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

The PR makes Doctrine ORM update the database when you execute something like this:

```php
// MyEntity.php

/**

  • @Entity
    */
    class MyEntity
    {
    // ...

/**

  • @Column(type="datetime")
    */
    private $created;

// ...

public function setCreated(\DateTime $created)

{ $this->created = $created; }

public function getCreated()

{ return $this->created; }

// ...
}
```

```php
// Current problem

$entity = $entityManager->find('MyEntity', 1);

$entity->getCreated()->setDate('2001-01-01');

$entityManager->persist($entity);

$entityManager->flush();

// At this point no changes have been made to the database!
```

The reason this doesn't work currently is because the array of original data stored in the UnitOfWork contains the actual DateTime object which is in the entity. When you update the object in the entity the original data is updated also so the entity are the original value are still equal and therefore the object is not seen as changed.

I have chosen to clone all objects rather than just DateTime object include more types are included in the future.



 Comments   
Comment by Doctrine Bot [ 05/Dec/13 ]

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





[DDC-2131] Fetch join not working on class table inheritance Created: 07/Nov/12  Updated: 18/Aug/14  Resolved: 12/Nov/12

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

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

Issue Links:
Duplicate
duplicates DDC-1256 Generated SQL error with DQL WITH and... Resolved
Reference
is referenced by DDC-2869 [GH-886] [DDC-1256] Fix applying ON/W... Resolved

 Description   

I have an entity Appointment, that is associated with application forms.
I have an abstract class AbstractApplicationForm that has multiple (6) child classes.

The mapping info for the abstract application form looks like this:

AbstractApplicationForm.php
/**
 * @ORM\Entity()
 * @ORM\Table("applicationform")
 * @ORM\InheritanceType("JOINED")
 * @ORM\DiscriminatorColumn(name="discr", type="string")
 * @ORM\DiscriminatorMap({
 *     "slc" = "SlcApplicationForm",
 *     "vsdb" = "VsdbApplicationForm",
 *     "vss" = "VssApplicationForm",
 *     "opzd" = "OpzdApplicationForm",
 *     "vzu" = "VzuApplicationForm",
 *     "opzdvzu" = "OpzdVzuApplicationForm"
 * })
 */
abstract class AbstractApplicationForm
...

I have an OneToMany connection from Appointment to AbstractApplicationForm.
When i construct an DQL, to get an appointment with only specific application forms it gets wrong translated into SQL.

For instance if the query builder looks like this:

$qb->select('ap, af')
   ->from(Appointment::getClass(), 'ap')
   ->leftJoin('ap.applicationForms', 'af', 'WITH', 'af.id = 123456789')
   ->andWhere('ap.id = :appointment')
   ->setParameter('appointment', $appointment);

So with this dql i should get an appointment with filtered application forms. In this case it whould return an appointment with only one application form (that with the id 123456789).
But it returns all associated application form instead on only that with the id 123456789, because it ignores the with clause.

Here is the SQL that gets generated from the DQL:

SELECT ...
FROM program_execution_activity_appointment p8_, program_execution_activity_appointment p0_
LEFT JOIN applicationform a1_ ON p0_.id = a1_.appointment_id 
LEFT JOIN applicationform_slc a2_ ON a1_.id = a2_.id 
LEFT JOIN applicationform_vsdb a3_ ON a1_.id = a3_.id 
LEFT JOIN applicationform_vss a4_ ON a1_.id = a4_.id 
LEFT JOIN applicationform_opzd a5_ ON a1_.id = a5_.id 
LEFT JOIN applicationform_vzu a6_ ON a1_.id = a6_.id 
LEFT JOIN applicationform_opzdvzu a7_ ON a1_.id = a7_.id AND (a1_.id = 123456789) 
WHERE p0_.id = 1

The problem i see here is that the AND is added to the last join (applicationform_opzdvzu). But it should added to the first join (applicationform). Because the first join represents the parent entity (AbstractApplicationForm).
There is also a problem in the FROM clause. The problem is that program_execution_activity_appointment p8_ is never used anywhere else, except in the from clause.

The generated query should look like this:

SELECT ...
FROM program_execution_activity_appointment p0_
LEFT JOIN applicationform a1_ ON p0_.id = a1_.appointment_id AND (a1_.id = 123456789) 
LEFT JOIN applicationform_slc a2_ ON a1_.id = a2_.id
LEFT JOIN applicationform_vsdb a3_ ON a1_.id = a3_.id
LEFT JOIN applicationform_vss a4_ ON a1_.id = a4_.id
LEFT JOIN applicationform_opzd a5_ ON a1_.id = a5_.id
LEFT JOIN applicationform_vzu a6_ ON a1_.id = a6_.id
LEFT JOIN applicationform_opzdvzu a7_ ON a1_.id = a7_.id
WHERE p0_.id = 1

This sql works as expected.

I hope i was clear enough what the problem is.



 Comments   
Comment by Benjamin Eberlei [ 12/Nov/12 ]

This is a duplicate of DDC-1256

Comment by Benjamin Eberlei [ 12/Nov/12 ]

This is not easy to fix as you can see DDC-1256 is open for a while. However in your case there is an easy solution, why not fetch the appointment form by id, and then go the association to the appointment? This is the inverse operation on that relation, but suits your needs perfectly.

Comment by gseric [ 29/May/13 ]

Benjamin, this issue is duplicate of duplicate (according to your status changes). So original issues is DDC-349, but this error was introduced in 2.3. DDC-349 was created way back in 2010 so it can't be the same problem.

As far as I can tell, the problem was introduced with "Arbitrary join support" feature:
https://github.com/doctrine/doctrine2/pull/368 (SqlWalker.php changes)
Basically, in version 2.3 and later WITH statement is wrongly handled after SqlWalker::_generateClassTableInheritanceJoins()
Before 2.3 it was handled before.

You can see it clearly in this issue's description:
should be (< 2.3):
LEFT JOIN <CTI parent entity> ON <auto condition> AND <my custom WITH part> <CTI child left joins>
but we get (>= 2.3):
LEFT JOIN <CTI parent entity> ON <auto condition> <CTI child left joins> AND <my custom WITH part>

This issue can't be easily avoided in situation where you want to SELECT only one child row per parent row (based on some condition). WITH is natural and fastest option.

Comment by gseric [ 01/Jul/13 ]

This bug seems to be recognized and fixed (pull request ATM) in DDC-2506

Comment by Doctrine Bot [ 13/Aug/13 ]

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

Comment by Artur Eshenbrener [ 22/Dec/13 ]

Why do you think that applying ON/WITH conditions only to base table is good? What if I will reference to fields from child entity in ON/WITH clause?
I think that all user conditions should be applied to last join in class table inheritance joins, because only in that join references to all tables are available. Otherwise I get sql error.

Comment by Artur Eshenbrener [ 23/Dec/13 ]

https://github.com/doctrine/doctrine2/pull/886

Comment by Doctrine Bot [ 17/Feb/14 ]

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





[DDC-2869] [GH-886] [DDC-1256] Fix applying ON/WITH conditions to first join in Class Table Inheritance Created: 22/Dec/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Reference
relates to DDC-2131 Fetch join not working on class table... Resolved
relates to DDC-1256 Generated SQL error with DQL WITH and... Resolved

 Description   

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

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

Message:

Some related issues:
http://www.doctrine-project.org/jira/browse/DDC-1256
http://www.doctrine-project.org/jira/browse/DDC-2131

I think that applying custom user joins conditions to last join in CTI is ok because only in last join DB will know about all joined table aliases. And I can't see any other probles with this.

Tests are not passed, because, I think, problem in tests.

To be discussed, of course



 Comments   
Comment by Doctrine Bot [ 17/Feb/14 ]

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





[DDC-1256] Generated SQL error with DQL WITH and JOINED inheritance Created: 06/Jul/11  Updated: 18/Aug/14  Resolved: 01/May/13

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

Type: Bug Priority: Minor
Reporter: Justin Hendrickson Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 1
Labels: None
Environment:

Ubuntu 11.04


Issue Links:
Duplicate
duplicates DDC-349 Add support for specifying precedence... Open
is duplicated by DDC-2131 Fetch join not working on class table... Resolved
Reference
is referenced by DDC-2869 [GH-886] [DDC-1256] Fix applying ON/W... Resolved

 Description   

I've created an entity that has a one to one relationship to a class in an inheritance tree and I'm using class table inheritance in Doctrine. When I try to add a DQL WITH statement on a column in the super class to the join, the generated SQL incorrectly places the statement in the child classes JOIN ON section.

Here's the DQL:

SELECT p FROM Fampus_Entity_Photo p LEFT JOIN p.flag f WITH f.status='ok'

Here's the generated SQL:

SELECT p0_.id AS id0, p0_.name AS name1, p0_.path AS path2, p0_.type AS type3, p0_.reference_id AS reference_id4, p0_.view_count AS view_count5, p0_.created AS created6, p0_.modified AS modified7, p0_.event_id AS event_id8, p0_.user_id AS user_id9, p0_.school_id AS school_id10, p0_.flag_id AS flag_id11 FROM photos p0_ LEFT JOIN flaggedcontent_photo f1_ ON p0_.flag_id = f1_.id AND (f2_.status = 'ok') LEFT JOIN flaggedcontent f2_ ON f1_.id = f2_.id

Note that f2_.status = 'ok' is the correct statement, but it is in the wrong LEFT JOIN ON section.

Here are my entities (significantly clipped):

/**
 * @Table(name="photos")
*/
class Photo {
    /**
     * @OneToOne(targetEntity="FlaggedContent_Photo", mappedBy="photo")
     * @JoinColumn(nullable=true)
     */
    protected $flag;
}

/**
 * @DiscriminatorColumn(name="type")
 * @DiscriminatorMap({
 *     "photo" = "FlaggedContent_Photo"
 * })
 * @InheritanceType("JOINED")
 * @Table(name="flaggedcontent")
*/
abstract class FlaggedContent {
    /**
     * Database identifier
     *
     * @Id
     * @Column(type="integer")
     * @GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * Status
     *
     * @Column(type="text")
     * @var string
     */
    protected $status;
}

/**
 * @Entity
 * @Table(name="flaggedcontent_photo")
 */
class FlaggedContent_Photo extends FlaggedContent {
    /**
     * @OneToOne(targetEntity="Photo", inversedBy="flag")
     */
    protected $photo;
}


 Comments   
Comment by Michael Ridgway [ 06/Jul/11 ]

I created a test for this: https://github.com/mridgway/doctrine2/commit/1bb26a46188f180270d723e395ee707443ebdda1

I'll see if I can figure this out.

Comment by Michael Ridgway [ 11/Jul/11 ]

It doesn't seem that you would get the correct result if the WITH statement was on the 'flaggedcontent' table anyway. In order for this to work, the query would have to join 'flaggedcontent' first and then join to 'flaggedcontent_photo' based on f2_.id. While we can probably (but not easily) fix where the condition is placed, I don't think this will ever be able to give the expected results for ALL cases.

Comment by Benjamin Eberlei [ 12/Jul/11 ]

Formatting

Comment by Benjamin Eberlei [ 12/Jul/11 ]

This issue is unfixable, we tend towards throwing an exception in this case to notify developers that they cannot do this.

The only way to make it work is to move the status check to the WHERE clause.

Comment by Guilherme Blanco [ 14/Aug/11 ]

This issue is fixable by applying what we call as nested joins when generating the SQL.

This issue report #DDC-349 (http://www.doctrine-project.org/jira/browse/DDC-349) suggest us to support it in DQL, but I think we can introduce this generation on SQL only.
It's not a trivial implementation, but it would solve a couple of other issue I was looking into.

Cheers,

Comment by Benjamin Eberlei [ 01/May/13 ]

Duplicate of DDC-349

Comment by Artur Eshenbrener [ 22/Dec/13 ]

I do not understand why this issue is resolved. It is still reproduces!
Look to the source code:
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L989

// Handle WITH clause
        if ($condExpr !== null) {
            // Phase 2 AST optimization: Skip processing of ConditionalExpression
            // if only one ConditionalTerm is defined
            $sql .= ' AND (' . $this->walkConditionalExpression($condExpr) . ')';
        }

        // FIXME: these should either be nested or all forced to be left joins (DDC-XXX)
        if ($targetClass->isInheritanceTypeJoined()) {
            $sql .= $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias);
        }

As you can see, sql conditions added only to first join. And after that, class table inheritance joins are added. (As in this ticket summary)
I think the best fix is adding ON conditions to last join of class table inheritance, because only in last join all needed tables are joined. In condition user can access to all tables.

Comment by Artur Eshenbrener [ 23/Dec/13 ]

https://github.com/doctrine/doctrine2/pull/886

Comment by Doctrine Bot [ 17/Feb/14 ]

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





[DDC-2875] [GH-890] [DBAL-563] Add general IDENTITY generator type support for sequence emulating platforms Created: 29/Dec/13  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

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

Issue Links:
Reference
relates to DBAL-563 Oracle "IDENTITY" last inserted ID is... Resolved

 Description   

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

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

Message:

This is a follow-up PR for https://github.com/doctrine/dbal/pull/428 as discussed in DBAL-563(http://www.doctrine-project.org/jira/browse/DBAL-563) which adds IDENTITY generator type support for platforms that do not natively support identity columns but can emulate them via sequences.
This replaces the current workaround for PostgreSQL `SERIAL` columns in favour of a more general approach. With this patch now IDENTITY generator can also be used with Oracle which did not work before. Future platforms can also make use of this approach if necessary.



 Comments   
Comment by Doctrine Bot [ 31/Dec/13 ]

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





[DDC-2881] [GH-895] Fix for no dot on Class Names Created: 04/Jan/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

If you work with PostgreSQL Schemas, You should filter the names of table to generate Correct name for PHP Classes. This way allow not write dots (.) as part of the Class Name.

Additionally, there is a variable ($schema) that must be contained in the class "Doctrine\DBAL\Schema\Table" on an $schema possible property but this is not available. (recomended)






[DDC-2888] [GH-899] Add travis build matrix for all built-in PostgreSQL versions Created: 06/Jan/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

[Travis now ships with PostgreSQL version 9.1, 9.2 and 9.3 built-in](http://about.travis-ci.org/blog/2013-11-29-postgresql-92-93-now-available/). We should extend our build matrix to test on all versions.



 Comments   
Comment by Doctrine Bot [ 18/Aug/14 ]

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





[DDC-2310] Recent changes to DBAL SQL Server platform lock hinting breaks ORM SqlWalker in DQL queries with joins Created: 21/Feb/13  Updated: 18/Aug/14  Resolved: 01/Mar/14

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

Type: Bug Priority: Critical
Reporter: William Schaller Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: dbal, lockhints, orm, sqlserver, sqlsrv
Environment:

SQL Server


Issue Links:
Dependency
depends on DDC-2914 [GH-910] [DDC-2310] Fix SQL generatio... Resolved
Duplicate
duplicates DDC-2675 WITH (NOLOCK) failing when using JOIN Awaiting Feedback
Reference
is referenced by DBAL-783 [GH-508] [DDC-2310] Fix evaluation of... Resolved
is referenced by DDC-2919 LockMode::NONE evaluation inconsisten... Resolved

 Description   

The SQL Server platform throws an error when you try to run DQL with JOIN statements.

The breaking change was in the DBAL SQL Server platform – it was changed to add a ' WITH (NOLOCK)' to the appendLockHint function. Change was in this rev. The change in DBAL is not wrong, it just highlighted the bug in the ORM...

The ORM SqlWalker runs the appendLockHint function against a generated FROM / JOIN clause in the walkFromClause func here. This is actually the wrong place to append lock hints. This is generating the FROM clause like:

 FROM foo f0_ LEFT JOIN foo_bar f1_ ON f0_.id = f1_.foo_id LEFT JOIN bar b2_ ON f1_.bar_id = b2_.id WITH (NOLOCK)

When it should actually generate something like:

 FROM foo f0_ WITH (NOLOCK) LEFT JOIN foo_bar f1_ WITH (NOLOCK) ON f0_.id = f1_.foo_id LEFT JOIN bar b2_ WITH (NOLOCK) ON f1_.bar_id = b2_.id

It should append lock hints after the table alias.

I think the only reason this hasn't shown up before is that the other lock hint types haven't been applied in this way before, if at all.



 Comments   
Comment by Christophe Coevoet [ 21/Feb/13 ]

I think the line appending the lock should be moved to this place to achieve the result displayed above.

But it may cause issues with some other vendor.

Comment by William Schaller [ 21/Feb/13 ]

@Christophe I considered that too. None of the other platforms implement the appendLockHint function. None of the other platforms implement this because it is handled differently on other platforms – with transaction isolation levels and such.

Comment by Steve Müller [ 13/Jan/14 ]

I don't know why this ticket is marked as "fixed" because it's obviously NOT.
Whatever, here is the patch: https://github.com/doctrine/doctrine2/pull/910

Comment by Steve Müller [ 13/Jan/14 ]

Complementary I provided the following patch to suppress unnecessary NOLOCK hint generation in ORM: https://github.com/doctrine/dbal/pull/508

Comment by Doctrine Bot [ 14/Jan/14 ]

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

Comment by Steve Müller [ 15/Jan/14 ]

This is not resolved, yet.

Comment by Doctrine Bot [ 31/Jan/14 ]

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

Comment by Benjamin Eberlei [ 09/Feb/14 ]

Steve Müller When is it?

Comment by Steve Müller [ 09/Feb/14 ]

Benjamin Eberlei It is fixed in PR: https://github.com/doctrine/doctrine2/pull/910





[DDC-2914] [GH-910] [DDC-2310] Fix SQL generation on table lock hint capable platforms Created: 13/Jan/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

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

Issue Links:
Dependency
is required for DDC-2310 Recent changes to DBAL SQL Server pla... Resolved

 Description   

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

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

Message:

SQL Server and SQL Anywhere use table lock hints for locking. ORM generates wrong SQL when used in conjunction with joins, in a table inheritance scenario or in a subquery. It places the table lock hints after the `JOIN` clauses, which is wrong. The table lock hints have to be placed after each table alias in the `FROM` clause.

*Example (current)*
```sql
SELECT t0.id FROM users t0 INNER JOIN profiles t1 ON t0.id = t1.user_id WITH (NOLOCK)
```

*Example (expected)*
```sql
SELECT t0.id FROM users t0 WITH (NOLOCK) INNER JOIN profiles t1 ON t0.id = t1.user_id
```

The testsuites fail big time at the moment because of that and I suppose ORM is more or less unusable at the moment for those platforms without this patch.

I needed to adjust a lot of tests which compared compiled DQL, to make use of the platforms specific lock hint clauses.
Also I did not add new tests because there are already so many tests, where this fails without this patch that this is not necessary IMO.



 Comments   
Comment by Doctrine Bot [ 31/Jan/14 ]

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





[DDC-2922] Flushing new Entities reachable over several paths that do not all "cascade persist" Created: 17/Jan/14  Updated: 18/Aug/14

Status: Awaiting Feedback
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3.3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Matthias Pigulla Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 1
Labels: None


 Description   

Please consider the following associations:

  A <>--> B <-- C  

A is an "aggregate" type object w/ a OneToMany collection of Bs. This association is set to cascade persist operations.

C has a unidirectional OneToOne association to B as well.

Adding a new B to A's collection and flushing the EntityManager works - B is persisted (persistence by reachability).

However, when also creating a new C and pointing it to the new B, adding C to the EntityManager and then flushing leads to an exception because B is discovered as a new Entity through a relationship not set to cascade persist operations.

Obviously the problem here is that there are two paths through which we can discover new Entities. The UoW currently starts search from newly (explicitly) added Entities first before it walks through collections of already-managed entities.

I am unsure if it is just a documentation issue or a deeper problem?

If the UoW worked the other way round, the same problem would occur if the cascade persist was on the other association.

A solution would probably require the UoW to first collect all offending (new) Entities and the link they were discovered through, but later on remove Entities from this list if they are found through another association with the cascade persist option. The exception must not be thrown unless the whole reachability graph has been traversed.



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

Can this be factored into a failing test case? I'm not sure if we can support it, but the code would make it much easier to track down the issue into something fixable.





[DDC-2945] [GH-925] [DDC-2310] [DDC-2675] [2.4] Fix SQL generation on table lock hint capable platforms Created: 31/Jan/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Steve Müller
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

Backport of PR https://github.com/doctrine/doctrine2/pull/910 for 2.4 branch.






[DDC-2955] [GH-933] [WIP] DDC-2953 Created: 05/Feb/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None

Issue Links:
Dependency
is required for DDC-2953 ArrayHydrator: Not all items hydrated... Open

 Description   

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

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

Message:

This PR tries to fix DDC-2953 (http://www.doctrine-project.org/jira/browse/DDC-2953).

tl;dr: when the results are not sorted by root entity identifier, the array hydrator swallows some output.



 Comments   
Comment by Doctrine Bot [ 18/Aug/14 ]

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

Comment by Marco Pivetta [ 18/Aug/14 ]

Provided fix is invalid. A fix would require a major BC break.





[DDC-2953] ArrayHydrator: Not all items hydrated while orderBy Created: 05/Feb/14  Updated: 18/Aug/14

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

Type: Bug Priority: Critical
Reporter: Mariusz Jaskółka Assignee: Guilherme Blanco
Resolution: Unresolved Votes: 0
Labels: array, hydration
Environment:

Linux and Windows, PHP5


Attachments: File ArrayHydrator.php     File Array_Hydrator_4.2.php     File Array_hydrator_4.2_bugfix.php    
Issue Links:
Dependency
depends on DDC-2955 [GH-933] [WIP] DDC-2953 Resolved

 Description   

I will explain the problem using example and pseudo-code:

I have query like that:
SELECT (...) FROM order LEFT JOIN person LEFT JOIN identifier (...) order by (...)

The rows returned by query are following (the order is very important):
order_id|person_id|identifier_id|
12 |21 |33 |
12 |21 |34 |
11 |21 |35 |
11 |21 |33 |
11 |21 |34 |
12 |21 |35 |

After hydration the result is like:
result[0][person][identifier][0][id]=33
result[0][person][identifier][0][id]=34
result[1][person][identifier][0][id]=35
result[1][person][identifier][0][id]=34

But it should be:
result[0][person][identifier][0][id]=33
result[0][person][identifier][0][id]=34
result[0][person][identifier][0][id]=35
result[1][person][identifier][0][id]=35
result[1][person][identifier][0][id]=34
result[1][person][identifier][0][id]=33

The reason is that ArrayHydrator::_identifierMap contains only object id and parents object id. In may example there is difference in parents parent (grandparent) id.



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

I've started work on this at https://github.com/doctrine/doctrine2/pull/933

Comment by Mariusz Jaskółka [ 06/Feb/14 ]

This is how I temporary solved the issue, maybe it can help (attachment).

Comment by Marco Pivetta [ 06/Feb/14 ]

Mariusz Jaskółka can you provide a diff with current master? This seems to be based off 2.3 or previous versions...

Comment by Mariusz Jaskółka [ 06/Feb/14 ]

Version 2.4.2 oryginal file and bugfix

Comment by Mariusz Jaskółka [ 06/Feb/14 ]

Oh sorry it is version 2.4.1 (composer downloaded that version for me).
I hope it will be ok.

Comment by Marco Pivetta [ 06/Feb/14 ]

Mariusz Jaskółka thanks! I'm trying it right now

Comment by Mariusz Jaskółka [ 06/Feb/14 ]

I added one dimention to $this->_identifierMap to be sure that all object's children's keys will be mapped separately.

Comment by Marco Pivetta [ 06/Feb/14 ]

Mariusz Jaskółka, I've applied your hotfix at https://github.com/doctrine/doctrine2/commit/c05921032ff6947daca2d7275031e5cde4700634 and the tests seem to pass on my system and on travis. You may want to check it out and see if it works for your use case.

Comment by Mariusz Jaskółka [ 06/Feb/14 ]

It works for my use case correctly. You apparently forgot to remove/comment line 82 which is not necessary now.

Comment by Marco Pivetta [ 06/Feb/14 ]

Mariusz Jaskółka fixed, thanks!

Comment by Marco Pivetta [ 14/Jul/14 ]

I don't think we'll have a fix for this issue for 2.5, as it will probably require a complete rewrite of the array hydrator

Comment by Guilherme Blanco [ 14/Jul/14 ]

... and introducing BC breaks.

Comment by Doctrine Bot [ 18/Aug/14 ]

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





[DDC-3005] Events::postLoad fires without filled associations Created: 02/Mar/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Artur Eshenbrener Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Dependency
depends on DDC-3070 [GH-1001] [DDC-3005] Defer invoking o... Open

 Description   

When we load entities throw one dql query like this:

SELECT e, joined_link FROM Entity LEFT JOIN e.link joined_link

In event subscriber, subscribed to postLoad event for instances of Entity property "link" of entity does not contains fetched in same query joined entity, and does not contains proxy object.

Tell me if failing test case needed.



 Comments   
Comment by Marco Pivetta [ 02/Mar/14 ]

The postLoad event is fired without warranty that association entities/proxies will be set:

http://docs.doctrine-project.org/en/latest/reference/events.html#lifecycle-events

Comment by Artur Eshenbrener [ 03/Mar/14 ]

But why? This shounds like involuntary restriction, and I think it can be fixed. Will my PR with fix accepted, or collaborators don't want to change this behaviour?

Comment by Marco Pivetta [ 03/Mar/14 ]

Artur Eshenbrener triggering `postLoad` in the correct moment in time (when all dependencies are loaded) requires a lot of additional complexity to be inserted in various locations of the ORM.

Since `postLoad` is supposed to be used like `__wakeup` and in general for simple tasks, this kind of refactoring/rewrite would be an overkill.

Comment by Artur Eshenbrener [ 04/Mar/14 ]

> requires a lot of additional complexity to be inserted in various locations of the ORM.
Sounds like "It is very hard to implement, and no one want to do this"

> and in general for simple tasks, this kind of refactoring/rewrite would be an overkill.
Disagree with this. Why only simple? I need to deal with associations in this event. Without this I should inject whole EntityManager to my entity, but I dont want to do this.

And I forced to repeat the question: will PR with fix accepted or not?

Comment by Marco Pivetta [ 04/Mar/14 ]

Sounds like "It is very hard to implement, and no one want to do this"

Not really, the main problem here is performance, since hydration would have to be completely redesigned.
Yes, "too hard" is a good reason for something that is an edge case.

And I forced to repeat the question: will PR with fix accepted or not?

Sure thing! Just needs to avoid a massive rewrite though.

Comment by Marco Pivetta [ 04/Mar/14 ]

To give you some hints, Doctrine\ORM\Events::postLoad is triggered in https://github.com/doctrine/doctrine2/blob/15432fc55f83c2d6ce8d9b86fd3139dd2a4fc328/lib/Doctrine/ORM/UnitOfWork.php#L2788, and Doctrine\ORM\UnitOfWork#createEntity() is used by all the various hydrators internally.

To ensure that Doctrine\ORM\Events::postLoad is triggered after an entity is fully loaded, the various hydrators must trigger the events after being sure that all data has been set, and that the entity is "ready" for use. That's some copy-paste work :\

Comment by Artur Eshenbrener [ 04/Mar/14 ]

I think the entry point is here: https://github.com/doctrine/doctrine2/blob/15432fc55f83c2d6ce8d9b86fd3139dd2a4fc328/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php#L140,
so, copy-paste work is not needed )

Comment by Artur Eshenbrener [ 05/Apr/14 ]

PR is ready: https://github.com/doctrine/doctrine2/pull/1001





[DDC-3070] [GH-1001] [DDC-3005] Defer invoking of postLoad event to the end of hydration cycle. Created: 04/Apr/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Dependency
is required for DDC-3005 Events::postLoad fires without filled... Reopened

 Description   

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

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

Message:

This feature makes guarantee, that postLoad event fires after all associations are populated.
Test case also provided.






[DDC-3025] Mapping drivers do not honor scale or precision for identifier fields Created: 12/Mar/14  Updated: 18/Aug/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, Tools
Affects Version/s: 2.4.2
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: huda salam Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

FYI. I don't use doctrine but with symfony2, and only use .yml or .xml mapping. Not yet try with annotation.

These commands :

php app\console doctrine:schema:update
php app\console doctrine:schema:create

Will not generate id's precision and scale for this kind of mapping :

<doctrine-mapping .....>
  <entity name="Namespace\MyBundle\Entity\MyData" table="my_data">
    <id name="id" type="decimal" column="id" precision="x" scale="y">
      <generator strategy="IDENTITY"/>
    </id>
    <field ... />
  </entity>
</ ....>

Suggested changes :

  • Doctrine\ORM\Mapping\Driver\YamlDriver.php
  • Doctrine\ORM\Mapping\Driver\XmlDriver.php





[DDC-3029] DISTINCT , ORDER BY AND Limit in SQL Server Created: 14/Mar/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Michał Banaś Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File SQLServerPlatform.php    

 Description   

I don't know if I should report it here , becouse error is in SQLServerPlatform.php file.
basicaly Distinct includes ROWNUM()
So if you add distinct in DQL it will be translated to "select distinct ...... , Rownum()" - which is always distinct offcource.

Here is original version

    protected function doModifyLimitQuery($query, $limit, $offset = null)
    {
        if ($limit > 0) {
            if ($offset == 0) {
                $query = preg_replace('/^(SELECT\s(DISTINCT\s)?)/i', '\1TOP ' . $limit . ' ', $query);
            } else {
                $orderby = stristr($query, 'ORDER BY');

                if ( ! $orderby) {
                    $over = 'ORDER BY (SELECT 0)';
                } else {
                    $over = preg_replace('/\"[^,]*\".\"([^,]*)\"/i', '"inner_tbl"."$1"', $orderby);
                }

                // Remove ORDER BY clause from $query
                $query = preg_replace('/\s+ORDER BY(.*)/', '', $query);
                $query = preg_replace('/^SELECT\s/', '', $query);

                $start = $offset + 1;
                $end = $offset + $limit;

                $query = "SELECT * FROM (SELECT ROW_NUMBER() OVER ($over) AS doctrine_rownum, $query) AS doctrine_tbl WHERE doctrine_rownum BETWEEN $start AND $end";
            }
        }

        return $query;
    }

In Attachenment there is a fixed version of this file.



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

Can you provide a failing test case and an expected result as well?





[DDC-3046] The flushed data is not available immediately for querying Created: 25/Mar/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: alex Assignee: Marco Pivetta
Resolution: Incomplete Votes: 0
Labels: None
Environment:

ubuntu 13.10, mysql 5.5.35



 Description   

Doctrine's persisted data is not accessible by other queries immediately, for details see http://stackoverflow.com/questions/22618689/doctrines-persisted-data-is-not-accessible-by-other-queries-immediately



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

Missing reproduction case





[DDC-3044] [GH-986] Add last modified time for metadata Created: 22/Mar/14  Updated: 18/Aug/14

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

This patch improves performance during development and does not affect production performance.

Currently, enabling the metadata cache during development gives a remarkable performance boost, but it requires that you manually flush the metadata cache when the metadata has been changed. When running console commands such as ``console orm:schema-tool:update`` (see #979).

With this change, metadata entries fetched from cache are checked for freshness using a quick last modified check. This is much faster than loading the actual metadata using the metadata driver. This allows you to enable the metadata cache during development without the need for manually flushing the metadata cache.

This PR is part 1 of 2. Part 2 is for the doctrine/common repository.

If this PR is accepted, it allows us to optimize the auto-generate proxy classes feature by comparing the last modified time for the metadata with the modified timestamp of the generated file.






[DDC-3056] Return value mismatch between code under HHVM and Zend Created: 28/Mar/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Andy hunt Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: hhvm, orm, paginator
Environment:

Two environments:
LAMP stack with PHP 5.4.25 on Ubuntu 12.04
HHVM 3.0.0.-dev (rel) ob Ubuntu 12.04



 Description   

The following code produces differing results under Zend and HHVM runtimes.

// $all::build uses the query builder to select all entities of a type
/** @var \Doctrine\ORM\Query $query **/
$query = $all->build($qb);
$query->setMaxResults($pageSize)->setFirstResult($start);

$paginator = new Paginator($query);
$results = array_values((array)$paginator->getIterator());

Under Zend, $results is a 1-dimensional array containing N elements:
[1, 2, 3].

Under HHVM, $results is a 2-dimensional array containing a single array, containing N elements:
[ [1,3,3] ]



 Comments   
Comment by Christophe Coevoet [ 28/Mar/14 ]

I suggest reporting it to the HHVM team as a bug

Comment by Marco Pivetta [ 28/Mar/14 ]

Also: why are you using an array cast and not iterator_to_array?

Comment by Christophe Coevoet [ 28/Mar/14 ]

@Marco this should be equivalent. Casting a Traversable to array should traverse it. If HHVM does not do it, it is a bug.

Comment by Marco Pivetta [ 28/Mar/14 ]

Christophe Coevoet not really: http://3v4l.org/Z3t4t

Comment by Marco Pivetta [ 18/Aug/14 ]

Resolving as invalid: this seems to be a misuse in my opinion.





[DDC-3079] preUpdate in EntityListener not run in transaction Created: 10/Apr/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Jiri Napravnik Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

I have entity:

class Article{
	/**
	 * @ORM\OneToMany(targetEntity = "ArticleModule\Model\Entities\ArticlePhoto", mappedBy = "article", cascade = {"persist", "remove"}, orphanRemoval = TRUE)
	 * @ORM\OrderBy({"sequence" = "ASC"})
	 */
	protected $articlePhotos;
}

And Entity Listener with preRemove.

I call

$article->articlePhotos->clear();
...some changes with entity...
$em->flush();

preRemove in Entity Listener is called, BUT before Begin transaction...

I can do
$em->transactional(function(){}); then it's full in transaction..



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

As of https://github.com/doctrine/doctrine2/blob/ff801879304dfc2bdec34222d4c03fa7bde3e4e4/lib/Doctrine/ORM/UnitOfWork.php#L344, I see that preUpdate listeners are executed AFTER the transaction has been started.

Marking as invalid





[DDC-3088] EntityManager::clear doesn't working with inserting Created: 16/Apr/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Adrian Ch Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

PHP 5.4.25-1+sury.org~precise+2 (cli) (built: Feb 12 2014 10:45:30)
Symfony version 2.4.2 - app/dev/debug



 Description   

It looks like EntityManager's clear() method doesn't remove objects that was persisted during script execution.

Bellows are two functions. First one insert 10.000 records and use clear after each flush that should remove objects from memory, but instead of that memory usage growths in each iteration. There isn't any other reference for this objects.

I've checked how it works for reading and with clearing it works perfectly - script uses only constant memory.

 
    private function testInserting($em, $entityClass, $batchSize, $startMemoryUsage)
    {
        for ($i = 1; $i <= 10000; ++$i) {

            $item = new $entityClass();
            $item->setName($i);
            $item->setPresentation($i);
            $em->persist($item);

            if ($i % $batchSize == 0) {
                $em->flush();
                $em->clear();

                $currentMemoryUsage = memory_get_usage();
                printf("%d:\n\t%.2f MB (%.2f MB)\n", $i, $currentMemoryUsage /1024 / 1024, ($currentMemoryUsage - $startMemoryUsage) / 1024 / 1024);
            }
        }
    }
    
    
private function testReading($em, $entityClass, $batchSize, $startMemoryUsage)
    {
        $q = $em->createQuery("select i from $entityClass i");
        $iterableResult = $q->iterate();

        $i = 0;
        while (($row = $iterableResult->next()) !== false) {
            $em->clear();
            if ($i % $batchSize == 0) {
                $currentMemoryUsage = memory_get_usage();
                printf("%d:\n\t%.2f MB (%.2f MB)\n", $i, $currentMemoryUsage /1024 / 1024, ($currentMemoryUsage - $startMemoryUsage) / 1024 / 1024);
            }

            $i++;
        }
    }
    

My results:

1) Reading without clearing ($em->clear(); removed)

0:
22.89 MB (2.63 MB)
1000:
33.41 MB (13.15 MB)
2000:
44.04 MB (23.78 MB)
3000:
53.50 MB (33.24 MB)
4000:
65.13 MB (44.86 MB)
5000:
74.81 MB (54.55 MB)
6000:
84.27 MB (64.01 MB)
7000:
97.96 MB (77.69 MB)
8000:
107.40 MB (87.14 MB)
9000:
117.17 MB (96.91 MB)
10000:
126.61 MB (106.35 MB)

2) Reading with using clear

0:
22.89 MB (2.63 MB)
1000:
26.25 MB (5.99 MB)
2000:
24.74 MB (4.48 MB)
3000:
26.72 MB (6.46 MB)
4000:
24.79 MB (4.52 MB)
5000:
26.76 MB (6.50 MB)
6000:
24.81 MB (4.55 MB)
7000:
26.77 MB (6.51 MB)
8000:
24.83 MB (4.57 MB)
9000:
26.81 MB (6.54 MB)
10000:
24.86 MB (4.60 MB)

3) Inserting without clearing

1000:
29.50 MB (9.24 MB)
2000:
37.76 MB (17.50 MB)
3000:
45.12 MB (24.86 MB)
4000:
54.34 MB (34.07 MB)
5000:
61.79 MB (41.53 MB)
6000:
69.09 MB (48.82 MB)
7000:
76.40 MB (56.13 MB)
8000:
83.75 MB (63.48 MB)
9000:
95.64 MB (75.37 MB)
10000:
102.98 MB (82.71 MB)

4) Inserting with using clear

1000:
27.90 MB (7.63 MB)
2000:
34.64 MB (14.37 MB)
3000:
40.43 MB (20.17 MB)
4000:
48.20 MB (27.93 MB)
5000:
54.12 MB (33.85 MB)
6000:
59.89 MB (39.63 MB)
7000:
65.67 MB (45.40 MB)
8000:
71.43 MB (51.16 MB)
9000:
81.51 MB (61.25 MB)
10000:
87.29 MB (67.02 MB)



 Comments   
Comment by Marco Pivetta [ 16/Apr/14 ]

Would be useful to see what the entity class looks like.

Additionally, the ORM version being affected is also needed.





[DDC-3226] Unable to escape field names in YAML notation Created: 24/Jul/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Minor
Reporter: Stepan Anchugov Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None
Environment:

PHP Version 5.5.11
MySQL 5.6.16
Darwin Kernel Version 13.3.0
Mac OS 10.9.3



 Description   

As in DDC-1759, I wanted to use some reserved words as my field names (same case: MySQL-backed key-value storage).
DDC-1759 was resolved by escaping the column names in field annotations. However, I'm using YAML files to store my mappings, and I couldn't find a way to set up an escaped field name there.



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

Escaping fields is done via the backtick symbol ` in column mappings. This is not driver-specific, but applies to all mappings.





[DDC-3231] [GH-1089] Entity repository generator default repository Created: 27/Jul/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

1) I set default repository class in configuration to MyApp\Doctrine\DefaultRepository
2) I created entity class MyApp\Entity\TestEntity and generated repository class for it
3) Actually the repository class "MyApp\Entity\TestEntityRepository" turned out to be a descendant of "Doctrine\ORM\EntityRepository" when I expected "MyApp\Doctrine\DefaultRepository" as default.

Related pull request https://github.com/doctrine/DoctrineBundle/pull/315






[DDC-3234] Empty properties when filtering collections Created: 30/Jul/14  Updated: 18/Aug/14

Status: Awaiting Feedback
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.5, 2.4.2
Fix Version/s: 2.x
Security Level: All

Type: Bug Priority: Major
Reporter: Diogo Domanski de Souza Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: Collection, Criteria, orm
Environment:

PHP 5.5.9, Nginx 1.4.6, PHP FPM, Zend Framework 2.3.1, Linux Ubuntu 14.04



 Description   

I'm facing some troubles when filtering an entity association (ArrayCollection) by using Criteria.

The scenario is the following: I have 3 entities:

User.php
<?php

namespace Entity;

use Doctrine\ORM\Mapping as ORM;
use \Doctrine\Common\Collections\Criteria;
use Zend\Stdlib\Hydrator;

/**
 * User
 *
 * @ORM\Table(name="user")
 * @ORM\Entity(repositoryClass="Entity\UserRepository")
 * @ORM\HasLifecycleCallbacks
 * @author domanski
 */
class User implements \Serializable {
	/**
	 *
	 * @ORM\Id
	 * @ORM\Column(name="id", type="integer", nullable=false)
	 * @ORM\GeneratedValue(strategy="AUTO")
	 * @var integer
	 */
	private $id;

	/**
	 * @ORM\Column(name="delete_date", type="datetime")
	 * @var \DateTime
	 */
	private $deleteDate;
	
	public function __construct(array $options = array()) {
		if (!empty($options))
			$this->hydrate($options);
	}

	public function hydrate(array $options = array(), \Doctrine\ORM\EntityManager $em = null) {
		$hydrator = new Hydrator\ClassMethods();
		$hydrator->hydrate($options, $this);
	}

	/**
	 * 
	 * @return int
	 */
	public function getId() {
		return $this->id;
	}

	/**
	 * 
	 * @param int $id
	 * @return \Entity\User
	 */
	public function setId($id) {
		$this->id = $id;
		return $this;
	}

	/**
	 * 
	 * @return \DateTime
	 */
	public function getDeleteDate() {
		return $this->deleteDate;
	}

	/**
	 * @param \DateTime|null $deleteDate
	 * @return \Entity\User
	 */
	public function setDeleteDate($deleteDate = null) {
		$this->deleteDate = $deleteDate;
		return $this;
	}

	/**
	 * 
	 * @return array
	 */
	public function toArray() {
		$result = array(
			'id' => $this->getId(),
			'delete_date' => $this->getDeleteDate()
		);

		return $result;
	}

}
FieldWorker.php
<?php

namespace Entity;

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

use Zend\Stdlib\Hydrator;

/**
 * Description of FieldWorker
 *
 * @ORM\Entity(repositoryClass="Entity\FieldWorkerRepository")
 * @ORM\Table(name="field_worker")
 * @ORM\HasLifecycleCallbacks
 * @author domanski
 */
class FieldWorker {
	
	/**
	 * This attribute must exist so the inverse join with any other entity can work
	 * 
	 * @ORM\Id
	 * @ORM\Column(type="integer", name="user_id")
	 * @var string
	 */
	protected $id;
	
	/**
	 * 
	 * @ORM\OneToOne(targetEntity="Entity\User")
	 * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
	 * @var \Entity\User
	 */
	protected $user;
	
	public function __construct($options = array()) {		
		if(!empty($options))
			$this->hydrate($options);
	}
	
	public function hydrate(array $options = array(), \Doctrine\ORM\EntityManager $em = null) {
		if(!empty($em)) {
			// user
			if(isset($options['user']))
				$options['user'] = $em->getReference('Entity\User', $options['user']);
			else if(isset($options['user_id']))
				$options['user'] = $em->getReference('Entity\User', $options['user_id']);
						
		}
		
		$hydrator = new Hydrator\ClassMethods();
		$hydrator->hydrate($options, $this);
	}

	/**
	 * 
	 * @return \Entity\User
	 */
	public function getUser() {
		return $this->user;
	}

	/**
	 * 
	 * @param \Entity\User $user
	 * @return \Entity\FieldWorker
	 */
	public function setUser(\Entity\User $user) {
		$this->user = $user;
		$this->id = $user->getId();
		return $this;
	}
	
	/**
	 * 
	 * @return array
	 */
	public function toArray() {
		return $this->getUser()->toArray();
	}
}
Stage.php
<?php

namespace Obra\Entity;

use Doctrine\ORM\Mapping as ORM;
use Zend\Stdlib\Hydrator;
use Doctrine\Common\Collections\Criteria;

/**
 * Description of Stage
 *
 * @ORM\Table(name="stage")
 * @ORM\Entity(repositoryClass="Entity\StageRepository")
 * @ORM\HasLifecycleCallbacks
 * @author domanski
 */
class Stage {

	/**
	 *
	 * @ORM\Id
	 * @ORM\Column(name="id", type="integer", nullable=false)
	 * @ORM\GeneratedValue(strategy="AUTO")
	 * @var integer
	 */
	private $id;

	/**
	 * @ORM\ManyToMany(targetEntity="Entity\FieldWorker")
	 * @ORM\JoinTable(name="stage_field_worker",
	 * 		joinColumns={@ORM\JoinColumn(name="stage_id", referencedColumnName="id")},
	 * 		inverseJoinColumns={@ORM\JoinColumn(name="field_worker_id", referencedColumnName="user_id")}
	 * 	)
	 * @var \Doctrine\Common\Collections\ArrayCollection
	 */
	private $fieldWorkers;

	public function __construct(array $options = array()) {
		$this->fieldWorkers = new \Doctrine\Common\Collections\ArrayCollection();

		if (!empty($options))
			$this->hydrate($options);
	}

	public function hydrate(array $options = array(), \Doctrine\ORM\EntityManager $em = null) {
		$hydrator = new Hydrator\ClassMethods();
		$hydrator->hydrate($options, $this);
	}

	/**
	 * 
	 * @return int
	 */
	public function getId() {
		return $this->id;
	}

	/**
	 * 
	 * @param int $id
	 * @return \Entity\Stage
	 */
	public function setId($id) {
		$this->id = $id;
		return $this;
	}

	/**
	 * 
	 * @return \Doctrine\Common\Collections\ArrayCollection
	 */
	public function getFieldWorkers() {
		$criteria = Criteria::create()
				->where(Criteria::expr()->isNull("user.deleteDate"))
				->orderBy(array("user.name" => Criteria::ASC));

		return $this->fieldWorkers->matching($criteria);
	}

	/**
	 * 
	 * @return \Entity\Stage
	 */
	public function clearFieldWorkers() {
		$this->fieldWorkers->clear();
		return $this;
	}

	/**
	 * 
	 * @param \Entity\FieldWorker $fieldWorker
	 * @return \Entity\Stage
	 */
	public function addFiscal(\Entity\FieldWorker $fieldWorker) {
		$this->fieldWorkers->add($fieldWorker);
		return $this;
	}

	/**
	 * 
	 * @return array
	 */
	public function toArray() {
		$result = array(
			"id" => $this->getId(),
			"field_workers" => array()
		);

		foreach ($this->getFieldWorkers() as $fieldWorker) {
			$result['field_workers'][] = $fieldWorker->toArray();
		}

		return $result;
	}
}

The problem is that whenever the Stage::getFieldWorkers() method is invoked, the list of associated field workers is returned correctly, however if I try to retrieve the respective user of any field worker, it is NULL.

For example:

$stageEntity = $em->getRerefence('Entity\Stage', 1);
$fieldWorkers = $stageEntity->getFieldWorkers();

foreach($fieldWorkers as $fieldWorker) {
   $userId = $fieldWorker->getUser()->getId(); // This throws an error message saying that the result of getUser() is NULL
}

Another example would be if I try to call $stageEntity->toArray() (because it does the same thing as show above).

The database tables are as following:

Database tables creation
CREATE TABLE `user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `delete_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `field_worker` (
  `user_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`user_id`),
  CONSTRAINT `fk_field_worker_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `stage` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `stage_field_worker` (
  `stage_id` int(10) unsigned NOT NULL,
  `field_worker_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`stage_id`,`field_worker_id`),
  KEY `fk_stage_field_worker_stage_idx` (`stage_id`),
  KEY `fk_stage_field_worker_field_worker_idx` (`field_worker_id`),
  CONSTRAINT `fk_stage_field_worker_field_worker` FOREIGN KEY (`field_worker_id`) REFERENCES `field_worker` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_stage_field_worker_stage` FOREIGN KEY (`stage_id`) REFERENCES `stage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `user` SET `id` = 1;
INSERT INTO `field_worker` SET `user_id` = 1;
INSERT INTO `stage` SET `id` = 1;
INSERT INTO `stage_field_worker` SET `stage_id` = 1, `field_worker_id` = 1;

After hours trying to understand what was wrong, I decided to make a test and modify the Stage::getFieldWorkers() method by removing the filtering Criteria:

public function getFieldWorkers() {
    return $this->fieldWorkers;
}

By simply doing that, the getUser() method started to return an entity of type User (as expected).

I am not a Doctrine ORM expert, but there seems to be something wrong with ArrayCollection filtering (matching() method)



 Comments   
Comment by Diogo Domanski de Souza [ 30/Jul/14 ]

The same problem occurs with QueryBuilder. For example:

StageRepository.php
<?php

namespace Entity;

use Doctrine\ORM\EntityRepository;

/**
 * Description of StageRepository
 *
 * @author domanski
 */
class StageRepository extends EntityRepository 
{

	public function findByFieldWorkerId($fieldWorkerId) {
		$qb = $this->getEntityManager()->createQueryBuilder()
			->select('s')
			->from('Entity\Stage', 's')
			->innerJoin('s.fieldWorkers', 'f')
			->innerJoin('f.user', 'u', \Doctrine\ORM\Query\Expr\Join::WITH, "u.deleteDate IS NULL AND u.id = :field_worker_id")
				->setParameter('field_worker_id', $fieldWorkerId);

		return $qb->getQuery()->getResult();
	 }
}

If I try to iterate over the result of StageRepository::findByFieldWorkerId() and call toArray() of any element, I get the same error. I've even tried to remove the inner join with User entity from query:

	public function findByFieldWorkerId($fieldWorkerId) {
		$qb = $this->getEntityManager()->createQueryBuilder()
			->select('s')
			->from('Entity\Stage', 's')
			->innerJoin('s.fieldWorkers', 'f');

		return $qb->getQuery()->getResult();
	 }
Comment by Marco Pivetta [ 30/Jul/14 ]

I suspect that something is wrong in your mappings then...

Comment by Diogo Domanski de Souza [ 31/Jul/14 ]

Hi Marco,

The mappings are shown above. The only thing I did was to omit some entities/tables properties/columns that don't have to see with the associations - except the field worker (table and Entity) and stage_field_worker table, that are fully presented.

Maybe is important to notice that the field_worker table has only one column (user_id) that is primary key and foreign key (referencing user.id).

Thanks for you support

Comment by Marco Pivetta [ 31/Jul/14 ]

Diogo Domanski de Souza we can't debug this as it is. We'd need a functional test case to be added to https://github.com/doctrine/doctrine2/tree/0650bb954f5e8d05776f99abd04c81948413299f/tests/Doctrine/Tests/ORM/Functional/Ticket first, in order to see the failure

Comment by Diogo Domanski de Souza [ 31/Jul/14 ]

Marco Pivetta is there any documentation (tutorial, instructions, guide, etc) that I can use to learn how to write the functional test cases that I need?

Comment by Marco Pivetta [ 31/Jul/14 ]

Diogo Domanski de Souza you need to look at the existing ones.

For running the test suite:

git clone git@github.com:doctrine/doctrine2.git
cd doctrine2 
curl -s https://getcomposer.org/installer | php --
./composer.phar install
./vendor/bin/phpunit




[DDC-3238] GROUP BY does not work as expected in MS SQL Server Created: 31/Jul/14  Updated: 18/Aug/14

Status: Awaiting Feedback
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.4.1, 2.4.2
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Spencer Weiss Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

MS SQL Server 2012



 Description   

Running the query taken from this page: <http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html>

$query = $em->createQuery('SELECT u, count(g.id) FROM FundAsset u JOIN u.locations g GROUP BY u.id');

I receive the following error from MS SQL Server:

SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Column 'fund_assets.active' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

It appears that Doctrine's GROUP BY clause does not work correctly in Microsoft SQL Server.



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

Needs a failing test case.





[DDC-1590] Fix Inheritance in Code-Generation Created: 09/Jan/12  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 3
Labels: None

Issue Links:
Dependency
depends on DDC-3240 [GH-1098] #DDC-1590: Fix Inheritance ... Resolved
is required for DDC-1579 MappedSuperClass and inheritance prob... Resolved

 Comments   
Comment by Lukas Domnick [ 10/Dec/12 ]

(I have no Link Privileges, but this one #DDC-1379 is a duplicate with more extent info.)





[DDC-3240] [GH-1098] #DDC-1590: Fix Inheritance in Code-Generation Created: 03/Aug/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Dependency
is required for DDC-1590 Fix Inheritance in Code-Generation Resolved

 Description   

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

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

Message:

DDC-1590



 Comments   
Comment by Doctrine Bot [ 05/Aug/14 ]

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

Comment by Doctrine Bot [ 18/Aug/14 ]

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





[DDC-1379] Entity Generator Bug with extended classes Created: 16/Sep/11  Updated: 18/Aug/14  Resolved: 09/Jan/12

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

Type: Bug Priority: Major
Reporter: Mark Badolato Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None


 Description   

I'm presently using Doctrine 2 in conjunction with Symfony 2 and have come across a bug with the Entity Generator when I'm extending an abstract class. Here's a minor example to demonstrate (please note, any annotations problems or typos are a result of my typing in this ticket. This isn't an actual example, but does accurately show how to reproduce the issue)

Foo.php
abstract class Foo
{
    /**
     * @Column(name="first_name")
     */
    protected $firstName;

     /**
     * @Column(name="last_name")
     */
    protected $lastName;
    /**
     * @ORM\Column(name="is_active", type="boolean")
     */
    protected $isActive;
}
Bar.php
/**
 * @Entity
 */
class Bar extends Foo
{
    /**
     * @Id
     * @Column(type="integer")
     * @GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @Column(name="created_at", type="datetime")
     */
    protected $createdAt;
}

Using a setup similar to the above, where Bar extends Foo, there is an issue with the Generator.

1) The generator is redeclaring Foo's properties, as private variables, in Bar

So, opening Bar after running the generator, shows the getters and setters, but shows:
private $firstName;
private $lastName;
private $isActive;

This causes issues because the properties are being recreated as local versions, and their scope is set to private, conflicted with the more open protected version in the abstract class. To me, they shouldn't be placed in Bar because they're declared as protected in Foo and thus Bar has access to them. Also, when they are placed in Bar, the file formatting is messed up around them, suggesting that they were mis-placed in the file.

2) This may or may not be a bug (it may be intended behavior), but... I would think that when running the generator, the getters and setters for the protected properties declared in Foo would be placed in Foo, and not placed in the class(es) that extend Foo (in this case, Bar). If I also have a class Baz that extends Foo, then Bar and Baz will now have copies of the same getFirstName(), getLastName(), and getIsActive() methods, which is unneeded. They can be placed in the parent class, and overridden in the subclasses if more/different functionality/behavior is needed by the subclass.

Hopefully this is a clear example. Please feel free to hit me up for more info!
--mark



 Comments   
Comment by Christoph Schaefer [ 30/Oct/11 ]

I can confirm this behavior.

Before generation:

Foo
/**
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 *
 * @ORM\InheritanceType("JOINED")
 * @ORM\DiscriminatorColumn(name="discr", type="string")
 * @ORM\DiscriminatorMap({"foo_bar" = "FooBar"})
 */
class Foo
{

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * creation date
     *
     * @ORM\Column(name="created_at",type="datetime")
     */
    protected $createdAt;

    /**
     * getCreatedAt
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set the creation date
     *
     * @return null
     */
    public function setCreatedAt(\DateTime $createdAt)
    {
        $this->createdAt = $createdAt;
    }

    /**
     * @ORM\PrePersist
     */
    public function prePersist()
    {
        $this->createdAt = new \DateTime();
    }
}
FooBar
/**
 * @ORM\Entity
 */
class FooBar extends Foo {

    /**
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $title;
}

after generation of FooBar:

FooBar
/**
 * @ORM\Entity
 */
class FooBar extends Foo {

    /**
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $title;

    /**
     * @var integer $id
     */
    private $id;

    /**
     * @var datetime $createdAt
     */
    private $createdAt;

    /**
     * Set title
     *
     * @param string $title
     */
    public function setTitle($title)
    {
        $this->title = $title;
    }

    /**
     * Get title
     *
     * @return string 
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set createdAt
     *
     * @param datetime $createdAt
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;
    }

    /**
     * Get createdAt
     *
     * @return datetime 
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }
}

It looks like the generator doesn't check if an attribute is inherited and therefore is already defined.
If an attribute is found as inherited, the generation of the attribute, accessor and mutator should be skipped.

This bug is really annoying, especially when working with bigger objects.

Tested within Symfony2 v2.0.4

doctrine-common]
    git=http://github.com/doctrine/common.git
    version=2.1.2

[doctrine-dbal]
    git=http://github.com/doctrine/dbal.git
    version=2.1.3

[doctrine]
    git=http://github.com/doctrine/doctrine2.git
    version=2.1.2

-Chris

Comment by Benjamin Eberlei [ 09/Jan/12 ]

As per the help message of the entity generation inheritance generation is not yet supported and will not work.

Its planned for 2.3.

Follow DDC-1590 for current information.

Comment by Doctrine Bot [ 05/Aug/14 ]

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

Comment by Doctrine Bot [ 18/Aug/14 ]

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





[DDC-3243] [GH-1099] Fixed a bug so that a versioned entity with a OneToOne defined as an id can be created Created: 07/Aug/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

Changed the visibility of UnitOfWork::flattenIdentifier for use in BasicEntityPersister.

In BasicEntityPersister::fetchVersionValue I have added a line to flatten the id's before fetching the version value.

Without this change, an entity with a OneToOne relationship defined as an Id, with a Version property, could not be created. Rather than trying to use the ID in the query to select the version, the related entity was being passed.






[DDC-3246] [GH-1103] Update Expr.php Created: 09/Aug/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

adding NOT EXISTS statement



 Comments   
Comment by Doctrine Bot [ 18/Aug/14 ]

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





[DDC-3250] [GH-1106] Fixed multiple table inheritance loading from middle tables when using b... Created: 11/Aug/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Incomplete Votes: 0
Labels: None


 Description   

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

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

Message:

...ase table as source

Simply said when u use doctrine multiple table inheritance and depth is more then 2, doctrine ignores middle tables and does not load their data, this seems to fix the problem.



 Comments   
Comment by Doctrine Bot [ 12/Aug/14 ]

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





[DDC-3251] Segmentation fault in ClassMetadataInfo.php Created: 12/Aug/14  Updated: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Kshitij Parajuli Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Linux dev1 3.9.9-302.fc19.x86_64 #1 SMP Sat Jul 6 13:41:07 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Fedora release 19 (Schrödinger’s Cat)

PHP 5.5.14 (cli) (built: Jul 16 2014 11:41:07)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

Doctrine Command Line Interface version 2.3.6-DEV



 Description   

I'm seeing a segfault when doing a EntityManager->merge(). Specifically, when on this line in ClassmetadataInfo.php. Details below.

$value = $this->reflFields[$this->identifier[0]]->getValue($entity);

/var/log/messages

Aug 12 08:39:01 dev1 kernel: [62152.629221] php[3539]: segfault at f434172bd1 ip 00007ff432c3aae9 sp 00007fffa060b1b0 error 4 in php[7ff4329e7000+38c000]

strace

--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xc4f1053d11} ---
+++ killed by SIGSEGV ++

gdb backtrace:

(gdb) bt
#0  0x00007f8c8f5ceae9 in zend_std_read_property ()
#1  0x00007f8c8f5b61d7 in zend_read_property ()
#2  0x00007f8c8f4ab66e in zim_reflection_property_getValue ()
#3  0x00007f8c8f59a4ab in dtrace_execute_internal ()
#4  0x00007f8c8abb9a46 in xdebug_execute_internal () from /usr/lib64/php/modules/xdebug.so
#5  0x00007f8c8f65a895 in zend_do_fcall_common_helper_SPEC ()
#6  0x00007f8c8f5d45c8 in execute_ex ()
#7  0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#8  0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#9  0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#10 0x00007f8c8f5d45c8 in execute_ex ()
#11 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#12 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#13 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#14 0x00007f8c8f5d45c8 in execute_ex ()
#15 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#16 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#17 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#18 0x00007f8c8f5d45c8 in execute_ex ()
#19 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#20 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#21 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#22 0x00007f8c8f5d45c8 in execute_ex ()
#23 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#24 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#25 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#26 0x00007f8c8f5d45c8 in execute_ex ()
#27 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#28 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#29 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#30 0x00007f8c8f5d45c8 in execute_ex ()
#31 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#32 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#33 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#34 0x00007f8c8f5d45c8 in execute_ex ()
#35 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#36 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#37 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#38 0x00007f8c8f5d45c8 in execute_ex ()
#39 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#40 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#41 0x00007f8c8f659852 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER ()
#42 0x00007f8c8f5d45c8 in execute_ex ()
#43 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#44 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#45 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#46 0x00007f8c8f5d45c8 in execute_ex ()
#47 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#48 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#49 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#50 0x00007f8c8f5d45c8 in execute_ex ()
#51 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#52 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
---Type <return> to continue, or q <return> to quit---
#53 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#54 0x00007f8c8f5d45c8 in execute_ex ()
#55 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#56 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#57 0x00007f8c8f659852 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER ()
#58 0x00007f8c8f5d45c8 in execute_ex ()
#59 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#60 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#61 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#62 0x00007f8c8f5d45c8 in execute_ex ()
#63 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#64 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#65 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#66 0x00007f8c8f5d45c8 in execute_ex ()
#67 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#68 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#69 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#70 0x00007f8c8f5d45c8 in execute_ex ()
#71 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#72 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#73 0x00007f8c8f659852 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER ()
#74 0x00007f8c8f5d45c8 in execute_ex ()
#75 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#76 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#77 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#78 0x00007f8c8f5d45c8 in execute_ex ()
#79 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#80 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#81 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#82 0x00007f8c8f5d45c8 in execute_ex ()
#83 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#84 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#85 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#86 0x00007f8c8f5d45c8 in execute_ex ()
#87 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#88 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#89 0x00007f8c8f659852 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER ()
#90 0x00007f8c8f5d45c8 in execute_ex ()
#91 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#92 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#93 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#94 0x00007f8c8f5d45c8 in execute_ex ()
#95 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#96 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#97 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#98 0x00007f8c8f5d45c8 in execute_ex ()
#99 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#100 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#101 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
#102 0x00007f8c8f5d45c8 in execute_ex ()
#103 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
#104 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
#105 0x00007f8c8f5abed0 in zend_execute_scripts ()
---Type <return> to continue, or q <return> to quit---
#106 0x00007f8c8f54bc65 in php_execute_script ()
#107 0x00007f8c8f65c8a8 in do_cli ()
#108 0x00007f8c8f436420 in main ()

xdebug trace:

   54.4457   16731856                                           -> Tekelec\DVAT\Service\TagService->createTag() /home/vagrant/dvat/library/Tekelec/DVAT/Service/TagService.php:51
   54.4457   16731856                                             -> Doctrine\ORM\EntityManager->merge() /home/vagrant/dvat/library/Tekelec/DVAT/Service/TagService.php:28
   54.4457   16731904                                               -> is_object() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:632
   54.4457   16731856                                               -> Doctrine\ORM\EntityManager->errorIfClosed() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:636
   54.4457   16731856                                               -> Doctrine\ORM\UnitOfWork->merge() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:638
   54.4458   16731992                                                 -> Doctrine\ORM\UnitOfWork->doMerge() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1701
   54.4458   16732136                                                   -> spl_object_hash() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1744
   54.4458   16732448                                                   -> get_class() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1752
   54.4458   16732496                                                   -> Doctrine\ORM\EntityManager->getClassMetadata() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1752
   54.4458   16732496                                                     -> Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:268
   54.4458   16732448                                                   -> Doctrine\ORM\UnitOfWork->getEntityState() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1760
   54.4458   16732496                                                     -> spl_object_hash() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1367
   54.4458   16732400                                                   -> Doctrine\ORM\Mapping\ClassMetadataInfo->getIdentifierValues() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1766
   54.4458   16732448                                                     -> ReflectionProperty->getValue() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:672

The reproducing steps are complicated and require propriety code, but this happens most of the time (80+ percent).

Here is the php bug for this: https://bugs.php.net/bug.php?id=67828



 Comments   
Comment by Marco Pivetta [ 12/Aug/14 ]

Did you try clearing your opcode caches? Is this reproducible in insulated environment?

Comment by Kshitij Parajuli [ 12/Aug/14 ]

Yes, I tried clearing the opcode caches (and clearing proxies and restarting the server). This was also reproducible in multiple servers (one production and one development).

It is not yet reproducible in isolated environment, but I am looking at it. Will update the ticket if I find easy reproducing steps.

Comment by Benjamin Eberlei [ 12/Aug/14 ]

Please try without xdebug, this is enabled according to stacktrace.





[DDC-3255] findOneBy return null even sql returns result Created: 15/Aug/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Minor
Reporter: Tomasz Ślązok Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

I have some nasty tables from some engineer project.
In tables there is temperature column with type varchar(255). Values in this column are from "0.000" to "99.000"

I try to get one object with findOneBy method but always get null

$repository->findOneBy(['temp' => 43]); will return null
$repository->findOneBy(['temp' => '43.000']) will return proper object

both option generate sql that return object (tested with symfony2 profiler an mysql server)

currently I'm using number_format function as workaround



 Comments   
Comment by Marco Pivetta [ 18/Aug/14 ]

This is a type-conversion issue that depends on how you are dealing with your data. The ORM has nothing to do with it.





[DDC-3257] [GH-1112] DefaultRepositoryFactory: single repository for aliased entities Created: 18/Aug/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
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: None


 Description   

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

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

Message:

The actual implementation of ``DefaultRepositoryFactory`` create multiple instances for a single entity if is accessed by multiple namespace aliases.

I've patched ``DefaultRepositoryFactory::getRepository`` so that aliases are resolved before saving the reference into the ``repositoryList``.

Just to not affect performance of existing implementation, I've added to the ``repositoryList`` both the aliased class name and the fully-qualified class name, but only the latter is required.



 Comments   
Comment by Doctrine Bot [ 18/Aug/14 ]

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

Comment by Doctrine Bot [ 18/Aug/14 ]

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





[DDC-3256] supperclass constructor Created: 16/Aug/14  Updated: 18/Aug/14  Resolved: 18/Aug/14

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

Type: Bug Priority: Major
Reporter: Jurj Alin Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

I have just noticed that when using a supperclass and i have a __construct() defined in it where i'm initializing a collection, the construct is not called, which is strange. Same happens for the supperclass and the entity itself.
My guess is that there is a problem on the proxies ?



 Comments   
Comment by Jurj Alin [ 18/Aug/14 ]

it was a problem with private/protected members





[DDC-886] Mapped Supperclass composite identifier is ignored in child class Created: 21/Nov/10  Updated: 16/Aug/14  Resolved: 27/Nov/10

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: Git Master
Fix Version/s: 2.0-RC1
Security Level: All

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

all



 Description   

Currently $class->isIdentifierComposite value stays "false" if no new identifiers were added on child class..

patch proposal:
around line 270, file: ClassMetadataFactory.php

add line:
$class->isIdentifierComposite = $parent->isIdentifierComposite;

this way if supperclass had composite identifier and child had none identifiers
the result would be as suspected.



 Comments   
Comment by Benjamin Eberlei [ 27/Nov/10 ]

Schedule for RC1

Comment by Benjamin Eberlei [ 27/Nov/10 ]

Fixed





[DDC-2438] [GH-661] Update annotations-reference.rst Created: 09/May/13  Updated: 15/Aug/14  Resolved: 09/May/13

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

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


 Description   

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

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

Message:

Added missing @JoinColumns in the index



 Comments   
Comment by Doctrine Bot [ 09/May/13 ]

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

Comment by Doctrine Bot [ 15/Aug/14 ]

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

Comment by Doctrine Bot [ 15/Aug/14 ]

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





[DDC-3254] [GH-1111] Fix inheritance hierarchy wrong exception message Created: 15/Aug/14  Updated: 15/Aug/14  Resolved: 15/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Hi,

I've fixed this exception message.

It is only throws when trying to make a query with an entity which is not defined in the discriminator mapping here: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L2075



 Comments   
Comment by Doctrine Bot [ 15/Aug/14 ]

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

Comment by Doctrine Bot [ 15/Aug/14 ]

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





[DDC-3253] [GH-1110] Changed table name to be more appropriate. Created: 15/Aug/14  Updated: 15/Aug/14  Resolved: 15/Aug/14

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

Type: Documentation Priority: Minor
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Docs stated that this code `$article = $em->find('Article', 1);` executes a single select against the user, when we probably wanted articles.



 Comments   
Comment by Doctrine Bot [ 15/Aug/14 ]

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





[DDC-3146] Hydrator memory leak when using iterator Created: 30/May/14  Updated: 14/Aug/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3.2, 2.3.5, 2.4.2
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Emiel Nijpels Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 1
Labels: hydrator, leak, memory
Environment:

PHP 5.4.21, OS X 10.9.3; PHP 5.3.28, OS X 10.9.4



 Description   

When the hydrator iterate() function is invoked, a new event is added to the event manager with a reference to the current hydrator object. This reference is never cleared which causes the hydrator object to never be cleared from memory by the PHP garbage collection.

/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
$evm = $this->_em->getEventManager();
$evm->addEventListener(array(Events::onClear), $this);

The effects of this bug are best visible when creating multiple iterator objects after each other in a repository:

// Loop through test code 10 times
for ($f = 0; $f < 10; $f++) {
    // Create test query
    $query = $this->createQueryBuilder('p')->getQuery();

    // Create IterableResult object
    $iterableResult = $query->iterate();

    // Loop through the iterator
    foreach ($iterableResult as $row) {}

    // Print out memory usage
    print(memory_get_usage() . PHP_EOL);
}

This results in the following output:

10536552
10549920
10563288
10576664
10590040
10603416
10616792
10630168
10643608
10656984

Notice how the used memory increases by about 13KB after each iteration.
To stop this memory leak the following code can be added to the end of the cleanup() function in the AbstractHydrator class:

$evm = $this->_em->getEventManager();
$evm->removeEventListener(array(Events::onClear), $this);

The output is now:

10537920
10537048
10537048
10537048
10537048
10537048
10537048
10537048
10537048
10537048

The reference to the event manager is now automatically removed in the cleanup function which allows the hydrator object to be cleaned up by the garbage collection function in PHP.



 Comments   
Comment by Jeremiah Johnson [ 12/Aug/14 ]

I'm experiencing the same problem on 2.3.2

Comment by Jeremiah Johnson [ 14/Aug/14 ]

Tested latest of 2.3.x (2.3.5) and problem still exists.

Comment by Marco Pivetta [ 14/Aug/14 ]

Jeremiah Johnson can you provide a PR with the fix and a test?





[DDC-3120] Warning: Erroneous data format for unserializing PHP5.6+ Created: 11/May/14  Updated: 14/Aug/14

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

Type: Bug Priority: Critical
Reporter: Cornelis Brouwers Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: mapping, orm
Environment:

Webserver Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.6.0beta2

and

PHP-CLI (Win32) PHP/5.6.0beta2


Issue Links:
Duplicate
is duplicated by DDC-3252 [GH-1109] DDC-3120 - PHP 5.6-RC3 comp... Resolved

 Description   

Hi all,

There seems to be something strange going on in the method newInstance() of the class \Doctrine\ORM\Mapping\ClassMetadataInfo.

The original class method looks like this:

\Doctrine\ORM\Mapping\ClassMetadataInfo#newInstance()

    {
        if ($this->_prototype === null) {
            $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
        }

        return clone $this->_prototype;
    }

What happens now when a class that implements \Serializable is that a "Warning: Erroneous data format for unserializing" shows up and the function unserialize() returns false.

That is because a class that implements \Serializable is expected to have the letter 'C' in the serialize string instead of the letter 'O'.

I've made a quick work-around like this:

\Doctrine\ORM\Mapping\ClassMetadataInfo#newInstance()

    {
        if ($this->_prototype === null) {
            $this->_prototype = @unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
            if ($this->_prototype === false) {
                $this->_prototype = unserialize(sprintf('C:%d:"%s":0:{}', strlen($this->name), $this->name));
            }
        }

        return clone $this->_prototype;
    }

That seems to work in my isolated tests and with Symfony2 and Doctrine2 and FOSUserBundle together.

I've noticed this because the Model\User class from FOSUserBundle implements \Serializable.

I had to implement a check in Model\User class because when using 'C:%d:"%s":0:{}' the $serialized parameter of the unserialize method in the Model\User class is a empty string then.

That warning seems only to happen with PHP5.6+. PHP5.5.12 and below doesn't show that warning.

I hope someone can shine some light on this, thank you,

Cornelis.



 Comments   
Comment by Marco Pivetta [ 11/May/14 ]

Indeed, for PHP 5.4+ we should use

ReflectionClass#newInstanceWithoutConstructor()
Comment by Cornelis Brouwers [ 11/May/14 ]

Just tested it. That works as expected, far more better then the dirty hacks I did, thanks a lot!

Any idea when this would be implemented into the code?

Comment by Marco Pivetta [ 11/May/14 ]

Send a pull request and I'll merge it later today (we could also need a failing test with an entity implementing the Serializable interface)

Comment by Evert Harmeling [ 30/May/14 ]

Seems to be a problem in the latest PHP 5.4 version too.

https://github.com/doctrine/doctrine2/pull/1045/

Comment by Doctrine Bot [ 30/May/14 ]

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

Comment by Julian Reyes Escrigas [ 02/Jun/14 ]

I am facing this same error i have PHP 5.5.13, I'm using Symfony, Doctrine ORM and FOSUserBUndle

Comment by Marco Pivetta [ 02/Jun/14 ]

Julian Reyes Escrigas the patch landed in master (2.5.x) for now.

Comment by Marco Pivetta [ 02/Jun/14 ]

Merged via DDC-3147

Comment by Thomas Buhk [ 04/Jun/14 ]

When can we expect the version with this bugfix?

Comment by Anthony Rey [ 08/Jun/14 ]

Why don't you tag 2.4.3 version with this fix ? Because the error is already present in PHP 5.5.13 which is a stable version and it's a blocking issue when you're using FOSUserBundle for example. There is also no opened issue refering this version and the due date is in april.

Comment by Jovan Perovic [ 19/Jun/14 ]

I'm still seeing this bug, although my PHP_VERSION_ID is 50600

So, version based condition is no good...

Comment by Marco Pivetta [ 19/Jun/14 ]

The approach to be taken for 50600 is still under discussion in php-internals.

Comment by Cornelis Brouwers [ 20/Jun/14 ]

Hi all,

I've just downloaded PHP5.6RC1 and updated doctrine and the error is back indeed.

A little peek at the code starting on line 866 of file Doctrine\ORM\Mapping\ClassMetadataInfo.php shows this:

    public function newInstance()
    {
        if ($this->_prototype === null) {
            if (PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513) {
                $this->_prototype = $this->reflClass->newInstanceWithoutConstructor();
            } else {
                $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
            }
        }

        return clone $this->_prototype;
    }

As can be seen, PHP5.6 is out of the picture, it only checks for the exact versions 5.4.29 and 5.5.13.

So for the code to work correctly on PHP5.6 one can add PHP5.6 to the test condition, or just skip the test all together if you don't mind the old PHP5.3. According to PHP, ReflectionClass::newInstanceWithoutConstructor is available since PHP >= 5.4.0.

Greetings, Cornelis.

Comment by Marco Pivetta [ 21/Jun/14 ]

As I already pointed out, this is still being discussed in php internals. See http://news.php.net/php.internals/75009

This won't be dealt with in 5.6 until there's either a stable release or internals decides what has to be done.

Comment by Marco Pivetta [ 21/Jun/14 ]

Also, ReflectionClass#newInstanceWithoutConstructor() still doesn't cover the pre-existing "hack" using unserialize, so we're still waiting for a reliable API from PHP core.

Comment by Chase Noel [ 23/Jul/14 ]

Using PHP 5.6RC2 and ORM 2.4.4 I am still experiencing this issue. I have also tested with PHP 5.5.15 and I am still getting the issue. Do i need to be using a different build of ORM to have the fix applied?

Comment by pascall [ 23/Jul/14 ]

Hi,
I'm using 5.6.0beta3 and ORM 2.4.4 and i have the same probleme
Warning: Erroneous data format for unserializing .. in orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php line 872

and in current code in ClassMetadataInfo.php line 872 is :

public function newInstance()
{
if ($this->_prototype === null) {
if (PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513)

{ $this->_prototype = $this->reflClass->newInstanceWithoutConstructor(); }

else {
$this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
}
}

return clone $this->_prototype;
}

Comment by Evert Harmeling [ 23/Jul/14 ]

As stated by Marco Pivetta; "This won't be dealt with in 5.6 until there's either a stable release or internals decides what has to be done.". And besides that 5.6 still is in development, not stable.
If you still want to use 5.6 you can fork the code and extend the 5.4 / 5.5 check to support 5.6.

Comment by Chase Noel [ 23/Jul/14 ]

5.6 has an RC which should mean a stable API, and that only bugs will be fixed before an official stable release?

Comment by Evert Harmeling [ 23/Jul/14 ]

Looking at http://news.php.net/php.internals/75966 it's still being discussed, and they are planning to have it fixed in RC3.

Comment by Marco Pivetta [ 23/Jul/14 ]

Internals still didn't get to a clear decision. Until then, we won't support 5.6 officially.

Comment by Ronan [ 24/Jul/14 ]

Same error encountered with PHP 5.5.13 (cli) (built: May 30 2014 10:43:29)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

(PHP 5.5 installed via http://php-osx.liip.ch/)

Comment by Marco Pivetta [ 24/Jul/14 ]

Ronan what D2 version? We fixed it for 2.4.x (temporarily)

Comment by Ronan [ 24/Jul/14 ]

My bad: reading my composer.lock: doctrine/orm, v2.4.2, ref 0363a5548d9263f979f9ca149decb9cfc66419ab, "time": "2014-02-08 16:35:09"... Well.. this is was an old one !

`composer update` fixed it. Sorry for disturbing.

Comment by Chase Noel [ 12/Aug/14 ]

Im still getting this error running php 5.6RC2 and the dev-master(6ac19b04bfbd7a97aad5ed8c2abd6279ff5e0022) build of D2/orm. Am i missing something?

Comment by Marco Pivetta [ 12/Aug/14 ]

This was semi-fixed in PHP5.6-RC3, and it will be patched into ORM once doctrine/instantiator is out

Comment by Chase Noel [ 12/Aug/14 ]

Ok good to know. Thanks

Comment by Marco Pivetta [ 13/Aug/14 ]

Not yet fixed for PHP 5.6

Comment by Marco Pivetta [ 14/Aug/14 ]

Provided a hotfix proposal at https://github.com/doctrine/doctrine2/pull/1109 - please check it out with PHP 5.6.0-RC3 or later





[DDC-3252] [GH-1109] DDC-3120 - PHP 5.6-RC3 compatibility Created: 14/Aug/14  Updated: 14/Aug/14  Resolved: 14/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates DDC-3120 Warning: Erroneous data format for un... Reopened

 Description   

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

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

Message:

This PR replaces the current serialization hack used by doctrine with the polyfill provided by [`doctrine/instantiator`](https://github.com/doctrine/instantiator).

This will allows users of PHP 5.6 to rely on entities extending internal PHP classes again.






[DDC-2437] [GH-660] Fixed critical bug with position indexBy in DQL Created: 08/May/13  Updated: 13/Aug/14  Resolved: 09/May/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 09/May/13 ]

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

Comment by Doctrine Bot [ 13/Aug/14 ]

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





[DDC-2433] [GH-659] [wip] Pr mapping import Created: 07/May/13  Updated: 12/Aug/14  Resolved: 09/May/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

fix 5 bug of command 1.doctrine:mapping:import then 2.doctrine:schema:update

  • column default
  • column unsigned
  • column type char
  • table without auto_increment
  • column comment

wip -> follow rule of contribute to doctrine

  • add patch on master
  • add test


 Comments   
Comment by Benjamin Eberlei [ 09/May/13 ]

Pull Request was deleted.

Comment by Doctrine Bot [ 12/Jun/13 ]

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

Comment by Doctrine Bot [ 12/Aug/14 ]

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

Comment by Doctrine Bot [ 12/Aug/14 ]

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





[DDC-3249] [GH-1105] Add support for nesting embeddables Created: 11/Aug/14  Updated: 12/Aug/14

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

This is a possible approach towards adding support for nesting embeddables (embeddables inside embeddables). I'm not sure whether this implementation is the best solution but I think it is something to start with. It seems to work flawlessly so far but I'm not sure if I missed something, so any feedback is welcome






[DDC-3247] ClassMetadataFactory calling Platform methods missing in the interface Created: 11/Aug/14  Updated: 11/Aug/14  Resolved: 11/Aug/14

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

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


 Description   

see https://github.com/doctrine/doctrine2/commit/337857dc8a77b443d9f93f8f74f728eceb96421b

Discovered this after using wizad/doctrine-doc-bundle



 Comments   
Comment by Lukas Kahwe [ 11/Aug/14 ]

requires DBAL master (or 2.5.x)





[DDC-3248] PreUpdateEventArgs::setNewValue() does not update Entity state Created: 11/Aug/14  Updated: 11/Aug/14

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

Type: Bug Priority: Major
Reporter: Lukas Kahwe Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

see https://github.com/doctrine/doctrine2/commit/bc6714c2c8d015cb2e3ae198fcb1b98b3bbe35e0#commitcomment-7329820

as well as https://github.com/doctrine/phpcr-odm/pull/539#discussion_r16027731






[DDC-3245] [GH-1102] Update EntityRepository.php Created: 09/Aug/14  Updated: 10/Aug/14  Resolved: 10/Aug/14

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

Type: Improvement Priority: Minor
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

Add ability to generate classMetadata without push it in constructor






[DDC-2235] Single table inheritance discriminator in WHERE when using arbitrary join syntax Created: 11/Jan/13  Updated: 09/Aug/14  Resolved: 16/Aug/13

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

Type: Bug Priority: Major
Reporter: Jordi Forns Assignee: Guilherme Blanco
Resolution: Fixed Votes: 6
Labels: None

Issue Links:
Duplicate
duplicates DDC-1940 Doctrine DQL: erroneous sql generatio... Resolved

 Description   

The condition on the discriminator column is placed in the WHERE clause when using arbitrary join syntax, which renders LEFT JOINs useless.

Given these classes:
A - no inheritance
B1 - abstract, root of a hierarchy, discriminator column is named 'type'
I setup a query builder like this:

$qb->select('a.id AS idA, b.id AS idB')
    ->from('\Entity\A', 'a')
    ->leftJoin('\Entity\B1', 'b', \Doctrine\ORM\Query\Expr\Join::WITH, 'a.something=b.something');
And the SQL Doctrine generates is something like this:
SELECT a.id, b.id FROM a LEFT JOIN b ON (a.something=b.something) WHERE b.type IN ('1', '2', '3')

The problems is that the WHERE condition makes the left join useless.

The condition on the discriminator column should be placed in the JOIN clause to avoid the problem.



 Comments   
Comment by Ondrej Hlavaty [ 10/Feb/13 ]

Can this be somehow worked around? If not, it is really serious problem...

Comment by Jordi Forns [ 18/Feb/13 ]

I couldn't find any workaround.
Trying to force the 'type' condition in the join clause resulted useless as Doctrine would add the 'where' condition regardless.

Comment by Michel Salib [ 22/Mar/13 ]

Easier way to workaround right now, is to declare a OneToMany from class A to class B on a protected field (no need of getter or setter). That way you can do classic join via relationship transversing and then the condition will be placed in the ON part of the query.

Comment by Yuta Konishi [ 01/Apr/13 ]

I could access with below codes. You should use RAW SQL it is easy solution I guess. good luck.

$qb = $em->createQueryBuilder();

$qb->select('a, b')
->from('YourEntity1', 'a')
->leftJoin('YourEntity2', 'b', \Doctrine\ORM\Query\Expr\Join::WITH, 'a.id = b.relationId');

$raw_sql = $qb->where( 
	$qb->expr()->in('a.relationId', $ids)
)
->orderBy('a.updatedAt', 'DESC')
->setMaxResults(10)
->getQuery()->getSQL();

$conn = $em->getConnection();
$stmt = $conn->query($raw_sql);

/* $stmt->fetchAll(); // access as Array */
Comment by Benjamin Eberlei [ 04/Apr/13 ]

Assigned to Alexander

Comment by Benjamin Eberlei [ 14/Apr/13 ]

Duplicate of DDC-1940

Comment by Jordi Forns [ 22/Apr/13 ]

Benjamin: this bug doesn't seem to be a dupe of DDC-1940. Actually that issue doesn't seem to be a bug at all.

As a reminder, the problem in this issue is that when performing arbitrary left joins on entities that are part of a class hierarchy, the discriminator condition is placed in the where clause instead of the join clause. This means that rows that could not be joined will have null values in the discriminator column and thus will not be returned because of the where condition (which will contain something like " where x.discriminator in (1,2,3) ").

Comment by Tom Arnfeld [ 27/Apr/13 ]

Has this issue been resolved elsewhere? From reading over DDC-1940 it doesn't seem to be a duplicate at all. I'm experiencing the same problem as Jordi and can't seem to find a solution. Is there any particular reason the `IN ()` predicate is not a part of the join, but instead placed in the main `WHERE` clause?

Comment by Tom Arnfeld [ 28/Apr/13 ]

I've been looking into the root cause of this bug (or feature..) to try and understand why it's happening, and after trying various possible fixes (a little hard without full understanding of the Doctrine/Query internals) I've ended up with a fix that seems to work well for my use case, at least. I've not run any of the unit tests (I plan to, and may adjust my fix based on that) but the top revision is my change... https://gist.github.com/tarnfeld/a6bb50ec707c7af1c5dc/revisions

Would love some feedback.

Pull request here: https://github.com/doctrine/doctrine2/pull/656

Comment by Jordi Forns [ 29/Apr/13 ]

Tom's fix moves the condition of the discriminator column to the LEFT JOIN, which is exactly what was needed.

Alexander: could you please give it a look?

Comment by Jordi Forns [ 23/May/13 ]

Tom's proposal seems to fix the issue.

Comment by Gordon Forsythe [ 11/Jun/13 ]

Agree, Tom's pull request looks like it fixes the issue. Is there a reason this hasn't been merged yet?

Comment by Gordon Forsythe [ 24/Jun/13 ]

I believe this may have been fixed by #DDC-2506 but I haven't tested it yet.
There is a pull request for it https://github.com/doctrine/doctrine2/pull/708 and there has been recent activity.
Disregard, not related.

Comment by Tom Arnfeld [ 24/Jun/13 ]

The two don't seem to be at all related to me, or maybe i'm missing something? Also, this PR has been open for two months, with no sign of being merged :/

Comment by Doctrine Bot [ 13/Aug/13 ]

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

Comment by Benjamin Eberlei [ 13/Aug/13 ]

Gordon Forsythe I don't like your tone. This is an open-source project and we do this in our free time. Please respect that we cannot offer specific response times at all.

Comment by Doctrine Bot [ 16/Aug/13 ]

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

Comment by Marco Pivetta [ 16/Aug/13 ]

Fixed at https://github.com/doctrine/doctrine2/commit/605c32dbb384e25117625a7cb4db4e7319a16bae ( https://github.com/doctrine/doctrine2/pull/758 )

Comment by Benjamin Eberlei [ 20/Aug/13 ]

merged into 2.4

Comment by Doctrine Bot [ 09/Aug/14 ]

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





[DDC-2497] When trying to join single-table inheritance classes in DQL or QueryBuilder, Doctrine creates incorrect SQL Created: 10/Jun/13  Updated: 09/Aug/14  Resolved: 11/Jun/13

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

Type: Bug Priority: Major
Reporter: Gordon Forsythe Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None
Environment:

PHP5.4, Mysql stable, ubuntu 12.04



 Description   

When writing a DQL query joining to inherited subclasses, Doctrine incorrectly injects the discriminator in the WHERE clause instead of in the JOIN, where it should be.
Example: 2 classes extend Person via JOINED table inheritance: EmployedPerson and UnemployedPerson. I want to create a query where I pull separate class-specific properties form each class:

SELECT p FROM Person p
LEFT JOIN EmployedPerson ep WITH ep=p
LEFT JOIN UnemployedPerson up WITH up=p

The SQL from this will look something like:
SELECT .... FROM person p
LEFT JOIN person ep ON(ep.id=p.id)
LEFT JOIN person up ON(up.id=p.id)
WHERE ep.discrim IN('employed') AND up.discrim IN('unemployed')

The problem is this query will produce no results if one of the subclasses have no results.

The fix would be putting the discriminator in the JOIN so the sql would be:

SELECT .... FROM person p
LEFT JOIN person ep ON(ep.id=p.id AND ep.discrim IN('employed'))
LEFT JOIN person up ON(up.id=p.id AND up.discrim IN('unemployed'))

I will try to create a unit test based on the current ones and upload it.



 Comments   
Comment by Gordon Forsythe [ 10/Jun/13 ]

Sorry, this is a duplicate of http://www.doctrine-project.org/jira/browse/DDC-2235
I don't see where to mark as dupe...

Comment by Marco Pivetta [ 11/Jun/13 ]

Duplicate of DDC-2235

Comment by Doctrine Bot [ 16/Aug/13 ]

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

Comment by Doctrine Bot [ 16/Aug/13 ]

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

Comment by Doctrine Bot [ 09/Aug/14 ]

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





[DDC-2614] [GH-758] Fixed DDC-2235. Created: 16/Aug/13  Updated: 09/Aug/14  Resolved: 16/Aug/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None


 Description   

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

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

Message:

Replaces #656



 Comments   
Comment by Doctrine Bot [ 16/Aug/13 ]

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

Comment by Doctrine Bot [ 16/Aug/13 ]

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

Comment by Marco Pivetta [ 16/Aug/13 ]

Duplicate of DDC-2235

Comment by Doctrine Bot [ 09/Aug/14 ]

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





[DDC-2420] [GH-656] [DDC-2235] Fix for using a LEFT JOIN onto an entity with single table inheritance Created: 28/Apr/13  Updated: 09/Aug/14  Resolved: 16/Aug/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Incomplete Votes: 0
Labels: None


 Description   

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

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

Message:

Possible fix for the bug DDC-2235. I'd love to hear some opinions on whether this is the right way to go about this issue. I'm not particularly familiar with the internals of doctrine so there may be a better solution.

------

The issue is when using DQL to perform a left join on an entity using single
table inheritance, doctrine tries to insert an `IN()` predicate into the `WHERE`
clause for all of the discriminator values. That makes sense and is valid, so
it would be wrong to remove that behaviour.

However when using a left join having an `IN()` in the main where clause makes
the `LEFT JOIN` pretty much useless, as it implicitly creates a `WHERE NOT NULL`
clause. This commit attempts to fix that by including an `OR IS NULL` in the
query if the join is a `LEFT JOIN`.

I've added some regression tests to ensure this bug never creeps back in. They fail on master (highlighting the bug) and pass after these commits have been applied. I've also included a couple of other queries as tests to be sure only this one case has been affected.



 Comments   
Comment by Doctrine Bot [ 16/Aug/13 ]

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

Comment by Doctrine Bot [ 16/Aug/13 ]

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

Comment by Marco Pivetta [ 16/Aug/13 ]

Handled in https://github.com/doctrine/doctrine2/pull/758 ( DDC-2235 )

Comment by Doctrine Bot [ 09/Aug/14 ]

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





[DDC-3244] [GH-1101] Adding ` quote into INSERT SQL statement Created: 08/Aug/14  Updated: 08/Aug/14  Resolved: 08/Aug/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

It is not working for table names which are the same as SQL keywords (such as `order`).

Getting exception:

Doctrine\DBAL\DBALException
An exception occurred while executing 'INSERT INTO order ( ... ) VALUES ( ... )' with params [ ... ]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order ( ... , ' at line 1

Solved by adding quotes.



 Comments   
Comment by Doctrine Bot [ 08/Aug/14 ]

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





[DDC-2377] [GH-636] Fixed typos in documentation. Created: 28/Mar/13  Updated: 08/Aug/14  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:

Hello again everyone! I went ahead and fixed the rest of the instances in the documentation that used 'an SQL'. I also fixed an instance of 'a alias' to be 'an alias', which is proper since alias begins with a vowel.



 Comments   
Comment by Benjamin Eberlei [ 28/Mar/13 ]

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

Comment by Doctrine Bot [ 08/Aug/14 ]

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





[DDC-3242] Initialize the type array Created: 07/Aug/14  Updated: 07/Aug/14  Resolved: 07/Aug/14

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

Type: Documentation Priority: Major
Reporter: bilou gagou Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: documentation, orm, postgresql
Environment:

windows



 Description   

Hi there,

I'm having issues with initializing a field in one of my entities whose type is array. Could you just give an example where an array field is initilized with this value for instance (array('un' => 'one', 'deux' => 'two', 'trois' => 'three'))? Because I can't find anything about the array type initilization. Thanks a lot



 Comments   
Comment by Marco Pivetta [ 07/Aug/14 ]

You just set it in your entities:

class Foo
{
    private $id;
    private $someArrayField;

    public function __construct()
    {
        $this->someArrayField = ['un' => 'one', 'deux' => 'two', 'trois' => 'three'];
    }
}
Comment by bilou gagou [ 07/Aug/14 ]

Ok thanks, I thought of initializing into the annotations as for the other types.





[DDC-1695] SQLs for PostgreSQL case sensite tables/fields are wrongly generated Created: 09/Mar/12  Updated: 06/Aug/14

Status: Reopened
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.1.6, 2.4.2
Fix Version/s: 2.1.7, 2.2.2
Security Level: All

Type: Bug Priority: Major
Reporter: Ignacio Larranaga Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: None
Environment:

PostgreSQL 9.x, Symfony 2


Attachments: Text File doctrine-2.1.6.patch     Text File SqlWalker.patch    

 Description   

The SQLs for case sensitive schemas in postgreSQL are wronly generated.

Example:
Schema:

CREATE TABLE "News" (
  "IdNews" serial NOT NULL,
  "IdUser" bigint NOT NULL,
  "IdLanguage" integer NOT NULL,
  "IdCondition" integer,
  "IdHealthProvider" integer,
  "IdSpeciality" integer,
  "IdMedicineType" integer,
  "IdTreatment" integer,
  "Title" character varying,
  "SmallText" character varying,
  "LongText" character varying,
  "PublishDate" timestamp with time zone,
  "IdxNews" tsvector,
  "Highlight" boolean NOT NULL DEFAULT false,
  "Order" integer NOT NULL DEFAULT 0,
  "Deleted" boolean NOT NULL DEFAULT false,
  "Active" boolean NOT NULL DEFAULT false,
  "UpdateToHighlighted" boolean DEFAULT false,
  CONSTRAINT "News_pkey" PRIMARY KEY ("IdNews" ));

Object (I added quotes trying to generate the SQLs quoted.:

<?php

namespace GlobalTreatments\ApplicationBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table(name="""News""")
 * @ORM\Entity
 */
class News
{
    /**
     * @var integer $idNews
     *
     * @ORM\Column(name="""IdNews""", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(sequenceName="""News_IdNews_seq""", allocationSize="1", initialValue="1")
     */
    private $idNews;

    /**
     * @var bigint $iduser
     *
     * @ORM\Column(name="""IdUser""", type="bigint", nullable=false)
     */
    private $idUser;

    /**
     * @var integer $idLanguage
     *
     * @ORM\Column(name="""IdLanguage""", type="integer", nullable=false)
     */
    private $idLanguage;

    /**
     * @var integer $idCondition
     *
     * @ORM\Column(name="""IdCondition""", type="integer", nullable=true)
     */
    private $idCondition;

    /**
     * @var integer $idHealthProvider
     *
     * @ORM\Column(name="""IdHealthProvider""", type="integer", nullable=true)
     */
    private $idHealthProvider;

    /**
     * @var integer $idSpeciality
     *
     * @ORM\Column(name="""IdSpeciality""", type="integer", nullable=true)
     */
    private $idSpeciality;

    /**
     * @var integer $idMedicineType
     *
     * @ORM\Column(name="""IdMedicineType""", type="integer", nullable=true)
     */
    private $idMedicineType;

    /**
     * @var integer $idTreatment
     *
     * @ORM\Column(name="""IdTreatment""", type="integer", nullable=true)
     */
    private $idTreatment;

    /**
     * @var string $title
     *
     * @ORM\Column(name="""Title""", type="string", nullable=true)
     */
    private $title;

    /**
     * @var string $smallText
     *
     * @ORM\Column(name="""SmallText""", type="string", nullable=true)
     */
    private $smallText;

    /**
     * @var string $longText
     *
     * @ORM\Column(name="""LongText""", type="string", nullable=true)
     */
    private $longText;

    /**
     * @var datetimetz $publishDate
     *
     * @ORM\Column(name="""PublishDate""", type="datetimetz", nullable=true)
     */
    private $publishDate;

    /**
     * @var tsvector $idxNews
     *
     * @ORM\Column(name="""IdxNews""", type="tsvector", nullable=true)
     */
    private $idxNews;

    /**
     * @var boolean $highlight
     *
     * @ORM\Column(name="""Highlight""", type="boolean", nullable=false)
     */
    private $highlight;

    /**
     * @var integer $order
     *
     * @ORM\Column(name="""Order""", type="integer", nullable=false)
     */
    private $order;

    /**
     * @var boolean $deleted
     *
     * @ORM\Column(name="""Deleted""", type="boolean", nullable=false)
     */
    private $deleted;

    /**
     * @var boolean $active
     *
     * @ORM\Column(name="""Active""", type="boolean", nullable=false)
     */
    private $active;

    /**
     * @var boolean $updateToHighlighted
     *
     * @ORM\Column(name="""UpdateToHighlighted""", type="boolean", nullable=true)
     */
    private $updateToHighlighted;

    /**
     * @var condition
     *
     * @ORM\ManyToOne(targetEntity="Condition")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdCondition""", referencedColumnName="""IdCondition""")
     * })
     */
    private $condition;

    /**
     * @var healthProvider
     *
     * @ORM\ManyToOne(targetEntity="HealthProvider")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdHealthProvider""", referencedColumnName="""IdHealthProvider""")
     * })
     */
    private $healthProvider;

    /**
     * @var language
     *
     * @ORM\ManyToOne(targetEntity="Language")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdLanguage""", referencedColumnName="""IdLanguage""")
     * })
     */
    private $language;

    /**
     * @var medicineType
     *
     * @ORM\ManyToOne(targetEntity="MedicineType")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdMedicineType""", referencedColumnName="""IdMedicineType""")
     * })
     */
    private $medicineType;

    /**
     * @var speciality
     *
     * @ORM\ManyToOne(targetEntity="Speciality")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdSpeciality""", referencedColumnName="""IdSpeciality""")
     * })
     */
    private $speciality;

    /**
     * @var treatment
     *
     * @ORM\ManyToOne(targetEntity="Treatment")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdTreatment""", referencedColumnName="""IdTreatment""")
     * })
     */
    private $treatment;

    /**
     * @var user
     *
     * @ORM\ManyToOne(targetEntity="User")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdUser""", referencedColumnName="""IdUser""")
     * })
     */
    private $user;

    ....

}

DQL:

'SELECT n.smallText, n.publishDate ' .
'FROM News n ' .
	'INNER JOIN n.language la ' .
'WHERE la.languageCode = :languageCode ' .
'ORDER BY n.publishDate DESC'

Generated SQL:

SELECT "0_."SmallText" AS "SmallText"0, "0_."PublishDate" AS "PublishDate"1 FROM "News" "0_ INNER JOIN "Language" "1_ ON "0_."IdLanguage" = "1_."IdLanguage" WHERE "1_."LanguageCode" = ? ORDER BY "0_."PublishDate" DESC LIMIT 6

Notice there are unmattched " in the SQL.



 Comments   
Comment by Ignacio Larranaga [ 09/Mar/12 ]

If there is another approach to specify the table/column names are case sensitive in PGSQL please let me know.

Comment by Ignacio Larranaga [ 09/Mar/12 ]

Just to comment. I also tried the normal quoting.

Example: @ORM\Column(name="`IdNews`", type="integer", nullable=false)

And does not work too because of the same reason.

Comment by Ignacio Larranaga [ 09/Mar/12 ]

Hi, I generate this patch and seems to be working for me (at least what I'm testing right now).

I used ´ to quote tables and single attributes (not relationships) and the SQLs are correctly generated.

Comment by Ignacio Larranaga [ 09/Mar/12 ]

Adding a new patch for another files I need to change.

Comment by Benjamin Eberlei [ 11/Mar/12 ]

Formatted code

Comment by Benjamin Eberlei [ 11/Mar/12 ]

Fixed and merged into 2.1.x and 2.2 branches

Comment by Julian Aicardo [ 05/Aug/14 ]

This bug still unresolved for version 2.3.6-DEV included in Symfony 2.3.18.

The patches does not work with this version.

Generated query:

SELECT "0_.id AS id0, "0_."verFirmware" AS verfirmware1, "0_."idEstacion" AS idestacion2, "0_."fechaHora" AS fechahora3, "0_.global AS global4, "0_.directa AS directa5, "0_.difusa AS difusa6, "0_."tempSensDirecta" AS tempsensdirecta7, "0_.vbat1 AS vbat18, "0_.vbat2 AS vbat29, "0_.flags AS flags10, "0_."Estacion" AS estacion11 FROM "RegistroRS" "0_ WHERE "0_."idEstacion" = '1' AND "0_."fechaHora" >= '2014-02-01 03:00:00' AND "0_."fechaHora" <= '2014-08-01 03:00:00'

Notice there are unmattched " in the SQL.

Comment by Marco Pivetta [ 05/Aug/14 ]

Julian Aicardo why are you using 2.3.6-DEV? Shouldn't you use a stable version? Is the bug reproducible also with later versions?

Comment by Julian Aicardo [ 06/Aug/14 ]

After changing to version 2.4.2 the bug still there. The same SQL query was generated.

Comment by Julian Aicardo [ 06/Aug/14 ]

The error occurs when try to get an alias based on case sensitive table name, because the alias is generated with the first character of table's name which is ".
Ex:
Table: car Alias: c0_
Table: "Car" Alias: "0_

Is in file SqlWalker.php line 295 in Doctrine 2.4.4:

SqlWalker.php
public function getSQLTableAlias($tableName, $dqlAlias = '')
{
    $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';
        
    if ( ! isset($this->tableAliasMap[$tableName])) {
        $this->tableAliasMap[$tableName] = strtolower(substr($tableName, 0, 1)) . $this->tableAliasCounter++ . '_';
    }

    return $this->tableAliasMap[$tableName];
}




[DDC-3009] [GH-968] Test: Add failing test Created: 04/Mar/14  Updated: 06/Aug/14  Resolved: 17/Apr/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

It says in http://www.doctrine-project.org/jira/browse/DBAL-446 that this issue has been fixed, but apparently, it hasn't.



 Comments   
Comment by Doctrine Bot [ 17/Apr/14 ]

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

Comment by Guilherme Blanco [ 17/Apr/14 ]

This issue is DBAL related, not ORM.

Comment by Doctrine Bot [ 06/Aug/14 ]

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

Comment by Doctrine Bot [ 06/Aug/14 ]

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





[DDC-2419] [GH-655] [DDC-2409] Fix merge association UnitOfWork::STATE_NEW Created: 28/Apr/13  Updated: 06/Aug/14  Resolved: 01/May/13

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

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


 Description   

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

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

Message:

http://www.doctrine-project.org/jira/browse/DDC-2409



 Comments   
Comment by Doctrine Bot [ 01/May/13 ]

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

Comment by Doctrine Bot [ 06/Aug/14 ]

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

Comment by Doctrine Bot [ 06/Aug/14 ]

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





[DDC-3241] object type fails to save serialized class to postgresql Created: 05/Aug/14  Updated: 05/Aug/14

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

Type: Bug Priority: Major
Reporter: Reno Reckling Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Reference
relates to DBAL-964 [GH-653] Update docs to include warni... Resolved

 Description   

Doctrine 2 fails to properly store data from serialize() into postgresql.
This happens because the postgresql pdo driver truncates text on NULL bytes when escaping values. This leads to truncated serialized objects being inserted into the database.

A ugly but working workaround for us is to call json_encode(serialize()) when saving to the database and unserialize(json_decode()) when reading the value back because json_encode properly serializes the NULL bytes of the serialize() output to readable text.

This is pretty ugly though and it would help if doctrine would provide a minimal encoding/decoding function for postgresql that converts all NULL bytes to something else to not break the object type on postgresql.



 Comments   
Comment by Marco Pivetta [ 05/Aug/14 ]

I'm fairly sure that we don't want to invent our own serialization format. Instead, base64_encode could work.

Due to BC compat, we can't introduce it for 2.x, so it would have to be a completely new type.

Comment by Reno Reckling [ 05/Aug/14 ]

Agreed, we'll just go with base64_encode for now.
Maybe someone should update the documentation that using the object type on postgresql is not working as well as that using binary strings containing a NULL byte in any varchar/text column on postgresql is not working either.

Comment by Marco Pivetta [ 05/Aug/14 ]

Reno Reckling just open a pull request against the doctrine/doctrine2 repository

Comment by Reno Reckling [ 05/Aug/14 ]

Marco Pivetta Here you go: https://github.com/doctrine/dbal/pull/653
http://www.doctrine-project.org/jira/browse/DBAL-964

Thanks for the reply.

Comment by Doctrine Bot [ 05/Aug/14 ]

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

Comment by Marco Pivetta [ 05/Aug/14 ]

Merged DBAL-964, but the issue persists here.





[DDC-2417] [GH-653] [DDC-2415] Fix CustomIdGenerator inheritance Created: 26/Apr/13  Updated: 05/Aug/14  Resolved: 27/Apr/13

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

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


 Description   

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

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

Message:

http://www.doctrine-project.org/jira/browse/DDC-2415



 Comments   
Comment by Doctrine Bot [ 27/Apr/13 ]

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

Comment by Doctrine Bot [ 05/Aug/14 ]

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





[DDC-3186] [GH-1069] added method to be able to reuse the console application Created: 24/Jun/14  Updated: 04/Aug/14  Resolved: 04/Aug/14

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

Type: New Feature Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

This comes in handy, when you want to do more with the actual application object then just to run it.



 Comments   
Comment by Doctrine Bot [ 04/Aug/14 ]

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

Comment by Doctrine Bot [ 04/Aug/14 ]

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





[DDC-2400] [GH-648] Add a AddParameters method in the QueryBuilder Created: 13/Apr/13  Updated: 04/Aug/14  Resolved: 14/Apr/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

Hi,

On doctrine 2.2, when we were calling the method `setParameters` to set a bunch of parameters on the QueryBuilder, each parameters were added or modified if they were already existing.

That is not the case since doctrine 2.3 : each calls to `setParameters` will wipe out the other already setted parameters. I think it is logic, but still is a huge BC break, which is not really mentionned in the UPGRADE file (only the once regarding the use of an ArrayCollection is mentionned).

With this PR, I added a `addParameters` which allows to add several parameters in several calls. Here is a use case :

```php
<?php
// ... A repository
class UserRepository extends EntityRepository
{
public function getUserWithSomething($criteriaA, $criteriaB, DateTime $since = null)
{
$qb = $this->createQueryBuilder('u');
$qb->where($qb->expr()>andX($qb>expr()->eq('u.criteriaA', ':criteriaA'),
$qb->expr()->eq('u.criteriaB', ':criteriaB')));

// wanna search for objects since a specific date
if (null !== $since)

{ $qb = $this->addSince($qb, $since); }

$qb->addParameters(new ArrayCollection(['criteriaA' => $criteriaA,
'criteriaB' => $criteriaB]));

return $qb->getQuery()->execute();
}

public function addSince(QueryBuilder $qb, DateTime $since)

{ $qb = $qb->andWhere($qb->expr()->gte('u.date', ':since')); return $qb->setParameter('since', $since); }

}
```

So, as I was saying, until 2.2, you could use `setParameters` in the main method (`getUserWithSomething`) which was calling (or not) the submethod `addSince`, which could set parameters before calling the `setParameters` method. Now, you can't do that anymore : either you need to make several calls to `setParameter` :

```php
<?php
// ....
$qb = $qb->setParameter('criteriaA', $criteriaA)
->setParameter('criteraB', $criteriaB);
//...
```

Either, I guess, you need to first retrieve all the parameters and then add them by hand :

```php
<?php
// ....
$parameters = $qb->getParameters();
$parameters->add(new Parameter('criteriaA', $criteriaA);
$parameters->add(new Parameter('criteriaB', $criteriaB);

$qb = $qb->setParameters($parameters);
//...
```

So that's why I propose this new method in the QueryBuilder. if I'm wrong anywhere, or need more information please feel free to comment.

Cheers.



 Comments   
Comment by Doctrine Bot [ 14/Apr/13 ]

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

Comment by Doctrine Bot [ 04/Aug/14 ]

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

Comment by Doctrine Bot [ 04/Aug/14 ]

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





[DDC-2416] [GH-652] Fixed entities path Created: 26/Apr/13  Updated: 04/Aug/14  Resolved: 26/Apr/13

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

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

In the tutorial, the user is told to create a new file in the `/src` folder, and the `/entities` folder is never referenced. Updating the SQLite schema according to the tutorial fails with the 'No Metadata Classes to process.' message. Changing the folder to `/src` fixes this, ostensibly.



 Comments   
Comment by Doctrine Bot [ 26/Apr/13 ]

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

Comment by Marco Pivetta [ 26/Apr/13 ]

merged

Comment by Doctrine Bot [ 04/Aug/14 ]

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

Comment by Doctrine Bot [ 04/Aug/14 ]

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





[DDC-2412] [GH-651] Fixed typo in SQLFilter (use statement ClassMetadata) Created: 23/Apr/13  Updated: 04/Aug/14  Resolved: 23/Apr/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 23/Apr/13 ]

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

Comment by Marco Pivetta [ 23/Apr/13 ]

merged

Comment by Doctrine Bot [ 04/Aug/14 ]

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





[DDC-2410] [GH-650] Fixed typo in SQLFilter addFilterConstraint first param Created: 23/Apr/13  Updated: 04/Aug/14  Resolved: 23/Apr/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

Hi,

Description in subj,
the use statement for ClassMetaData is
use Doctrine\ORM\Mapping\ClassMetaData;

But in the abstract method the param named ClassMetadata ("d" char should be in uppercase)



 Comments   
Comment by Doctrine Bot [ 23/Apr/13 ]

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

Comment by Doctrine Bot [ 04/Aug/14 ]

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





[DDC-2408] [GH-649] Update coding standards Created: 21/Apr/13  Updated: 04/Aug/14  Resolved: 21/Apr/13

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

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Removing underscores from property/method names and change use statements to PSR-2



 Comments   
Comment by Doctrine Bot [ 21/Apr/13 ]

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

Comment by Marco Pivetta [ 21/Apr/13 ]

merged

Comment by Doctrine Bot [ 04/Aug/14 ]

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

Comment by Doctrine Bot [ 04/Aug/14 ]

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





[DDC-2397] [GH-647] Bugfix/ddc 1048 cordoval Created: 10/Apr/13  Updated: 01/Aug/14  Resolved: 12/Apr/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Luis Cordova [ 10/Apr/13 ]

http://www.doctrine-project.org/jira/browse/DDC-1048

please check ^^

Comment by Doctrine Bot [ 12/Apr/13 ]

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

Comment by Doctrine Bot [ 01/Aug/14 ]

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

Comment by Doctrine Bot [ 01/Aug/14 ]

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





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

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 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?






[DDC-2396] [GH-646] Oracle Pagination bug when ordering is present Created: 09/Apr/13  Updated: 01/Aug/14  Resolved: 14/Apr/13

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

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


 Description   

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

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

Message:

Please reference http://www.doctrine-project.org/jira/browse/DDC-1800 and http://www.doctrine-project.org/jira/browse/DDC-1958#comment-19969.



 Comments   
Comment by Doctrine Bot [ 10/Apr/13 ]

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

Comment by Doctrine Bot [ 01/Aug/14 ]

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

Comment by Doctrine Bot [ 01/Aug/14 ]

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





[DDC-2395] [GH-645] Fixes Oracle Pagination bug when ordering is present (e.g. Oracle subquery ordering) Created: 09/Apr/13  Updated: 31/Jul/14  Resolved: 14/Apr/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

See��http://www.doctrine-project.org/jira/browse/DDC-1800 for a full description of the problem.



 Comments   
Comment by Doctrine Bot [ 09/Apr/13 ]

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

Comment by Doctrine Bot [ 31/Jul/14 ]

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





[DDC-2319] [GH-590] DQL Query: process ArrayCollection values to ease development Created: 25/Feb/13  Updated: 31/Jul/14  Resolved: 17/Dec/13

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

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

I added some code to ease "where in" parameter binding.

As you know, when a where condition is added, the object itself can be passed as a parameter and it's id is automatically retrieved:

```php
$queryBuilder = $this
->where('model.category = :category')
->setParameter('category', $category)
;
```
Where `$category` is an object.

But it doesn't work for collections:
```php
$queryBuilder = $this
->where('model.category IN (:categories)')
->setParameter('categories', $categories)
;
```

Where categories is an `ArrayCollection` object (retrieved from a many to one relation for instance).

This doesn't work in the current version of Doctrine, and my PR solved that.

So far, the only solution is to do the following:

```php
$categoryIds = array();

foreach ($categories as $category)

{ $categoryIds[] = $category->getId(); }

$queryBuilder = $this
->where('model.category IN (:category_ids)')
->setParameter('category_ids', $categoryIds)
;
```

And this is pretty borring when you have to do it several times for several entities.

Note that I didn't add any unit test for this feature. Can you explain me where I should add the test?

Thanks!



 Comments   
Comment by Doctrine Bot [ 17/Dec/13 ]

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

Comment by Marco Pivetta [ 17/Dec/13 ]

Merged: https://github.com/doctrine/doctrine2/commit/423ea00539d11e9a12e952a7e9144bd2c53019dc

Comment by Doctrine Bot [ 30/Apr/14 ]

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

Comment by Doctrine Bot [ 31/Jul/14 ]

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





[DDC-3236] Quote table names Created: 31/Jul/14  Updated: 31/Jul/14

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

Type: Improvement Priority: Major
Reporter: Benjamin Horn Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Different dbs have different reserved words. I started my project with mysql where i couldnt name my table as "order". After changing to postgre it turned out that "user" is reserved. Although

ALTER TABLE "member" RENAME TO "user";

works.

I know i could use prefixes in yml eg

Com\ApiBundle\Entity\User:
    type: entity
    table: prefix_user

but
-i build my db
-automatically generate my yaml files from it
-then i generate the entities

If i have prefixed table names my entities will have them too.
Besides doctrine is a layer on top of different dbs, it would be nice not to worry about reserved words when i naming my tables.

What is your opinion on this feature.



 Comments   
Comment by Steve Müller [ 31/Jul/14 ]

Benjamin Horn this looks more like a DBAL related issue. Can you please give more details how the broken SQL is created by you? Also please provide information about which DBAL and/or ORM version you are referring to as we have fixed a lot of quotation problems with DDL statements in current DBAL master over the last few months. So please also try using the latest master and see if you can reproduce the issue.
If the issue still persists it would be helpfult to know which database vendor and which version you are using (as different vendors and versions have different reserved keywords).





[DDC-3237] [GH-1096] Changes for grammar and clarity Created: 31/Jul/14  Updated: 31/Jul/14  Resolved: 31/Jul/14

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

Type: Bug Priority: Minor
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Plus fix a couple of broken links.



 Comments   
Comment by Doctrine Bot [ 31/Jul/14 ]

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

Comment by Doctrine Bot [ 31/Jul/14 ]

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





[DDC-3235] [GH-1095] Make Doctrine\ORM\Configuration implement fluent interface Created: 31/Jul/14  Updated: 31/Jul/14  Resolved: 31/Jul/14

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

Enabled chaining of calls to set*() and add*() methods in Configuration class.
Added relevant tests.

Created missing test for Doctrine\ORM\Configuration::setRepositoryFactory().



 Comments   
Comment by Doctrine Bot [ 31/Jul/14 ]

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

Comment by Doctrine Bot [ 31/Jul/14 ]

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





[DDC-3233] [GH-1092] Arbitrary Join count walkers solution Created: 30/Jul/14  Updated: 30/Jul/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

Possible solution for Arbitrary Join problem in pagination count
walkers:
https://groups.google.com/forum/#!topic/doctrine-user/rpPYCDNKOU8

Added a condition to test query component against SelectStatement from
clause






[DDC-2379] [GH-637] Update association-mapping.rst Created: 29/Mar/13  Updated: 29/Jul/14  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 30/Mar/13 ]

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

Comment by Doctrine Bot [ 29/Jul/14 ]

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





[DDC-1769] [GH-332] Fixed DDC-1441 unsing doctrine-common ClassUtils getRealClass() method Created: 05/Apr/12  Updated: 28/Jul/14  Resolved: 07/Apr/12

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

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


 Description   

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

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

Message:

Fixes http://www.doctrine-project.org/jira/browse/DDC-1441 using helpers from doctrine/common introduced by version 2.2.



 Comments   
Comment by Benjamin Eberlei [ 05/Apr/12 ]

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

Comment by Doctrine Bot [ 28/Jul/14 ]

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





[DDC-3232] [GH-1090] 'EntityRepository' dependencies are accessible, using getters, after instantiation. Created: 28/Jul/14  Updated: 28/Jul/14  Resolved: 28/Jul/14

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

Good morning,

An `EntityRepository` object is created using an `EntityManager` and a Mapping `ClassMetadata` object but -previously - those dependencies were not publicly accessible. I've been creating a `QueryBuilder` using `EntityRepository::createQueryBuilder()` to get a hold of the `EntityManager`, which is a little silly.

I added a unit test for `EntityRepository` and made both dependencies accessible.

Thanks,
Dan



 Comments   
Comment by Doctrine Bot [ 28/Jul/14 ]

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





[DDC-1768] [GH-330] improved exception message Created: 05/Apr/12  Updated: 27/Jul/14  Resolved: 04/May/12

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

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


 Description   

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

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

Message:

This makes the exception message more helpful. Before you were basically searching a needle in a haystack.

Note that I haven't been able to run the tests because I don't have PHPUnit 3.6 atm, so please check before merging.



 Comments   
Comment by Benjamin Eberlei [ 06/Apr/12 ]

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

Comment by Benjamin Eberlei [ 07/Apr/12 ]

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

Comment by Doctrine Bot [ 27/Jul/14 ]

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





[DDC-1764] [GH-326] 2.1.x setDiscriminatorMap fix Created: 04/Apr/12  Updated: 27/Jul/14  Resolved: 07/Apr/12

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

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


 Description   

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

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

Message:

Fixing a bug when calling setDiscriminatorMap from multiple sources (ie: from Events::loadClassMetadata and annotation).

http://www.doctrine-project.org/jira/browse/DDC-1763



 Comments   
Comment by Benjamin Eberlei [ 04/Apr/12 ]

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

Comment by Benjamin Eberlei [ 04/Apr/12 ]

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

Comment by Benjamin Eberlei [ 04/Apr/12 ]

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

Comment by Benjamin Eberlei [ 06/Apr/12 ]

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

Comment by Benjamin Eberlei [ 07/Apr/12 ]

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

Comment by Benjamin Eberlei [ 07/Apr/12 ]

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

Comment by Benjamin Eberlei [ 07/Apr/12 ]

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

Comment by Benjamin Eberlei [ 07/Apr/12 ]

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

Comment by Benjamin Eberlei [ 07/Apr/12 ]

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

Comment by Doctrine Bot [ 27/Jul/14 ]

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





[DDC-1767] [GH-329] [DDC-1766] Initial implementation of hydration cache. Created: 04/Apr/12  Updated: 27/Jul/14  Resolved: 07/Apr/12

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

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


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 04/Apr/12 ]

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

Comment by Benjamin Eberlei [ 04/Apr/12 ]

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

Comment by Benjamin Eberlei [ 04/Apr/12 ]

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

Comment by Benjamin Eberlei [ 04/Apr/12 ]

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

Comment by Benjamin Eberlei [ 04/Apr/12 ]

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

Comment by Benjamin Eberlei [ 05/Apr/12 ]

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

Comment by Benjamin Eberlei [ 06/Apr/12 ]

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

Comment by Benjamin Eberlei [ 07/Apr/12 ]

Duplicate of DDC-1766

Comment by Doctrine Bot [ 27/Jul/14 ]

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





[DDC-2391] [GH-643] DDC-2390: Remove Query dependency in SqlWalker and Parser Created: 04/Apr/13  Updated: 27/Jul/14  Resolved: 01/May/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

To prevent future problems with illegal Query parameter access and also to decouple the namespaces by removing bidirectional dependency.



 Comments   
Comment by Doctrine Bot [ 01/May/13 ]

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

Comment by Doctrine Bot [ 27/Jul/14 ]

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





[DDC-2389] [GH-642] replaced direct class in instance creation Created: 04/Apr/13  Updated: 27/Jul/14  Resolved: 04/Apr/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

return new EntityManager() -> return new static() on line 945
made code more reusable



 Comments   
Comment by Benjamin Eberlei [ 04/Apr/13 ]

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

Comment by Marco Pivetta [ 04/Apr/13 ]

EntityManager should not be extended

Comment by Doctrine Bot [ 27/Jul/14 ]

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





[DDC-2386] [GH-641] Added yml example in ordered-associations.rst Created: 03/Apr/13  Updated: 27/Jul/14  Resolved: 08/Sep/13

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

Type: Documentation Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Added missing yaml example of ordered-associations, and put php, xml and yml codes into a configuration-block instead of separate code-blocks



 Comments   
Comment by Benjamin Eberlei [ 03/Apr/13 ]

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

Comment by Marco Pivetta [ 03/Apr/13 ]

merged

Comment by Doctrine Bot [ 27/Jul/14 ]

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





[DDC-3230] Bug in clear cache Created: 25/Jul/14  Updated: 25/Jul/14

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

Type: Bug Priority: Minor
Reporter: Flip Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows 7 64bits
PHP 5.5.4 32 bits
pdo_sql_srv 3.0.2 for php 5.5 32 bits
symfony 2.5
gedmo deletable @ dev-master
Redis 2.8.12
PHPRedis php_redis-2.2.5-5.5-nts-vc11-x86
IIS 7.5



 Description   

1. Redis is used for cache/meta/result caching.
2. Entity has property $deleted with gedmo deletable on it.
3. Removing property $deleted (and all related annotations)
4. Symfony commands:

php app/console doctrine:cache:clear-metadata
php app/console doctrine:cache:clear-query
php app/console doctrine:cache:clear-result
php app/console cache:clear --env=prod --no-debug <-- error on this command

5. [ReflectionException]
Property Entity::$deleted does not exist

Trace:

#0 \vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php(989)
#1 \vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ClassMetadataFactory.php(571)
#2 \vendor\doctrine\common\lib\Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory.php(210) <-- CacheRedis driver called here
#3 \vendor\doctrine\common\lib\Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory.php(114)
#4 \vendor\symfony\symfony\src\Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer.php(69)
#5 \vendor\symfony\symfony\src\Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate.php(48)
#6 \app\bootstrap.php.cache(2513)
#7 \app\bootstrap.php.cache(2284)
#8 \vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.php(128)
#9 \vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.php(90)
#10 \vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php(252)
#11 \vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(894)
#12 \vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(193)
#13 \vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php(96)
#14 \vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(124)
#15 \app\console(27)

Why do i think this is a Doctrine bug and not a Symfony bug? Because

php app/console doctrine:cache:clear-metadata
php app/console doctrine:cache:clear-query
php app/console doctrine:cache:clear-result

have been called successfully so RedisCache should not return cache with $this->fieldMappings containing key "deleted"






[DDC-2384] [GH-639] Added abillity to use metacolumn as indexBy Created: 02/Apr/13  Updated: 25/Jul/14  Resolved: 10/May/13

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

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


 Description   

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

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

Message:

Added ability to use meta column as indexBy. Useful if association entities is widely used.
Replace #204 PR



 Comments   
Comment by Doctrine Bot [ 10/May/13 ]

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

Comment by Doctrine Bot [ 25/Jul/14 ]

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





[DDC-2380] [GH-638] Fixed typos in docblocks. Created: 30/Mar/13  Updated: 25/Jul/14  Resolved: 01/Apr/13

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

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


 Description   

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

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

Message:

Hello again, I'm committing the mini fixes in docblock documentation - swapping 'an SQL' for 'a SQL'.

Thanks!



 Comments   
Comment by Benjamin Eberlei [ 01/Apr/13 ]

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

Comment by Doctrine Bot [ 25/Jul/14 ]

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





[DDC-3229] Error when running the tests Created: 24/Jul/14  Updated: 24/Jul/14

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

Type: Bug Priority: Major
Reporter: Jeroen De Dauw Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Fresh clone at 089cca636e0e44a70dd9167b7d813762ea80daca.

php -v
PHP 5.5.9-1ubuntu4.3 (cli) (built: Jul 7 2014 16:36:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

j@wd42:~/workspace/doctrine2$ phpunit
PHPUnit 4.3-ge243de0 by Sebastian Bergmann.

Configuration read from /home/j/workspace/doctrine2/phpunit.xml.dist

............................................................. 61 / 2500 ( 2%)
........S.................................................... 122 / 2500 ( 4%)
............................................................. 183 / 2500 ( 7%)
............................................................. 244 / 2500 ( 9%)
............................................................. 305 / 2500 ( 12%)
............................................................. 366 / 2500 ( 14%)
.........................S...SSSS.S.......................... 427 / 2500 ( 17%)
............................................................. 488 / 2500 ( 19%)
....................................................SS....... 549 / 2500 ( 21%)
............................................................. 610 / 2500 ( 24%)
............................................................. 671 / 2500 ( 26%)
............................................................. 732 / 2500 ( 29%)
............................................................. 793 / 2500 ( 31%)
........................................................S.SSS 854 / 2500 ( 34%)
SSSSSSSSS.................................................... 915 / 2500 ( 36%)
..........................................SS................. 976 / 2500 ( 39%)
.............S...S...........S..............................S 1037 / 2500 ( 41%)
........PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65552 bytes) in /home/j/workspace/doctrine2/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php on line 280
PHP Stack trace:
PHP 1.

{main}

() /usr/bin/phpunit.phar:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit.phar:586
PHP 3. PHPUnit_TextUI_Command->run() phar:///usr/bin/phpunit.phar/phpunit/TextUI/Command.php:132
PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar:///usr/bin/phpunit.phar/phpunit/TextUI/Command.php:179
PHP 5. PHPUnit_Framework_TestSuite->run() /home/j/workspace/doctrine2/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:423
PHP 6. PHPUnit_Framework_TestSuite->run() /home/j/workspace/doctrine2/vendor/phpunit/phpunit/src/Framework/TestSuite.php:715
PHP 7. PHPUnit_Framework_TestCase->run() /home/j/workspace/doctrine2/vendor/phpunit/phpunit/src/Framework/TestSuite.php:715
PHP 8. PHPUnit_Framework_TestResult->run() /home/j/workspace/doctrine2/vendor/phpunit/phpunit/src/Framework/TestCase.php:672
PHP 9. PHPUnit_Framework_TestCase->runBare() /home/j/workspace/doctrine2/vendor/phpunit/phpunit/src/Framework/TestResult.php:654
PHP 10. PHPUnit_Framework_TestCase->runTest() /home/j/workspace/doctrine2/vendor/phpunit/phpunit/src/Framework/TestCase.php:734
PHP 11. ReflectionMethod->invokeArgs() /home/j/workspace/doctrine2/vendor/phpunit/phpunit/src/Framework/TestCase.php:859
PHP 12. Doctrine\Tests\ORM\Functional\Ticket\DDC1436Test->testIdentityMap() /home/j/workspace/doctrine2/vendor/phpunit/phpunit/src/Framework/TestCase.php:859
PHP 13. Doctrine\ORM\AbstractQuery->getOneOrNullResult() /home/j/workspace/doctrine2/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php:42
PHP 14. Doctrine\ORM\AbstractQuery->execute() /home/j/workspace/doctrine2/lib/Doctrine/ORM/AbstractQuery.php:766
PHP 15. Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache() /home/j/workspace/doctrine2/lib/Doctrine/ORM/AbstractQuery.php:923
PHP 16. Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll() /home/j/workspace/doctrine2/lib/Doctrine/ORM/AbstractQuery.php:977
PHP 17. Doctrine\ORM\Internal\Hydration\ObjectHydrator->hydrateAllData() /home/j/workspace/doctrine2/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:147
PHP 18. Doctrine\ORM\Internal\Hydration\ObjectHydrator->hydrateRowData() /home/j/workspace/doctrine2/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:160
PHP 19. Doctrine\ORM\Internal\Hydration\ObjectHydrator->getEntity() /home/j/workspace/doctrine2/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:432
PHP 20. Doctrine\ORM\UnitOfWork->createEntity() /home/j/workspace/doctrine2/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:268
PHP 21. Doctrine\Common\Proxy\AbstractProxyFactory->getProxy() /home/j/workspace/doctrine2/lib/Doctrine/ORM/UnitOfWork.php:2714
PHP 22. Doctrine\Common\Proxy\AbstractProxyFactory->getProxyDefinition() /home/j/workspace/doctrine2/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:119
PHP 23. Doctrine\Common\Proxy\ProxyGenerator->generateProxyClass() /home/j/workspace/doctrine2/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:218
PHP 24. strtr() /home/j/workspace/doctrine2/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php:280






[DDC-3228] ORM\Tools\Export\Driver\PhpExporter.php does not properly export manyToOne associations Created: 24/Jul/14  Updated: 24/Jul/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, ORM, Tools
Affects Version/s: Git Master
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Dan V Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: mapping, orm, schematool
Environment:

PHP 5.5.9-1ubuntu4 (cli)



 Description   

PhpExporter.php fails to check the association for manyToOne/oneToOne and exports all associations as oneToOne.

See https://github.com/doctrine/doctrine2/tree/master/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php#L116 where oneToOne is hardcoded if the bitmask matches either manyToOne or oneToOne.

As opposed to YamlExporter.php:

https://github.com/doctrine/doctrine2/tree/master/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php#L165

Which does roughly the same thing, but then properly sets the association type by checking the actual association on lines 186 through one 190:

https://github.com/doctrine/doctrine2/tree/master/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php#L186-L190






[DDC-3225] [GH-1087] Remove the error control operator Created: 23/Jul/14  Updated: 24/Jul/14  Resolved: 23/Jul/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None