Re: Plugin's model methods is missing
On Jan 26, 11:20 pm, Martin Westin wrote: > Oh, and don't think that it is enough to only check the "relevant" > places. If you have a model loaded that has an error in the > association this can affect your controller's direct relation to > OrderProduct. thanks RoVo and Martin for the help. I double checked the naming in my controller but did not thought that I should also add one in the plugin's models. When I did, it worked. thanks again! jaro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Plugin's model methods is missing
Hi, I have an application created last year using the rc2 release. When I upgraded the core to the stable release, I had a few problems accessing methods in my plugin's model. I have an ShoppingCart.OrderProduct model. The OrderProduct model has a function named "was_purchased". It just basically checks if a certain product was purchased by the given user. In my AccountController, it is outside my plugin I called it this way $this->OrderProduct->was_purchased($order_id, $user_id); The above line gave me the following error: Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'was_purchased' at line 1 [CORE\cake\libs \model\datasources\dbo_source.php, line 514] Query: was_purchased In the previous cake version, it works fine. We are actually using it in our production. Any idea? I have checked it with google and the docs but I am probably missing the help I need. Cheers, jaro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to create test cases for plugins
Hi, I've been reading a lot about test cases but cannot find a how-to approach in testing plugins controllers. Read the tutorial in http://book.cakephp.org/view/160/testing#testing-plugins-485 but that was only for models. I created the ffg to test my pizza_controller.php. I named it pizza_controller.test.php class PizzaControllerTest extends CakeTestCase { function startCase() { echo 'Starting Test Case'; } function endCase() { echo 'Ending Test Case'; } function startTest($method) { echo 'Starting method ' . $method . ''; } function endTest($method) { echo ''; } function testIndex() { $result = $this->testAction('/shopping_cart/index'); debug($result); } } Nothing is displayed in the test.php page. What am I missing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Convenient $html->link()
I wonder why in AppModel... Can you share the code? :) On May 28, 9:17 pm, grigri <[EMAIL PROTECTED]> wrote: > heh, I did this too (c/a/p shortcuts) but I put them in > AppModel::url() instead. It works transparently then. > > On May 28, 1:29 pm, jaro <[EMAIL PROTECTED]> wrote: > > > Thought to share it here ... > > > Extended the html helper to so that I can use shortcut keys when > > creating links in cakephp views. > > > Old way: > > echo $html->link( 'Link Test', array( 'controller' => > > 'long_controller_name', 'actions' => 'index', 'plugin' => > > 'long_plugin_name' ) ); > > > New way: > > echo $xhtml->link( 'Link Test', array( 'c' => 'long_controller_name', > > 'a' => 'index', 'p' => 'long_plugin_name' ) ); > > > OR > > echo $xhtml->link( 'Link Test', array( 'long_controller_name', > > 'index', 'long_plugin_name' ) ); > > > for the keys, c = controller, a = action, p = plugin > > > OR use array numbers > > > 0 = controller, 1 = action, 2 = plugin > > > Anyone interested, here is the > > file:http://cakephp.prometsupport.com/wp-content/uploads/2008/05/xhtmlphph... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Convenient $html->link()
Thought to share it here ... Extended the html helper to so that I can use shortcut keys when creating links in cakephp views. Old way: echo $html->link( 'Link Test', array( 'controller' => 'long_controller_name', 'actions' => 'index', 'plugin' => 'long_plugin_name' ) ); New way: echo $xhtml->link( 'Link Test', array( 'c' => 'long_controller_name', 'a' => 'index', 'p' => 'long_plugin_name' ) ); OR echo $xhtml->link( 'Link Test', array( 'long_controller_name', 'index', 'long_plugin_name' ) ); for the keys, c = controller, a = action, p = plugin OR use array numbers 0 = controller, 1 = action, 2 = plugin Anyone interested, here is the file: http://cakephp.prometsupport.com/wp-content/uploads/2008/05/xhtmlphphelper.txt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---