[DDC-1831] Problem while implement a relation many to many with columns names starting with caps Created: 21/May/12  Updated: 06/Jul/12  Resolved: 06/Jul/12

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

Type: Bug Priority: Critical
Reporter: Pablo Minetti Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File defect_patch.txt    

 Description   

Hi, In my team we are implementing a solution that involves make a relation many to many.

The problem is that the columns names of the middle table start with caps.

we make correction to ORM to solve this problem. I attach to you the files modify.



 Comments   
Comment by Fabio B. Silva [ 05/Jun/12 ]

Hi Pablo,

I'm working on a quote patch right now.
I think that will fix a lot of quote issues.

Could you attach a test for this case please ?

Comment by Benjamin Eberlei [ 05/Jul/12 ]

Fabio, any stats on this one? Is it fixed through your change?

Comment by Fabio B. Silva [ 05/Jul/12 ]

There is no answers from Pablo,

I think this is fixed by quote strategy, also DDC-1850
but without entities or tests is hard to know if are really fixed.

if we don't get any feedback from Pablo, I think both could be closed.

Comment by Benjamin Eberlei [ 06/Jul/12 ]

No feeback given and a fix was pushed to master. Please reopen if problems persist with master + custom quoting strategy.





[DDC-1848] "QueryException: Invalid parameter number: number of bound variables does not match number of tokens" with "dev-master" of Doctrine\ORM + Pagerfanta. Created: 30/May/12  Updated: 08/Jul/12  Resolved: 08/Jul/12

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

Type: Bug Priority: Minor
Reporter: Paweł Jędrzejewski Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 1
Labels: None


 Description   

Using Symfony2 master with Doctrine\ORM master & Pagerfanta paginator (which uses Doctrine paginator internally) causes this exception.

"QueryException: Invalid parameter number: number of bound variables does not match number of tokens". Works fine with the master of Symfony & same version of Pagerfanta, but with 2.2 of Doctrine ORM.

Full app to see it is available here: http://github.com/Sylius/Sylius-Sandbox.

Full trace (without twig and Symfony part)

[1/2] QueryException: Invalid parameter number: number of bound variables does not match number of tokens
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php at line 72
at QueryException ::invalidParameterNumber ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php at line 255
at Query ->_doExecute ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php at line 737
at AbstractQuery ->execute (null, '3')
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php at line 562
at AbstractQuery ->getScalarResult ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php at line 144
at Paginator ->count ()
at count (object(Paginator))
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineORMAdapter.php at line 75
at DoctrineORMAdapter ->getNbResults ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php at line 167
at Pagerfanta ->getNbResults ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php at line 190
at Pagerfanta ->haveToPaginate ()



 Comments   
Comment by Саша Стаменковић [ 31/May/12 ]

I tested Sylius against this issue with each commit from doctrine master branch, and I find out that bug appeared in this https://github.com/doctrine/doctrine2/commit/1635e0af4b06ef3015205563b59b505ae3fac69d commit.

Comment by Marco Pivetta [ 08/Jul/12 ]

Could you check if this isn't the same problem reported at DDC-1803?

Comment by Benjamin Eberlei [ 08/Jul/12 ]

Fixed





[DDC-1697] DQL Query with key=>value array in parameter Created: 12/Mar/12  Updated: 25/Mar/12  Resolved: 25/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.1
Fix Version/s: 2.3

Type: Improvement Priority: Minor
Reporter: waldo Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None
Environment:

PHP Version 5.3.3-1ubuntu9.10, Symfony 2.0.11



 Description   

In he method "processParameterValue" in the class Doctrine\ORM\Query line 303, a "for" loop is use for construct the parameter query.

But if in the query parameter we pass a key=>value array, the method throw an error.

A little example :
$aId = array(0 => "Paris", 3 => "Canne", 9 => "St Julien");

$dql = $this->_em->createQueryBuilder();
$dql->select('c.ID')
->from('BOD\ModelBundle\Entity\City', 'c')
->where('c.IC IN (:cityIDs)')
->setParameter('cityIDs', $aId);

return $dql->getQuery()->execute();

The method "processParameterValue" throw an error because he don't found the index 1.

But if we replace the "for" loop by a foreach in Doctrine\ORM\Query::processParameterValue() :
foreach ($value as $keyValue => $oneValue) {
$paramValue = $this->processParameterValue($oneValue);

// TODO: What about Entities that have composite primary key?
$value[$keyValue] = is_array($paramValue) ? $paramValue[key($paramValue)] : $paramValue;
}

It work really fine.

I remain at your disposal for any further information.

Thanks for all!



 Comments   
Comment by Fabio B. Silva [ 25/Mar/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/8a52e3033b51f0f0b97e1ee75477644484debf2b





[DDC-1694] Entity Generator uses wrong DataTypes for docBlocks Created: 11/Mar/12  Updated: 05/May/12  Resolved: 05/May/12

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

Type: Bug Priority: Minor
Reporter: Rafael Dohms Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

When using the Doctrine\ORM\Tools\EntityGenerator, largely used by Symfony, the wrong data types are used in the docblocks. For example:

@param text $description

Text needs to be converted to "string" in this case. So there needs to be proper Doctrine Data Type to php type as well as the conversion to DBAL that is already done.

Examples:
smallint => int
bigint => int
text => string
datetime => \DateTime,
datetimetz, => \DateTime
etc...






[DDC-1603] Unique key name isn't correctly set Created: 16/Jan/12  Updated: 22/Jan/12  Resolved: 17/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.2-BETA2
Fix Version/s: 2.1.6, 2.2.0-RC1, 2.2, 2.3

Type: Bug Priority: Minor
Reporter: Thomas Tourlourat - Armetiz Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Example :

<unique-constraints>
<unique-constraint columns="permalink" />
<unique-constraint columns="code" />
</unique-constraints>

This will create :
CREATE UNIQUE INDEX UNIQ_6C3BF144F286BC32 ON shows (permalink);
CREATE UNIQUE INDEX 1 ON shows (code);

instead of :
CREATE UNIQUE INDEX UNIQ_6C3BF144F286BC32 ON shows (permalink);
CREATE UNIQUE INDEX UNIQ_6C3BF14477153098 ON shows (code);

The problem comme from SchemaTool, and the first key is a valid result because of "==" instead of "===" inside Table.php.

I have create a PR on Github.



 Comments   
Comment by Thomas Tourlourat - Armetiz [ 16/Jan/12 ]

Here the PR for the ORM SchemaTool : https://github.com/doctrine/doctrine2/pull/261
Here the PR for the DBAL Table : https://github.com/doctrine/dbal/pull/94

Comment by Guilherme Blanco [ 17/Jan/12 ]

Merged https://github.com/doctrine/doctrine2/commit/2bb511584e5d37ddad6c669a19d8e6b4a20f7b2b

Comment by Benjamin Eberlei [ 21/Jan/12 ]

DBAL merged back into 2.2 and 2.1.x

Comment by Benjamin Eberlei [ 21/Jan/12 ]

and Merged into 2.2 and 2.1.x ORM





[DDC-1470] Bad discrimator value give imprecise error exception Created: 04/Nov/11  Updated: 16/Mar/12  Resolved: 16/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1
Fix Version/s: 2.3

Type: Improvement Priority: Minor
Reporter: Francois Mazerolle Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

When you define a wrong discriminator field in the mapping configuration, doctrine will return the following ErrorException when trying to get an instance of the object:

ErrorException: Notice: Undefined index: in /Users/fmaz/Site/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 92

This is not precise enough, an error giving hint on the mapping configuration that is concerned, and on the bad field should be given.

Hope this will help improving the "userfriendlyness"



 Comments   
Comment by Guilherme Blanco [ 16/Mar/12 ]

Fixed in https://github.com/doctrine/doctrine2/commit/6f3ef148a95c6e598f9b16848c6a33b3d7a39077





Generated at Sat Sep 05 02:04:42 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.