[DC-963] Doctrine cache - Salt dissociation Created: 03/Feb/11 Updated: 18/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Critical |
| Reporter: | Thomas Tourlourat - Armetiz | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
Doctrine Cache store data into a persistence storage. Regarding APC, Doctrine use a share storage. I'm using a server to host two Doctrine project, a preproduction & production Website. In some case, DQL is the same on both project, but the data model definition isn't. Preproduction convert DQL to SQL using data model definition, and store the SQL result into APC cache refer to the DQL hash. I'm not sure about the quality of this explanation... But I can add some information is needed. The solution of this problem is easy. Just add a SALT to any cache id's. It's a Doctrine_Cache problem, not only a Doctrine_Cache_APC problem.. $cacheDriver = new doctrine_Cache_Apc (); |
| Comments |
| Comment by Thomas Tourlourat - Armetiz [ 03/Feb/11 ] |
|
to complete this bug, I think it's also a problem on DC 2.. |
| Comment by Jaik Dean [ 18/Apr/11 ] |
|
There is already an (undocumented?) option "prefix" that allows this. $cacheDriver = new Doctrine_Cache_Apc(array('prefix' => 'MY UNIQUE SALT')); |
[DC-924] type mismatch for keyfield in column aggregation Created: 11/Nov/10 Updated: 11/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Inheritance |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Arnaud Morvan | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PostgreSQL |
||
| Description |
|
This is the doc exemple on column aggregation inheritance : Entity: User: Group: But the keyField (type) is created as VARCHAR(255) so PostgreSQL return an error on applying inheritance condition : SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: character varying = integer I found this with symfony sfFilebasePlugin on sfFilebase:create-root task. |
[DC-925] missing hasOne() method-call in many-to-many relation Created: 11/Nov/10 Updated: 11/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Simon Schick | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian Lenny |
||
| Description |
|
Here's my YAML-file for the model: http://pastie.org/1290649 I'm using the following command to build the whole model: symfony doctrine:build --all --and-load Please have a closer look at the class BaseTicketHasHardware: http://pastie.org/1290737 |
[DC-902] Xcache Cache Driver is not documented Created: 26/Oct/10 Updated: 26/Oct/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching |
| Affects Version/s: | 1.2.0-ALPHA1, 1.2.0-ALPHA2, 1.2.0-ALPHA3, 1.2.0-BETA1, 1.2.0-BETA2, 1.2.0-BETA3, 1.2.0-RC1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Piotr Leszczyński | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
Xcache Cache Driver is not documented at all. Is it working? Is it stable? Can we use it? |
[DC-870] NestedSet not moving children of child nodes correctly Created: 20/Sep/10 Updated: 20/Sep/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Nested Set |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Ashley Broadley | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 10.04 x64 |
||
| Description |
|
The best way I can explain the issue is with code. Please see the below: <?php
$root = new Test();
$root->name = '1';
$root->save();
// Create root node
$tree = Doctrine::getTable('Test')->getTree();
$tree->createRoot($root);
// Create child node
$child1 = new Test();
$child1->name = '2';
$child1->save();
// Add child
$child1->getNode()->moveAsLastChildOf($root);
// Create child node
$child2 = new Test();
$child2->name = '3';
$child2->save();
// Add child2 as node of child1
$child2->getNode()->moveAsLastChildOf($child1);
// Create child node
$child3 = new Test();
$child3->name = '4';
$child3->save();
// Add child3 as node of child2
$child3->getNode()->moveAsLastChildOf($child2);
// Add another root just to be nice
$root2 = new Test();
$root2->name = '5';
$root2->save();
// Create root node
$tree->createRoot($root2);
/**
* Now we have the following tree (Each '-' indicates 1 level):
* 1
* - 2
* - - 3
* - - - 4
* 5
*/
/**
* Lets say I want to move node '3' to be a root.
* With this I assume that all of the current nodes
* children will be moved with it:
*/
$tree->createRoot(child2);
/**
* Now the (implied) tree should look like this:
* 1
* - 2
* 3
* - 4
* 5
*
* Instead, the tree actually looks like this:
* 1
* - 2
* - - - 4
* 3
* 5
*/
/**
* I will now demostrate incorrect moving back of child nodes.
*/
$child2->getNode()->moveAsLastChildOf($child1);
/**
* Now the tree should go back to looking like this:
* 1
* - 2
* - - 3
* - - - 4
* 5
*
* But the tree now looks like this:
* 1
* - 2
* - - - 4
* - - 3
* 5
*/
|
| Comments |
| Comment by Ashley Broadley [ 20/Sep/10 ] |
|
Fixing code spacing |
| Comment by Ashley Broadley [ 20/Sep/10 ] |
|
I have also noticed that moving a root node back into its original position as a child also corrupts the tree. I have added an example to the original post |
[DC-1015] bindComponent not called before inherited classes base definitions Created: 04/Jul/11 Updated: 04/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Inheritance, Schema Files |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Adrian Nowicki | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
symfony 1.4 |
||
| Description |
|
If I define a base model: Entity: and inherited model: Box: Then file with base definition of Box does not contain bindComponent sentence to bind Box model with connection specified for Entity model. |
[DC-999] Query cache key can be incorrectly generated Created: 28/Apr/11 Updated: 27/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching, Query |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jakub Zalas | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
1. We have two versions of the application on the same server. Situation often happens on shared development machine when one developer adds a field but others don't have in their models yet. It also happens on staging server if it's shared with production. I suspect it only affects queries without explicitly listed fields. To quickly fix the issue in my symfony project I extended Doctrine_Cache_Apc to implement namespaces (https://gist.github.com/944524). More appropriate place to fix it would be Doctrine_Query_Abstract::calculateQueryCacheHash(). |
| Comments |
| Comment by Pablo Grass [ 27/Jun/11 ] |
|
Could this be a duplicate of http://www.doctrine-project.org/jira/browse/DC-389 ? |
[DC-971] Tree result sets hydrators are checking for column level not field level Created: 16/Feb/11 Updated: 16/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Nested Set |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Miloslav "adrive" Kmet | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Tree hierarchy hydrators (Doctrine_Collection::toHierarchy and Doctrine_Array_Hierarchy_Driver::hydrateResultSet) are checking wheter the column `level` exists. The level column can be aliased, and for oracle, it is required to do so. Therefor it is better to check, whether the aliased field level exists. Patch included in pull request |
[DC-946] Oracle Doctrine_RawSql()->count() generates illegal SQL Created: 08/Dec/10 Updated: 06/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Native SQL |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Lars Pohlmann | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | oracle | ||
| Description |
|
Example RawSQL: $q = new Doctrine_RawSql(); $q->select('{k.*}') ->from('SHP_MANDANT_KATEGORIE k') ->addComponent('k', 'ShpMandantKategorie k') ->where( 'k.id_mandant=' . $this->getIdMandant() ) ->andWhere( 'k.id_parent=' . $this->getIdMandantkategorie() ) ->andWhere( 'k.aktiv=1' ) ->orderBy( 'k.sortorder' ); $q->count() generates: SELECT COUNT(*) as num_results FROM (SELECT DISTINCT k.id_mandantkategorie FROM SHP_MANDANT_KATEGORIE k WHERE k.id_mandant=2 AND k.id_parent=1520 AND k.aktiv=1) as results The illegal Part ist the "as results" at the end... |
| Comments |
| Comment by Lars Pohlmann [ 06/Aug/12 ] |
|
Hi, will this ever be corrected? |
[DC-1057] Inserts instead of updates for related objects Created: 20/Jul/12 Updated: 20/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Grzegorz Godlewski | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
linux, apache2, php 5.3 |
||
| Description |
|
Ok, so the object relations go like this:
The testing code looks like following: == CODE START == Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml $comp = new Application_Model_Comparison(); /* Filling $comp with data */ for ($i = 0; $i < 10; $i++) { $product = new Application_Model_Product(); // Options referenced in Rules $options = array(); for ($j = 0; $j < 10; $j++) { $param = new Application_Model_Parameter(); for ($k = 0; $k < 10; $k++) { $option = new Application_Model_Option(); $param->Options->add($option); // Register a single option for this parameter if (!isset($options[$j])) { $options[$j] = $option; } } $product->Parameters->add($param); } for ($j = 0; $j < 10; $j++) { $rule = new Application_Model_Rule(); $rule->Option = $options[$j]; $product->Rules->add($rule); } $comp->Products->add($product); } /** * The first save() goes nicely, all objects * are created (INSERTed) */ $comp->save(); // Remove every second product $pCount = $comp->Products->count(); for ($i = 0; $i < $pCount; $i += 2) { $comp->Products->remove($i); } /** * Fails while trying to save * * Comparison->Product->Parameter->Option * INSERT ... `parameter_id` cannot be NULL * * Comparison->Product->Rule * INSERT ... `product_id` cannot be NULL */ $comp->save(); == CODE END == The first save() cleans up the relation information in the graph. All child objects are INSERTED instead of UPDATE. |
[DC-829] Hydrator/RecordDriver/setLastElement And APC useResultCache Created: 16/Aug/10 Updated: 16/Aug/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | PIERRONT Julien | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
1) I have a Query with APC useResultCache with leftJoin between User and Avatar. (With no avatar for this User). On the first show of my page => OK In Hydrator/RecordDriver.php setLastElement() $coll is instanceOf Doctrine_Null and count($coll) return 1, so => Crash because ->getLast doesn't exist in Doctrine_Null class If you add in setLastElement() (Before if (count($coll) > 0) .... if ($coll instanceOf Doctrine_Null) { return; }It's works. |
[DC-812] Postgresql and query cache Created: 06/Aug/10 Updated: 06/Aug/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | admirau | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Postgresql 8.4, Ubuntu 10.04, PHP 5.3, latest APC and Memcache, Memcached |
||
| Description |
|
After enabling: $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, $cacheDriver); I get: Doctrine_Connection_Pgsql_Exception: SQLSTATE[08P01]: <>: 7 ERROR: bind message supplies 8 parameters, but prepared statement "pdo_stmt_00000008" requires 16 in /home/taat/www/library/Doctrine/1.2.2/lib/Doctrine/Connection.php on line 1082 Without the cache everything works OK. Maybe this may help somehow: |
[DC-807] Equal nest relation uses incorrect SQL and returns incorrect data Created: 03/Aug/10 Updated: 03/Aug/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Nested Set |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Denis Chmel | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian |
||
| Description |
|
The equal nest relation works incorrectly twice. The SQL it produces is wrong. And even if correct the SQL it still returns wrong data. Here goes steps to reproduce. Schema.yml Profile: Fixtures: Profile: UserFriend: PHP test Output [1]=> } } As it can be seen from output, the relation "UserFriend" shows insane data:
|
| Comments |
| Comment by Denis Chmel [ 03/Aug/10 ] |
|
If this will be useful. here's the SQL it produces: SELECT It's very clear that an OR in the inner join and another OR in where are not connected, while they must be. Here's the correct part (in my opinion) ... But this only fixes the problem with 2 records in "UserFriends", but not the second ("user 4 has friendship with 4 - that's also wrong, not in the fixtures."). |
[DC-905] Fields with foreign key shouldn't require definition Created: 29/Oct/10 Updated: 31/Oct/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Alaattin Kahramanlar | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Sample schema attached. Now, keeping attached schema in mind. We have core tables that lots of other tables refer via foreign keys to them, like user, company, etc. We need to explicitly define foreign keys (like user_id) "definitely same as" User.id on each table. By design, this seems unnecessary, and has load on refactoring processes, ie. type change on User.id. Doctrine is already parsing foreign relations from schema, It can use parent table field definition (User.id) in refering table fields (user_id) and on the schema user_id can be defined as: user_id: ~ |
[DC-891] [PATCH] Relation array as the result of Doctrine_Table::bind() Created: 18/Oct/10 Updated: 18/Oct/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Eugene Leonovich | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
It would be handy to return a relation array as the result of Doctrine_Table::bind(), because the relation parser's bind() already returns this value. |
[DC-890] public function detach break the nested set tree [patch attached] Created: 14/Oct/10 Updated: 14/Oct/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Nested Set |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alexandre PAIXAO | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
not environment dependant |
||
| Attachments: |
|
| Description |
|
If I detach a node from the tree using $node->detach(); it set the left and right value to zero without shifting, creating a possible tree corruption. I've looked to the original commit in Trac (http://trac.doctrine-project.org/changeset/4089) and I don't think the original idea of the commit was to leave a hole. |
| Comments |
| Comment by Alexandre PAIXAO [ 14/Oct/10 ] |
|
ex: root 1 4 after detach : root 1 4 then a new one : root 1 6 |
[DC-1001] Doctrine Caching page does not mention the "prefix" option Created: 29/Apr/11 Updated: 27/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching, Documentation |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Arend van Waart | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
http://www.doctrine-project.org/documentation/manual/1_1/en/caching When not using a prefix with multiple / yet similay projects a mixup of query caching will occur (for example with sfDoctrineGuard queries). This is very easialy fixed with a prefix - but I only realized after two months - that this feature actually existed. There is no mention of this in the documention. A mention of the feature $q = Doctrine_Query::create() Would have helped me and I think it will also help others. |
| Comments |
| Comment by Pablo Grass [ 27/Jun/11 ] |
|
I concur with Arend - mentioning of 'prefix' in the documentation could make this valuable feature much less of a pain to find... |
[DC-945] Doctrine_Query::create()->where('table.field =') unexpectedly returns a result Created: 06/Dec/10 Updated: 07/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Huijbers | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3.0 |
||
| Description |
|
While firing the following query with Doctrine, I did not expect Doctrine to return me a record, however, even though there is a syntax error (in my opinion) it gave me the first record of the table. $q = \Doctrine_Query::create() $r = $q->fetchOne(); Note that the question mark in the where method is ommitted. This will return a User model with an Id of 1. I would expect this to generate an invalid SQL statement (or even fail to pass the DQL validation). Giving the first record doesn't seem to be appropriate in my opinion. |
[DC-993] Many-to-many Relation defined one way Created: 05/Apr/11 Updated: 05/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | 1.2.2, 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Klaas van der Weij | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MySQL database, Lenny |
||
| Description |
|
When a many-tomany relation has been defined on only one of the end of the relation, and ofcourse in the cross-refClass, things get weird. I'll use the user-groups relation (as found in the documentation) as example. If in the group model has not defined the hasMany, then a user can be instantiated and saved. When instantiated, the relation groups would return an empty array, groups can ben added like: $u = new User(); var_dump($u->groups); $u->groups[] = new Group(); var_dump($u->groups); This would output an empty array, and subsequently an array containing the new group. However, if a user would be retrieved from the database, and the relation groups would be called, then the following message will appear (which is not helpfull at alllll, I've spend hours figuring it out!): Uncaught exception 'Doctrine_Record_UnknownPropertyException' with message 'Unknown record property / related component "groups"' ..... I will never forget this, but it's not described in the documentation and the error is not helping either. So either one of these step hvae to be taken. Or even better, making it work without requiring the hasMany in group, to users. |
[DC-607] Doctrine concrete inheritance link between tables Created: 30/Mar/10 Updated: 21/Jul/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Inheritance |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Julien Chiron | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Symfony 1.4.3, php5.3.0 (snow leopard version) |
||
| Description |
|
Hi, I pointed out a strange problem: Batch:
columns:
code: string
is_pure: boolean
Flask:
columns:
batch_id: integer
code: string
quantity: integer
relations:
Batch:
local: batch_id
foreign: id
foreignType: many
ProducedBatch:
inheritance:
type: concrete
extends: Batch
columns:
production_date: date
BoughtBatch:
inheritance:
type: concrete
extends: Batch
columns:
supplier: string
ProducedFlask:
inheritance:
type: concrete
extends: Flask
columns:
weight: integer
BoughtFlask:
inheritance:
type: concrete
extends: Flask
columns:
price: integer
The problem occurs when I try to populate the database. ProducedBatch:
B1:
code: Batch1
ProducedFlask:
F1:
Batch: B1
code: Flask1
When loading fixtures, I get a Invalid row key specified: (batch) B1, referred to in (produced_flask) F1 In fact, Doctrine doesn't take into account the primary key inherited from Flask table. The only solution to solve this is to set a relationship between each couple of sub-table (ProducedFlask -> ProducedBatch and BoughtFlask -> BoughtFlask). |
| Comments |
| Comment by TD [ 21/Jul/10 ] |
|
It is very strange that the doctrine inheritance system don't inherite all the relationship of the mother-table on all sub-table. I think that it will be a very good improvement to fix this problem. For example if you are this model : Unable to find source-code formatter for language: yml. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
motherTable:
columns:
code: string
relationTable_id: integer
relation:
relationTableRelation:
local: relationTable_id
foreign: id
type: one
subTable:
inheritance:
type: concrete
colums:
name: string
relationTable:
columns:
code: integer
relations:
motherTableRelation:
local: id
foreign: relationTable_id
type: many
In this example, the relationTableRelation will be inherited, it is good but the other side of the relation in relation table will always go on motherTable and not on subTable, but motherTable is always empty, moreover subTable don't share its ID with motherTable, so this side of the relationship is unusefull because we can find subTable element in relation with a relationTable element. It will be good to find a solution to this issue |
[DC-497] A new task to set migration to a certain version Created: 12/Feb/10 Updated: 13/Feb/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | 1.2.1 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Stephen Ostrow | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
It would be nice to have a task which you could tell to set to the proper version. If the migrations_version table did not exist yet, it would create the table and set the version. Explanation: It might also be better to just update the migrate task to check if a migration_version table exists, if not to just run the single migration which is specified. |
[DC-464] [Inheritance] Couldn't save record with inheritance by a relationship if the record has no column modified (solution proposed) Created: 29/Jan/10 Updated: 09/Jun/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Inheritance |
| Affects Version/s: | 1.2.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Colin Darie | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Please consider the following TestCase Inheritance with no property setted, saved by relationship class Doctrine_Ticket_DC464_TestCase extends Doctrine_UnitTestCase { public function prepareTables() { $this->tables[] = 'Ticket_DC464_Entity'; $this->tables[] = 'Ticket_DC464_Article'; $this->tables[] = 'Ticket_DC464_User'; $this->tables[] = 'Ticket_DC464_Group'; parent::prepareTables(); } public function testTest() { $User = new Ticket_DC464_User(); $Article = new Ticket_DC464_Article(); $Article->title = 'my first article'; $Article->Author = $User; $Article->save(); $UserFetched = Doctrine::getTable('Ticket_DC464_User')->find(1); $this->assertTrue($UserFetched instanceof Ticket_DC464_User); //$this->assertEqual($UserFetched->type, 1); } } class Ticket_DC464_Entity extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('id', 'integer', 11, array('autoincrement' => true, 'primary' => true)); $this->hasColumn('facultative_field', 'string', 255); $this->hasColumn('type', 'string', 255); $this->setSubClasses(array( 'Ticket_DC464_User' => array('type' => 1), 'Ticket_DC464_Group' => array('type' => 2), )); $this->option('type', 'InnoDB'); } public function setUp() { } } class Ticket_DC464_User extends Ticket_DC464_Entity { } class Ticket_DC464_Group extends Ticket_DC464_Entity { } class Ticket_DC464_Article extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('id', 'integer', 11, array('autoincrement' => true, 'primary' => true)); $this->hasColumn('title', 'string', 30); $this->hasColumn('author_id', 'integer', 11); $this->option('type', 'InnoDB'); } public function setUp() { $this->hasOne('Ticket_DC464_User as Author', array( 'local' => 'author_id', 'foreign' => 'id')); } } Notice that in the test, the $User instance has no property setted (in fact in this test, the "useless_field" in the model is... useless). This test fails (the $User object is not saved) because the method UnitOfWork->saveRelatedLocalKeys() - called in saveGraph(), itself called by $Article->save() - returns false because no column has been modified (line 395). To fix this, the Record->assignInheritanceValues() should be executed in top of isModified(), or for each related object in UnitOfWork->saveRelatedLocalKeys() (and probably UnitOfWork->saveRelatedForeignKeys() too). I've attached the test. |
| Comments |
| Comment by Colin Darie [ 30/Jan/10 ] |
|
Fix test with the right prefixes |
| Comment by Jonathan H. Wage [ 15/Mar/10 ] |
|
Do you have a patch for the issue too? |
| Comment by Colin Darie [ 16/Mar/10 ] |
|
Hi, no I doesn't have a patch for this, because I was not sure what the best way to solve this. |
| Comment by Jonathan H. Wage [ 08/Jun/10 ] |
|
Can you provide a patch for that change then so I can see it and test it? Thanks, Jon |
| Comment by Colin Darie [ 09/Jun/10 ] |
|
I've attached the patch. Once again, this patch fix the issue but there is maybe a better way to fix it to avoid the assignInheritanceValues() at each time. Thanks. |
[DC-781] Column order in generated SQL is based on relationships, instead of SELECT clause Created: 10/Jul/10 Updated: 10/Jul/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Native SQL |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Prasad Gupte | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows / PHP 5.2.4 / MySQL 5.1.41 / Symfony 1.4.0 |
||
| Description |
|
When executing below query as follows: SQL generated is: Basically, columns are ordered based on relationships and not as defined in the SELECT clause |
[DC-752] Data type "decimal" can be unsigned in MySQL 5.0 Created: 18/Jun/10 Updated: 18/Jun/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Native SQL, Schema Files |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Ilya Sabelnikov | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OS: FreeBSD 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 amd64 |
||
| Description |
|
I have found in official docs of MySQL v5.0: Decimals can be unsigned: DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL] Here above is my "schema.yml" file: schema.yml
Project:
columns:
id:
type: integer(4)
unsigned: true
primary: true
autoincrement: true
salary_range_from:
type: decimal(12)
scale: 2
unsigned: true
After i run: ./symfony doctrine:build --all my "schema.sql" is: schema.sql CREATE TABLE `project` ( `id` INT AUTO_INCREMENT, `salary_range_from` DECIMAL(12, 2), INDEX `company_id_idx` (`company_id`), PRIMARY KEY(`id`) ) DEFAULT CHARACTER SET utf8 ENGINE = INNODB; |
[DC-1032] [PATCH] Doctrine_Collection::isModified() does not support deep like Doctrine_Record but probably should Created: 23/Aug/11 Updated: 23/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial |
| Reporter: | Christian Roy | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
$record instanceof Doctrine_Record; Using the $record object I can find out if it has been modified : $record->isModified(). However, the $collection object only support the first level and not the relations of its member records, The improvement would be to allow this method to accept true, like it's $record counterpart, which would return true instead. See attached patch. |
[DC-730] "// ?? should this not be $this->_table->getComponentName() ??" in Doctrine/Relation/Parser.php Created: 12/Jun/10 Updated: 16/Jun/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Trivial |
| Reporter: | Guilliam X | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
doctrine1 svn 1.2 rev. 7676 |
||
| Attachments: |
|
| Description |
|
In class Doctrine_Relation_Parser, in method completeDefinition(), at line 508 (for svn r.7676) there is the code: php foreach ((array) $this->_table->getIdentifierColumnNames() as $id) {
// ?? should this not be $this->_table->getComponentName() ??
$column = strtolower($table->getComponentName())
. '_' . $id;
The comment on line 509 seems right, since $table is a "temporary" variable created in a previous foreach loop a few lines before (l. 472) and not used anywhere else... (I didn't make a test case though, that's why I tagged it as "Task" rather than "Bug") I attached a patch, just in case. G.X |
| Comments |
| Comment by Guilliam X [ 15/Jun/10 ] |
|
Edited the patch with "branches/1.2" as root I can't provide a test case but they all run without failure after patching |
| Comment by Guilliam X [ 16/Jun/10 ] |
|
Converted patch to Unix-like EOL style (was made on Windows...) |