[DDC-2068] [GH-474] Fixed bug with comment option not being added to column. Created: 11/Oct/12 Updated: 12/Oct/12 Resolved: 12/Oct/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.2.4, 2.3.1 |
| 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 okovalov: Url: https://github.com/doctrine/doctrine2/pull/474 Message: Title explains everything... =) |
| Comments |
| Comment by Benjamin Eberlei [ 12/Oct/12 ] |
|
A related Github Pull-Request [GH-474] was closed |
[DDC-2059] Property perceived as dumplicate in composite foreign key Created: 04/Oct/12 Updated: 05/Oct/12 Resolved: 05/Oct/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 2.1.3 |
| Fix Version/s: | 2.2.4, 2.3.1 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Dimitris Bozelos | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I have the following schema: CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ); CREATE TABLE `project` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), ); CREATE TABLE `project_conversation` ( `project_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, PRIMARY KEY (`project_id`,`user_id`) ) I have ommitted the foreign key definitions for better readability. When I execute doctrine:mapping:convert (in Symfony2, but it seems it's a Doctrine2 issue), I get the following error: [Doctrine\ORM\Mapping\MappingException] Property "user" in "Project" was already declared, but it must be declared only once I have tracked down the issue to be caused by the existence of `user_id` in the project table. So basically, because `project_conversation` references `project` which in turn references `user`, `project_conversation` reference to `user` is perceived as duplicate. I don't think that this should be the expected behavior though. user_id in `project` references the creator of the project while user_id in `project_conversation` references the creator of the conversation and thus I think the schema is valid. |
| Comments |
| Comment by Benjamin Eberlei [ 05/Oct/12 ] |
|
Will be fixed in 2.2.4 and 2.3.1 |
[DDC-2050] [GH-459] Fix DDC-2012 Created: 30/Sep/12 Updated: 03/Oct/12 Resolved: 03/Oct/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.2.4, 2.3.1 |
| 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 FabioBatSilva: Url: https://github.com/doctrine/doctrine2/pull/459 Message: http://www.doctrine-project.org/jira/browse/DDC-2012 |
| Comments |
| Comment by Benjamin Eberlei [ 03/Oct/12 ] |
|
A related Github Pull-Request [GH-459] was closed |
[DDC-2012] Inserting a new entity with a custom mapping type does not call convertToDatabaseValueSQL() when using InheritanceType("JOINED") Created: 04/Sep/12 Updated: 03/Oct/12 Resolved: 03/Oct/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | 2.2.4, 2.3.1 |
| Security Level: | All |
| Type: | Bug | Priority: | Critical |
| Reporter: | Kaspars Sproģis | Assignee: | Fabio B. Silva |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP |
||
| Attachments: |
|
| Description |
|
When using class type inheritance - @InheritanceType("JOINED") and inserting new entity with a custom mapping type, custom type method convertToDatabaseValueSQL() is never called. Here is sample class mapping: Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml /** * @Table(name="item") * @Entity * @InheritanceType("JOINED") * @DiscriminatorColumn(name="type_id", type="smallint") * @DiscriminatorMap({1 = "ItemPerson"}) */ class Item { /** * @Column(name="tsv", type="tsvector", nullable=true) */ protected $tsv; } /** * @Table(name="item_person") * @Entity */ class ItemPerson extends Item { } I am using the same custom TsvectorType with simple entities and even Mapped Superclasses and it works perfectly, however on InheritanceType("JOINED") method convertToDatabaseValueSQL() is never called :/ |
| Comments |
| Comment by Fabio B. Silva [ 24/Sep/12 ] |
|
Hi Kaspars, I can't reproduce, Thanks |
| Comment by Kaspars Sproģis [ 26/Sep/12 ] |
|
@Fabio thanks for looking into my problem It was quite strange, all i did was changed column that uses custom type to array and some minimal convertToDatabaseValue and convertToDatabaseValueSQL logic and convertToDatabaseValueSQL was never called. One more thing i noticed, this bug only appears on persist and not on merge. Thanks |
| Comment by Fabio B. Silva [ 29/Sep/12 ] |
|
Thanks Kaspars But sorry, I dont get your use case. Notice that convertToDatabaseValueSQL is called just when using queries to find a object by a especific columns which is your mapping type. |
| Comment by Kaspars Sproģis [ 29/Sep/12 ] |
|
I am using PostgreSQL tsvector data type for full text search. Here is my tsvector custom data type class: The only way to update this field in postgresql is to use postgresql function to_tsvector('some text'). public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) { return sprintf('to_tsvector(%s)', $sqlExpr); } But when i use inheritance, then by some reason convertToDatabaseValueSQL method is not called and tsv field is updated with simple text as returned by convertToDatabaseValue() method. Here is the result after persisting (for persist it failed) $person = new ItemPerson(); $person->setName('some words for test'); $em->persist($person); $em->flush(); DB Result: Name | Tsv --------------------|------------------------------------ some words for test | 'for' 'some' 'test' 'words' Here is the result after second time update (now by tsv format you can see it worked):
$person->setName('some more words for test');
$em->flush();
DB Result:
Name | Tsv
--------------------|------------------------------------
some words for test | 'test':5 'word':3
|
| Comment by Fabio B. Silva [ 30/Sep/12 ] |
|
Thanks Kaspars Now i saw the problem Writing a patch ... |
| Comment by Kaspars Sproģis [ 03/Oct/12 ] |
|
Just tested fixed version and everything works perfectly now. |
| Comment by Fabio B. Silva [ 03/Oct/12 ] |
|
Fixed by : https://github.com/doctrine/doctrine2/commit/91caff1d8965c20b72d5fdd04ffadf3ab063c1ba |
[DDC-1977] Undefined index in ParameterTypeInferer Created: 10/Aug/12 Updated: 29/Aug/12 Resolved: 25/Aug/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | 2.2.4, 2.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Minor |
| Reporter: | Matt Button | Assignee: | Fabio B. Silva |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3.6-13ubuntu3.8 with Suhosin-Patch (cli) (built: Jun 13 2012 17:19:54) { "package": "doctrine/common", "version": "2.2.2" } , , , , |
||
| Description |
|
Trying to bind an empty array as a parameter to a raw SQL query results in an undefined index error on line 59. |
| Comments |
| Comment by Matt Button [ 10/Aug/12 ] |
|
One way to work around this is to specify the type of the array as the third parameter to addParameter |
| Comment by Fabio B. Silva [ 25/Aug/12 ] |
|
Fixed by : https://github.com/doctrine/doctrine2/commit/ece6a005bcecc4a9e4a154d9379cfbe141370415 |
[DDC-1800] Paginator results is wrong if your query use order by clause Created: 27/Apr/12 Updated: 09/Apr/13 Resolved: 29/Aug/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | 2.2.4, 2.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Marc Drolet | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
linux oracle |
||
| Description |
|
NOTE: I didn't try this on other database, I'm using Oracle. if my original fetchJoin query use an order by clause, the results is not keeping the provided order by clause and re-order them by id. here is my generated query to get the distinct records that get generated: SELECT distinct ID0 running this query I get the id 30, 44 when the inner query return 44, 30 here is the query that should get generated to take care of the order by clause: To fix this on the Paginator code: file: ORM/Tools/Pagination/LimitSubqueryOutputWalker.php change: for: |
| Comments |
| Comment by Marc Drolet [ 14/May/12 ] |
|
rownum instead of numrow. sorry. $sql = sprintf('SELECT b.*, rownum as rn FROM (SELECT DISTINCT %s, rownum FROM (%s) ORDER BY rownum ASC) b', |
| Comment by Benjamin Eberlei [ 07/Jul/12 ] |
|
Doctrine 2.2.2 doesnt have the LimitSubqueryoutputWalker and Doctrine 2.3-dev does not have the line in the code. Can you make a more explicit statement of where the change is necessary? |
| Comment by Marc Drolet [ 09/Jul/12 ] |
|
It's in the Pagination of version 2.2.2. ORM/Tools/Pagination/LimitSubqueryOutputWalker.php |
| Comment by Benjamin Eberlei [ 09/Jul/12 ] |
|
This is the 2.2 branch, https://github.com/doctrine/doctrine2/tree/2.2/lib/Doctrine/ORM/Tools/Pagination and https://github.com/doctrine/doctrine2/tree/2.2.2/lib/Doctrine/ORM/Tools/Pagination is the 2.2.2 tag. no LimitSubqueryOutputWalker.php in there. |
| Comment by Benjamin Eberlei [ 29/Aug/12 ] |
|
Fixed |
| Comment by Raymond Kolbe [ 09/Apr/13 ] |
|
This issue is popping it's head up again! Benjamin, your tests don't test for the ordering problem unless those tests are happening somewhere else? https://github.com/doctrine/doctrine2/commit/f55b5411c8b1f75bf2b5cf5ffe4bc50034fb91cb I am performing a query as complex as Marc's and I experience the same exact issue. I have checked out today's latest master branch as well as the 2.3 tag with no change. Please advise. |
| Comment by Raymond Kolbe [ 09/Apr/13 ] |
|
I have a PR in https://github.com/doctrine/doctrine2/pull/645 |