#1449: Wrong record state after selection
-----------------------+----------------------------------------------------
  Reporter:  mm        |       Owner:  romanb                                 
      Type:  defect    |      Status:  new                                    
  Priority:  critical  |   Milestone:  1.0.3                                  
 Component:  Record    |     Version:  1.0                                    
Resolution:            |    Keywords:  record, proxy, STATE_PROXY, STATE_DIRTY
  Has_test:  0         |    Mystatus:  Pending Core Response                  
 Has_patch:  0         |  
-----------------------+----------------------------------------------------
Old description:

> Im just after update from 0.11.1 (with few patches) to 1.0.1 (Postgresql
> DB).
>
> Here is a example of simple query with one join (1-n relation), no big
> deal.
>
> $query = Doctrine_Query::create()
> ->select('d.id, d.number, a.id')
> ->from('Document d')
> ->innerJoin('d.Attachment a')
> ->orderBy('d.id DESC')
> ->execute();
>
> $query[0]->date (returns correct date via lazy loading)
> $query[0]->Attachment[0]->date (returns null, field in db isnt empty,
> believe or not)
>
> Reason:
>
> Record $query[0] has state 4 (STATE_PROXY) so we able to retrieve rest of
> data from db, but $query[0]->Attachment[0] has state 1 (STATE_DIRTY) as
> all related records (!?!?)
>
> There is no patch till now, maybe I miss something. Thanks for advice.

New description:

 Im just after update from 0.11.1 (with few patches) to 1.0.1 (Postgresql
 DB).

 Here is a example of simple query with one join (1-n relation), no big
 deal.

 $query = Doctrine_Query::create()
 ->select('d.id, d.number, a.id')
 ->from('Document d')
 ->innerJoin('d.Attachment a')
 ->orderBy('d.id DESC')
 ->execute();

 $query[0]->date (returns correct date via lazy loading)
 $query[0]->Attachment[0]->date (returns null, field in db isnt empty,
 believe or not)

 Reason:

 Record $query[0] has state 4 (STATE_PROXY) so we able to retrieve rest of
 data from db, but $query[0]->Attachment[0] has state 1 (STATE_DIRTY) as
 all related records (!?!?)

 There is no patch till now, maybe I miss something. Thanks for advice.

 '''More info'''

 To have access to data in Attachment, we need to specify every field in
 query otherwise, no chance to load it via lazy loading, because of actual
 record state (STATE_DIRTY). Version 0.11.1 had different behaviour,
 records on every level have same state STATE_PROXY which is also expected
 here. In this case only Document class records have STATE_PROXY.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1449#comment:5>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to