#5505: Tree behavior setting scope => Model does not work
--------------------------+-------------------------------------------------
    Reporter:  xumix      |         Owner:          
        Type:  Bug        |        Status:  reopened
    Priority:  Medium     |     Milestone:  1.2.x.x 
   Component:  Behaviors  |       Version:  RC2     
    Severity:  Normal     |    Resolution:          
    Keywords:             |   Php_version:  n/a     
Cake_version:             |  
--------------------------+-------------------------------------------------
Changes (by iGloo):

  * status:  closed => reopened
  * resolution:  needmoreinfo =>

Comment:

 
[https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/tests/cases/libs/model/behaviors/tree.test.php#L1238]


 The tests scripts attach the tree behavior with id's set. When doing it in
 the model with

 $actsAs = array('Tree'=>array('scope'=>'Project'));

 it doesn't work.

 same with:

 
[https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/tests/cases/libs/model/behaviors/tree.test.php#L1278]


 The test case attach behaviors 'on the fly'. Doing it in the controller
 works but setting up the scope in the model will not work.

 EX:
 tree rows contains project_id. the model has belongsTo = Project.

 We have 2 different project_id in the table. The mptt trees should be
 different for each project, thus using the scope = Project.

 It will not work unless the behavior is attached in the controller with
 scope = array('project_id', $project_id)

-- 
Ticket URL: <https://trac.cakephp.org/ticket/5505#comment:9>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" 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.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to