#4131: Plugins: useTable property of associated models appears to be ignored
-------------------------------------------------------------------------------------------+
    Reporter:  shamanZA                                                         
           |         Owner:          
        Type:  Bug                                                              
           |        Status:  reopened
    Priority:  High                                                             
           |     Milestone:  1.2.x.x 
   Component:  Plugins                                                          
           |       Version:  RC1     
    Severity:  Major                                                            
           |    Resolution:          
    Keywords:  plugins model association useTable shamanZA phpnut rpeterson 
the_undefined  |   Php_version:  n/a     
Cake_version:                                                                   
           |  
-------------------------------------------------------------------------------------------+
Changes (by bcl):

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

Comment:

 This is a current problem with v1.2.2.8120

 I have db tables that don't conform to the Cake style so I use useTable in
 the model definitions. I am building a plugin, not an app which is where I
 think the problem lies.

 My simple controller and view work fine with no hasMany or belongsTo
 associations.

 When I add hasMany and belongsTo associations to the models I get errors
 that look like the belongsTo didn't find the associated model definition.

 {{{ Error: Database table menu_roots for model MenuRoot was not found. }}}

 I moved the plugin to the app's controllers, models, views directories and
 it works fine with the associations included.

 So, I suspect that when hasMany and belongsTo searches for the models it
 doesn't include the plugin models directory, only the app models
 directory. This is supported by the fact that if I leave my plugin in
 app/plugin and make a copy of the plugin models in app/models/ it now
 works with the associations included in the model.

-- 
Ticket URL: <https://trac.cakephp.org/ticket/4131#comment:6>
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
-~----------~----~----~----~------~----~------~--~---

  • Re: [CakePHP : The Rapid... CakePHP : The Rapid Development Framework for PHP

Reply via email to