Re: [CakePHP : The Rapid Development Framework for PHP] #4131: Plugins: useTable property of associated models appears to be ignored

2009-04-09 Thread CakePHP : The Rapid Development Framework for PHP
#4131: Plugins: useTable property of associated models appears to be ignored
---+
Reporter:  shamanZA 
   | Owner: 
Type:  Bug  
   |Status:  closed 
Priority:  High 
   | Milestone:  1.2.x.x
   Component:  Plugins  
   |   Version:  RC1
Severity:  Major
   |Resolution:  invalid
Keywords:  plugins model association useTable shamanZA phpnut rpeterson 
the_undefined  |   Php_version:  n/a
Cake_version:   
   |  
---+
Changes (by mark_story):

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

Comment:

 Your model relations are incorrect.  You need to add the plugin prefix to
 your associations. ie 'Myplugin.RootMenu' see
 http://book.cakephp.org/view/117/Plugin-Models

-- 
Ticket URL: 
CakePHP : The Rapid Development Framework for PHP 
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 tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to 
tickets-cakephp+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~--~~~~--~~--~--~---



Re: [CakePHP : The Rapid Development Framework for PHP] #4131: Plugins: useTable property of associated models appears to be ignored

2009-04-09 Thread CakePHP : The Rapid Development Framework for PHP
#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:   
   |  
---+
Comment (by bcl):

 I have just attached a clean test case that demonstrates the problem. SQL
 for the database is in pluginbug.sql in the top of the archive. See the
 included README.txt for instructions on how to reproduce the bug:


  1. pluginbug.sql should be loaded into the database to use for the test.
  2. Setup the $default connection to point to the database
  3. Install the pluginbug tree under ./app/plugins/
  4. browse to http://yoururl/pluginbug/root_menus/
  5. Observe success
  6. browser to http://yoururl/pluginbug/sub_menus/
  7. Observe success
  8. Edit ./app/plugins/pluginbug/models/root_menu.php to uncomment the
 $hasMany definition
  9. Edit ./app/plugins/pluginbug/models/sub_menu.php to uncomment the
 $belongsTo definition
  10. browse to http://yoururl/pluginbug/root_menus/
  11. Observe failure: Error: Database table sub_menus for model SubMenu
 was not found.
  12. browser to http://yoururl/pluginbug/sub_menus/
  13. Observe failure: Error: Database table root_roots for model MenuRoot
 was not found.
  14. Copy ./app/plugins/pluginbug/models/*.php to ./app/models/
  15. browse to http://yoururl/pluginbug/root_menus/
  16. Observe success
  17. browser to http://yoururl/pluginbug/sub_menus/
  18. Observe success

-- 
Ticket URL: 
CakePHP : The Rapid Development Framework for PHP 
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 tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to 
tickets-cakephp+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~--~~~~--~~--~--~---



Re: [CakePHP : The Rapid Development Framework for PHP] #4131: Plugins: useTable property of associated models appears to be ignored

2009-04-09 Thread CakePHP : The Rapid Development Framework for PHP
#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: 
CakePHP : The Rapid Development Framework for PHP 
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 tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to 
tickets-cakephp+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~--~~~~--~~--~--~---