Ticket #1751 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

[PATCH] multiple Doctrine_Record_Filter_Compound not working as expected

Reported by: caefer Owned by: romanb
Priority: critical Milestone: 1.0.6
Component: Record Version: 1.1-DEV
Severity: Keywords:
Cc: Has Test: no
Status: Pending Core Response Has Patch: no

Description

I am building a model that is using two more models as compounds.

public function setUp()
{
  //...
  $this->getInvoker()->unshiftFilter(new Doctrine_Record_Filter_Compound(array('FirstModel')));
  $this->getInvoker()->unshiftFilter(new Doctrine_Record_Filter_Compound(array('SecondModel')));
}

Now I can call

echo $myModel->fieldOnFirstModel;

instead of

echo $myModel->FirstModel->fieldOnFirstModel;

But calling

echo $myModel->fieldOnSecondModel;

Will return NULL no matter what the actual value is.

If I remove the first unshiftFilter()

The same call will return the equivalent to

echo $myModel->SecondModel->fieldOnSecondModel;

Attachments

compound.diff (0.8 KB) - added by caefer 7 months ago.
[PATCH] for Compound.php

Change History

Changed 7 months ago by caefer

[PATCH] for Compound.php

Changed 7 months ago by caefer

  • status changed from new to closed
  • resolution set to fixed
  • summary changed from multiple Doctrine_Record_Filter_Compound not working as expected to [PATCH] multiple Doctrine_Record_Filter_Compound not working as expected

I think I spotted the error in the code. the filterGet() and filterSet() methods did not throw any exception in case the field does not exist. in that case they didn't return anything. So this little return was translated to an empty string which was causing even more trouble.

Changed 7 months ago by jwage

  • milestone changed from New to 1.0.5

Changed 7 months ago by jwage

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 7 months ago by jwage

  • status changed from reopened to closed
  • resolution set to fixed

(In [5310]) [1.0, 1.1] Fixes issue with compound filters (closes #1751)

Changed 7 months ago by jwage

  • milestone changed from 1.0.5 to 1.0.6
Note: See TracTickets for help on using tickets.