Re: Bug? - $form-select() doesn't populate data, but $form-input() does
try groups On Mon, Mar 3, 2008 at 11:07 PM, Baz [EMAIL PROTECTED] wrote: Stumbled onto this, hoping someone could guide me as to what is the expected behavior before I file a ticket in trac: Trying to add a select drop down list: Let's assume, we have a simple model with a belongs_to Group, he we have a group_id. //controller: $group = $this-MyModel-find('list') $this-set(compact('group')); //veiw: // This works fine: $form-input('group_id') // This does not populate the data: $form-select('group_id'); -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug? - $form-select() doesn't populate data, but $form-input() does
Well, that's my question: Is this is bug (oversight)? $form-text, $form-checkbox both autofill, so should I report this? On Tue, Mar 4, 2008 at 12:34 AM, Samuel DeVore [EMAIL PROTECTED] wrote: On Mon, Mar 3, 2008 at 11:24 PM, Baz [EMAIL PROTECTED] wrote: I take it you meant: $form-select('groups')? $groups = $this-MyModel-find('list') $this-set(compact('groups')); Is what I was thinking, but I don't think FormHelper::select supports the auto finding of the options array like input does, if you look at the code from the api http://api.cakephp.org/1.2/form_8php-source.html#l00491 around line 535 you'll see where that is autofilled from in FormHelper::select http://api.cakephp.org/1.2/form_8php-source.html#l01002 you can see that there is no similar feature. So if you want it to work like input you probably need to file an enhancement ticket -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug? - $form-select() doesn't populate data, but $form-input() does
On Mon, Mar 3, 2008 at 11:24 PM, Baz [EMAIL PROTECTED] wrote: I take it you meant: $form-select('groups')? $groups = $this-MyModel-find('list') $this-set(compact('groups')); Is what I was thinking, but I don't think FormHelper::select supports the auto finding of the options array like input does, if you look at the code from the api http://api.cakephp.org/1.2/form_8php-source.html#l00491 around line 535 you'll see where that is autofilled from in FormHelper::select http://api.cakephp.org/1.2/form_8php-source.html#l01002 you can see that there is no similar feature. So if you want it to work like input you probably need to file an enhancement ticket -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake 1.2 Console - Fatal Errors - Possible Bug?
Make sure your svn:externals property is uses the repository at https://svn.cakephp.org/repo/branches/1.2.x.x/cake. I had the same problem as you where I was stuck at revision 6311, although svn reported that I was at the latest revision, because I was using the trunk. From the root directory of your cake install, do `svn propedit svn:externals cake` then paste: cake https://svn.cakephp.org/repo/branches/1.2.x.x/cake Now Im really at the latest revision. On Jan 4, 10:16 am, Larry E. Masters aka PhpNut [EMAIL PROTECTED] wrote: A duplicate ticket...Read my comment in the ticket On Jan 4, 2008 10:15 AM, Cake Fan [EMAIL PROTECTED] wrote: I submitted a ticket on this problem: https://trac.cakephp.org/ticket/3828 - Cake Fan On Jan 4, 11:16 am, Cake Fan [EMAIL PROTECTED] wrote: I'm a little confused about this, perhaps I'm missing something... but when I update via svn, this fix doesn't happen in my core library. For instance, I just looked at line 30 in schema.php (bug fix 6319) and the string class is not included after I updated. However, I manually added the 'string' class on my box in schema.php and it still didn't solve the problem in the console. - Cake Fan On Jan 3, 5:00 pm, Christian Winther [EMAIL PROTECTED] wrote: It looks related tohttps://trac.cakephp.org/ticket/3793andchangesethttps://trac.cakephp -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:57 To: Cake PHP Subject: Re: Cake 1.2 Console - Fatal Errors - Possible Bug? Christian, I am at Revision 6319, but the console still says 6311. I am only updating the cake folder, so I'm not changing the app or vendors folders at all. Am I missing something here because the problem still persists after I updated as you suggested. Thanks for the help! - Cake Fan On Jan 3, 3:32 pm, Christian Winther [EMAIL PROTECTED] wrote: Update to SVN head from 1.2 branch, was fixed there :) -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:20 To: Cake PHP Subject: Cake 1.2 Console - Fatal Errors - Possible Bug? I have my cake 1.2 shell script working properly in most regards; it will help me immensely in converting a large flat table into relational data for Cake consumption. However, in the shell, whenever I try to call any of the Model query commands, I get a failure. So far, it has happened with findCount(), find(), findall(), save(), and saveall(); The problem seems to be inconsistent and no matter what I try or eliminate, it seems to persist. My shell script ultra-simplified to this: -- function main() { $i = 0; while ($i 1000) { $formatted_data_array = array ( 'Business' = array ('name' = 'test') ); $this-Business-save($formatted_data_array, false); $i++; } } -- It will save one time successfully, and then errors out. I get the following error message from the console: ++ C:\Apache\htdocs\project\appcake raw_data Welcome to CakePHP v1.2.0.6311 beta Console --- App : app Path: C:\Apache\htdocs\project\app --- PHP Fatal error: Class 'String' not found in C:\Apache\htdocs\project \cake\libs\model\datasources\dbo_source .php on line 1455 Fatal error: Class 'String' not found in C:\Apache\htdocs\project\cake \libs\model\datasources\dbo_source.php on line 1455 C:\Apache\htdocs\project\app + Any help would be greatly appreciated! - Cake Fan -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Thought I found a bug and a solution for it
I have a few apps installed that I am working on locally I have cakephp set up to bake and all was fine. Yesterday I updated from svn. and Then all my apps rendered blank screen or displayed an error message. I managed to solve the issue. I put the following in cakes pages controller function dispatchMethod() { } Wanting to do the right thing I signed up to trac; I also tried a few more things to gather information to be logged on trac. This is where I got really confused - since I expected removing the addition I put in to return the error message (so I could copy the exact message). However the error remained fixed - no error message to copy. I emptied the cache of files too - everything still working. A touch confused by it, has anyone else experienced this? - its all very odd! - S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Thought I found a bug and a solution for it
Hi Sam, two things: (1) I just fixed a bug in Object::dispatchMethod() that may have been causing your issue. Update to the latest SVN and see if that fixes it. (2) If not (and I don't normally do this), but could you zip up the application that is causing the issue and email it to me? I'll see if I can't figure out what's causing the error. Thanks. On Feb 22, 11:23 am, Sam Sherlock [EMAIL PROTECTED] wrote: I have a few apps installed that I am working on locally I have cakephp set up to bake and all was fine. Yesterday I updated from svn. and Then all my apps rendered blank screen or displayed an error message. I managed to solve the issue. I put the following in cakes pages controller function dispatchMethod() { } Wanting to do the right thing I signed up to trac; I also tried a few more things to gather information to be logged on trac. This is where I got really confused - since I expected removing the addition I put in to return the error message (so I could copy the exact message). However the error remained fixed - no error message to copy. I emptied the cache of files too - everything still working. A touch confused by it, has anyone else experienced this? - its all very odd! - S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Thought I found a bug and a solution for it
I have updated to the latest SVN. All is well. thanks Nate :) On 23/02/2008, nate [EMAIL PROTECTED] wrote: Hi Sam, two things: (1) I just fixed a bug in Object::dispatchMethod() that may have been causing your issue. Update to the latest SVN and see if that fixes it. (2) If not (and I don't normally do this), but could you zip up the application that is causing the issue and email it to me? I'll see if I can't figure out what's causing the error. Thanks. On Feb 22, 11:23 am, Sam Sherlock [EMAIL PROTECTED] wrote: I have a few apps installed that I am working on locally I have cakephp set up to bake and all was fine. Yesterday I updated from svn. and Then all my apps rendered blank screen or displayed an error message. I managed to solve the issue. I put the following in cakes pages controller function dispatchMethod() { } Wanting to do the right thing I signed up to trac; I also tried a few more things to gather information to be logged on trac. This is where I got really confused - since I expected removing the addition I put in to return the error message (so I could copy the exact message). However the error remained fixed - no error message to copy. I emptied the cache of files too - everything still working. A touch confused by it, has anyone else experienced this? - its all very odd! - S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Bug while using PHPmailer
My code was working fine with sessions but when i added the email(phpmailer), I am getting the below error when i use email(phpmailer) component and checking the session If i comment var $components = array('Email');, everything works fine. Pls help me in this regard CODE ?php class ProductsController extends AppController { var $helpers = array(html,Javascript); var $components = array('Email'); function beforeFilter() { $this-checkSession(); } //rest of the code Error Warning: Cannot modify header information - headers already sent by (output started at C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116) in C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on line 447 -- View this message in context: http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug while using PHPmailer
in your email.php component file, check if there's nothing after closing tag (?) and FYI, there's an Email core component in Cake On 13 fév, 11:04, searchmax [EMAIL PROTECTED] wrote: My code was working fine with sessions but when i added the email(phpmailer), I am getting the below error when i use email(phpmailer) component and checking the session If i comment var $components = array('Email');, everything works fine. Pls help me in this regard CODE ?php class ProductsController extends AppController { var $helpers = array(html,Javascript); var $components = array('Email'); function beforeFilter() { $this-checkSession(); } //rest of the code Error Warning: Cannot modify header information - headers already sent by (output started at C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116) in C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on line 447 -- View this message in context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug while using PHPmailer
Thankyou very much for showing interest in my query. I have checked the file email.php and after ? closing tag nothing is there. I have searched in cake for email component and what i got is the phpmailer thing and i have proceeded with that. Can you please send me some links to any examples which gives more info about core email component in cake? I really got stuck with this. Pls help me. Thankyou. djiize wrote: in your email.php component file, check if there's nothing after closing tag (?) and FYI, there's an Email core component in Cake On 13 f�v, 11:04, searchmax [EMAIL PROTECTED] wrote: My code was working fine with sessions but when i added the email(phpmailer), I am getting the below error when i use email(phpmailer) component and checking the session If i comment var $components = array('Email');, everything works fine. Pls help me in this regard CODE ?php class ProductsController extends AppController { var $helpers = array(html,Javascript); var $components = array('Email'); function beforeFilter() { $this-checkSession(); } //rest of the code Error Warning: Cannot modify header information - headers already sent by (output started at C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116) in C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on line 447 -- View this message in context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html Sent from the CakePHP mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15458813.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
is this a bug, or my error?
I am running a Task from the CLI, and at a $this-Model-field query I get Fatal error: Class 'String' not found in /home/nagyv/workspace/cakephp1.2/cake/libs/model/datasources/dbo_source.php on line 1455 I've tried it with the beta and the svn trunk as well. I run PHP 5.2.3-1ubuntu6.3 (cli). The command I use is: $ cake process DpkgQuery firefox My code is: ?php Class DpkgQueryTask extends Shell { var $uses = array('Package'); function execute($package=null) { if(!empty($package)) { $this-args[0] = $package; } while(empty($this-args[0])) { $this-args[0] = $this-in('Plese give a package name'); } $id = $id = $this-Package-field('id', array('Package.name'=$this-args[0])); if(!$id) { $command = dpkg-query -W -f='\${Package}\\t\${Section}\\n' . $this-args[0]; $section = exec($command); $this-out($command); $this-Package-create(array('Package'=array('name'=$this-args[0], 'section'=$section))); $id = $this-Package-lastInsertId(); $this-out('New package recognised: ' . $this-args[0] . ' (' . $id . ') belongs to ' . $section); } $this-out($id); // return $id; } } ? Should I report it as a bug or should I rewrite something in my code? Thanks, V --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug while using PHPmailer
Hi djiize, Thanks a ton i have resolved that bug. Actually there is a space after the (?) closing tag and after removing that my code is working fine.. Thankyou very much for your help:-) djiize wrote: in your email.php component file, check if there's nothing after closing tag (?) and FYI, there's an Email core component in Cake On 13 f�v, 11:04, searchmax [EMAIL PROTECTED] wrote: My code was working fine with sessions but when i added the email(phpmailer), I am getting the below error when i use email(phpmailer) component and checking the session If i comment var $components = array('Email');, everything works fine. Pls help me in this regard CODE ?php class ProductsController extends AppController { var $helpers = array(html,Javascript); var $components = array('Email'); function beforeFilter() { $this-checkSession(); } //rest of the code Error Warning: Cannot modify header information - headers already sent by (output started at C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116) in C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on line 447 -- View this message in context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html Sent from the CakePHP mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15459378.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug while using PHPmailer
if you want to use the core component, delete or move/rename your own email.php component. It overrides the core's one On 13 fév, 16:02, djiize [EMAIL PROTECTED] wrote: good start to Email core component:http://book.cakephp.org/view/176/email On 13 fév, 15:41, searchmax [EMAIL PROTECTED] wrote: Hi djiize, Thanks a ton i have resolved that bug. Actually there is a space after the (?) closing tag and after removing that my code is working fine.. Thankyou very much for your help:-) djiize wrote: in your email.php component file, check if there's nothing after closing tag (?) and FYI, there's an Email core component in Cake On 13 fév, 11:04, searchmax [EMAIL PROTECTED] wrote: My code was working fine with sessions but when i added the email(phpmailer), I am getting the below error when i use email(phpmailer) component and checking the session If i comment var $components = array('Email');, everything works fine. Pls help me in this regard CODE ?php class ProductsController extends AppController { var $helpers = array(html,Javascript); var $components = array('Email'); function beforeFilter() { $this-checkSession(); } //rest of the code Error Warning: Cannot modify header information - headers already sent by (output started at C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116) in C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on line 447 -- View this message in context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html Sent from the CakePHP mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15459378.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug while using PHPmailer
good start to Email core component: http://book.cakephp.org/view/176/email On 13 fév, 15:41, searchmax [EMAIL PROTECTED] wrote: Hi djiize, Thanks a ton i have resolved that bug. Actually there is a space after the (?) closing tag and after removing that my code is working fine.. Thankyou very much for your help:-) djiize wrote: in your email.php component file, check if there's nothing after closing tag (?) and FYI, there's an Email core component in Cake On 13 fév, 11:04, searchmax [EMAIL PROTECTED] wrote: My code was working fine with sessions but when i added the email(phpmailer), I am getting the below error when i use email(phpmailer) component and checking the session If i comment var $components = array('Email');, everything works fine. Pls help me in this regard CODE ?php class ProductsController extends AppController { var $helpers = array(html,Javascript); var $components = array('Email'); function beforeFilter() { $this-checkSession(); } //rest of the code Error Warning: Cannot modify header information - headers already sent by (output started at C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116) in C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on line 447 -- View this message in context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html Sent from the CakePHP mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15459378.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in $model-saveAll in 1.2
Hi FL1 Where do i find the 6337 release? And I can't see any //return true; in the model.php saveAll function on line 1349. BTW: Rgarg thanks for the tip! Gerhard On Feb 6, 3:49 pm, FL1 [EMAIL PROTECTED] wrote: It's not returning true on success because the return true; was left out in the beta release. You can either grab any release after 6337 (beta was 6311) or go into cake's model.php and add the return at the end of the saveAll function and it should work like a dream. On Feb 5, 5:07 pm, gerhardsletten [EMAIL PROTECTED] wrote: I am trying to save related models with saveAll, but it will not return true even if it succeed to save: if($this-Contentclass-ContentclassAttribute-saveAll($this-data['Content classAttribute'])) { $this-Session-setFlash(__('The Contentclass and all attributes has been saved', true)); $this-redirect(array('action'='edit', $id));} else { $this-Session-setFlash(__('The Contentclass was saved but the attributes faild to saved', true)); } In the api it says True on success, or an array of validation errors on failure public. Is this a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in $model-saveAll in 1.2
Use the newest SVN copy: svn co https://svn.cakephp.org/repo/trunk/cake/1.2.x.x /path/to/save On Feb 7, 5:00 pm, gerhardsletten [EMAIL PROTECTED] wrote: Hi FL1 Where do i find the 6337 release? And I can't see any //return true; in the model.php saveAll function on line 1349. BTW: Rgarg thanks for the tip! Gerhard On Feb 6, 3:49 pm, FL1 [EMAIL PROTECTED] wrote: It's not returning true on success because the return true; was left out in the beta release. You can either grab any release after 6337 (beta was 6311) or go into cake's model.php and add the return at the end of the saveAll function and it should work like a dream. On Feb 5, 5:07 pm, gerhardsletten [EMAIL PROTECTED] wrote: I am trying to save related models with saveAll, but it will not return true even if it succeed to save: if($this-Contentclass-ContentclassAttribute-saveAll($this-data['Content classAttribute'])) { $this-Session-setFlash(__('The Contentclass and all attributes has been saved', true)); $this-redirect(array('action'='edit', $id));} else { $this-Session-setFlash(__('The Contentclass was saved but the attributes faild to saved', true)); } In the api it says True on success, or an array of validation errors on failure public. Is this a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in $model-saveAll in 1.2
try this one if($this-Contentclass-saveAll($this-data)) { $this-Session-setFlash(__('The Contentclass and all attributes has been saved', true)); $this-redirect(array('action'='edit', $id)); } else { $this-Session-setFlash(__('The Contentclass was saved but the attributes faild to saved', true)); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Problem with findAllThreaded... bug or not?
Hi, I'm Using CakePHP 1.19. I have a menu table with the following fields: - id - parent_id - name - link For sorting purposes, I would like the menu to show ordered by Name ASC. When I use: $this-Menu-findAllThreaded('','','name ASC'); The resulting array only contains siblings with a name that is higher in the alfabet then the name of the parent. For instance id: 1 parent_id: null name: beta id:2 parent_id: 1 name: alfa id:3 parent_id:1 name:kappa Will result in parent 1 having only ONE sibling, id:3 kappa. A solitution to this behaviour is adding the parent_id to the Order By clause as the primary sort condition: $this-Menu-findAllThreaded('','',array('parent_id','name'); I'm wondering if this is expectable behaviour... any thoughts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in $model-saveAll in 1.2
It's not returning true on success because the return true; was left out in the beta release. You can either grab any release after 6337 (beta was 6311) or go into cake's model.php and add the return at the end of the saveAll function and it should work like a dream. On Feb 5, 5:07 pm, gerhardsletten [EMAIL PROTECTED] wrote: I am trying to save related models with saveAll, but it will not return true even if it succeed to save: if($this-Contentclass-ContentclassAttribute-saveAll($this-data['ContentclassAttribute'])) { $this-Session-setFlash(__('The Contentclass and all attributes has been saved', true)); $this-redirect(array('action'='edit', $id));} else { $this-Session-setFlash(__('The Contentclass was saved but the attributes faild to saved', true)); } In the api it says True on success, or an array of validation errors on failure public. Is this a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Problem with findAllThreaded... bug or not?
This should work: $categories = $this-Category-findAllThreaded($conditions, array('Category.id','Category.parent_id','Category.name'),'Category.sort ASC'); if not, use older cake release. On 6 velj, 10:43, Bo-oz [EMAIL PROTECTED] wrote: Hi, I'm Using CakePHP 1.19. I have a menu table with the following fields: - id - parent_id - name - link For sorting purposes, I would like the menu to show ordered by Name ASC. When I use: $this-Menu-findAllThreaded('','','name ASC'); The resulting array only contains siblings with a name that is higher in the alfabet then the name of the parent. For instance id: 1 parent_id: null name: beta id:2 parent_id: 1 name: alfa id:3 parent_id:1 name:kappa Will result in parent 1 having only ONE sibling, id:3 kappa. A solitution to this behaviour is adding the parent_id to the Order By clause as the primary sort condition: $this-Menu-findAllThreaded('','',array('parent_id','name'); I'm wondering if this is expectable behaviour... any thoughts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Bug in $model-saveAll in 1.2
I am trying to save related models with saveAll, but it will not return true even if it succeed to save: if($this-Contentclass-ContentclassAttribute-saveAll($this- data['ContentclassAttribute'])) { $this-Session-setFlash(__('The Contentclass and all attributes has been saved', true)); $this-redirect(array('action'='edit', $id)); } else { $this-Session-setFlash(__('The Contentclass was saved but the attributes faild to saved', true)); } In the api it says True on success, or an array of validation errors on failure public. Is this a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
That wasn't directed at you, Nate. It is the items() method that it giving me the problem. It returns NOTHING except 'item'. I originally coded the rss module per the examples (funny how everybody's _new_ example uses the callback name 'transformRSS'). This is how my code now looks without using items (it works). ?php foreach ($blocs as $bloc): echo \nitem; echo \ntitle.$bloc['Bloc']['title']./title; echo \nlinkhttp://www.example.com/blocs/view/.$bloc['Bloc'] ['id']./link; echo \nguidhttp://www.example.com/blocs/view/.$bloc['Bloc'] ['id']./guid; echo \ndescription.htmlentities ($bloc['Bloc']['text'])./ description; // echo \npubDate.$bloc['Bloc']['modified']./pubDate; echo \n/item; endforeach; ? This second block, adapted from the example on your blogpage, doesn't work for me. Perhaps it is a version hiccup - I'm using 1.2.0.6311 or maybe it's one of those invisible typos: echo $rss-items($blocs , 'transformRSS'); function transformRSS($data) { return array( 'title' = $data['Bloc']['title'], 'link' = array('action' = 'view', $data['Bloc']['id']), 'guid' = array('action' = 'view', $data['Bloc']['id']), 'description' = $data['Bloc']['text'], 'pubDate' = $data['Bloc']['modified'] ); } Whatever, I just wanted to query whether there was a known problem with rss in this particular release before I raised it as a bug report. I would have struggled to get this far without your blogpage and also that of Jiri Kupiainen. Thank you for that! On Feb 1, 6:03 pm, nate [EMAIL PROTECTED] wrote: And I was answering a question with a question, as is my custom. The Socratic method: dig it. Now, as I said, the lack of an items / tag is hardly a fatal flaw. What's wrong with just doing this: items?=echo $rss-items($posts, 'transformRSS'); ?/items On Feb 1, 3:49 am, leo [EMAIL PROTECTED] wrote: BTW, please note the question mark in the subject line. I was asking not denouncing. eo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: weird behavior in CakePHP 1.2 (possible bug)
I'm experiencing the same Out of memory errors. What causes the error for me is if i try to echo an undefined variable. To reproduce the error just do a ? echo $abcd; ? in a view. Pretty annoying when debugging. My dev setup is MAMP on OSX. On 28 Jan, 11:44, Lloyd [EMAIL PROTECTED] wrote: Hey guys, I have been stumped at this for days with something similar - I had to upload my entire cakephp app to a remote server because my local one was just crashing and I couldn't work out any errors whatsoever well I'll explain my situation and see how it goes with responses.. I am in my Customers Controller and am using a findAll() query to search for any possible 'Clubs'. THis works fine and sets in my 'edit' view.. however, when I go to submit the information through a form, it crashes.. if I get rid of displaying this array in the view, everything works fine - its only as soon as i try and utilise this 'Club' call array in the view that it crashes.. this was myerror message... Fatalerror: Out ofmemory(allocated 37486592) (tried to allocate 40961 bytes) in path/to/my/site/cake/libs/debugger.php on line 421 I commented out the same thing and got this result... Notice (8): Undefined variable: myClubNames [APP\views\customers \edit.ctp, line 101] So.. there's myerror... a definate bug I think and not just me missing something.. what do you guys reckon? I'll post if i can get my app working without too many troubles.. cheers!! Lloyd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: weird behavior in CakePHP 1.2 (possible bug)
Created a new ticket: https://trac.cakephp.org/ticket/4066 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: weird behavior in CakePHP 1.2 (possible bug)
As it turns out, this error happens for all php syntax errors in views. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: bug in xml
Cake actually comes with a default XML template which includes a short- tags-compatible header, so you generally should not have to deal with this. On Feb 3, 1:20 pm, Howard Glynn [EMAIL PROTECTED] wrote: This could be one of my favourite bugs that took me ages and ages to figure out a while ago. It's not a cake problem though. You probably need to switch off allow short php tags in your php.ini Problem is, the first line of your xml/action.ctp file is probably something like ?xml version=1.0 . and guess what... the php interpreter looks at that and errors . You must *only* use ?php tags and strictly disallow ? if playing with xml. HG manuj wrote: i have put some xml code in views/controller/xml/action.ctp, when I run this code http//servername/controller/action.ctp, it gives error due to blank charcters before starting of code --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
The _only_ output I get from items() is 'item'...there is nothing to wrap. as I said, item() returns the tags and content as expected, but even if I assign string constants directly to the rss elements in transformRSS I get nothing out (except the opening item tag). The time I've spent here I could probably have fixed it, but I have other things to do and my workaround was, for me anyway, more MVC. In rss/index.ctp: [code] ?php foreach ($blocs as $bloc): echo \nitem; echo \ntitle.$bloc['Bloc']['title']./title; echo \nlinkhttp://www.example.net/public_html/blocs/view/;. $bloc['Bloc']['id']./link; echo \nguidhttp:///www.example.net/public_html/blocs/view/;. $bloc['Bloc']['id']./guid; echo \ndescription.htmlentities ($bloc['Bloc']['text'])./ description; echo \npubDate.$bloc['Bloc']['modified']./pubDate; echo \n/item; endforeach; ? [/code] On Feb 1, 1:27 am, nate [EMAIL PROTECTED] wrote: How is this a bug? Why can't you just wrap the output in an items / tag? On Jan 31, 12:21 pm, leo [EMAIL PROTECTED] wrote: How about you back up that statement by making a bug report over at trac.cakephp.org. I did that before the last guy bit my head off. (#4038: RssHelper::items() dysfunctional) I'd like to think it's not a bug but nobody seemed to notice my earlier posts, so I don't have any input other than the apparent disbelief that there may be something wrong. I found your article very useful and wouldn't have been able to proceed down this path without it - thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
Thanks Ron, It's the [code]echo $rss-items($posts, 'transformRSS');[/code] that I can't get to work. The bit about adding the Atom feed is very useful - I'd been puzzling over that and Google doesn't seem to read the feed properly without it. What are rc, wf dc? Leo On Feb 1, 7:52 am, T73 Net [EMAIL PROTECTED] wrote: Check it out.http://mentalramblings.info/posts/view/cakephp-rss-helper-implementation Just whipped this up today. HTH Ron Chaplin http://t73-softdesign.comhttp://mentalramblings.info On Feb 1, 6:27 pm, nate [EMAIL PROTECTED] wrote: How is this a bug? Why can't you just wrap the output in an items / tag? On Jan 31, 12:21 pm, leo [EMAIL PROTECTED] wrote: How about you back up that statement by making a bug report over at trac.cakephp.org. I did that before the last guy bit my head off. (#4038: RssHelper::items() dysfunctional) I'd like to think it's not a bug but nobody seemed to notice my earlier posts, so I don't have any input other than the apparent disbelief that there may be something wrong. I found your article very useful and wouldn't have been able to proceed down this path without it - thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
BTW, please note the question mark in the subject line. I was asking not denouncing. Leo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
Leo, Since RssHelper extends XmlHelper It is a function found in the XmlHelper Class. They are Namespace shortcuts for the various namespaces. http://api.cakephp.org/1.2/class_xml_helper.html#c18ad6589ac4455587028523716f5341 On Feb 2, 2:47 am, leo [EMAIL PROTECTED] wrote: Thanks Ron, It's the [code]echo $rss-items($posts, 'transformRSS');[/code] that I can't get to work. The bit about adding the Atom feed is very useful - I'd been puzzling over that and Google doesn't seem to read the feed properly without it. What are rc, wf dc? Leo On Feb 1, 7:52 am, T73 Net [EMAIL PROTECTED] wrote: Check it out.http://mentalramblings.info/posts/view/cakephp-rss-helper-implementation Just whipped this up today. HTH Ron Chaplin http://t73-softdesign.comhttp://mentalramblings.info On Feb 1, 6:27 pm, nate [EMAIL PROTECTED] wrote: How is this a bug? Why can't you just wrap the output in an items / tag? On Jan 31, 12:21 pm, leo [EMAIL PROTECTED] wrote: How about you back up that statement by making a bug report over at trac.cakephp.org. I did that before the last guy bit my head off. (#4038: RssHelper::items() dysfunctional) I'd like to think it's not a bug but nobody seemed to notice my earlier posts, so I don't have any input other than the apparent disbelief that there may be something wrong. I found your article very useful and wouldn't have been able to proceed down this path without it - thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
bug in xml
i have put some xml code in views/controller/xml/action.ctp, when I run this code http//servername/controller/action.ctp, it gives error due to blank charcters before starting of code --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
And I was answering a question with a question, as is my custom. The Socratic method: dig it. Now, as I said, the lack of an items / tag is hardly a fatal flaw. What's wrong with just doing this: items?=echo $rss-items($posts, 'transformRSS'); ?/items On Feb 1, 3:49 am, leo [EMAIL PROTECTED] wrote: BTW, please note the question mark in the subject line. I was asking not denouncing. Leo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
Maybe a look into this might help: http://mentalramblings.info/posts/view/cakephp-rss-helper-implementation Now, as I said, the lack of an items / tag is hardly a fatal flaw. What's wrong with just doing this: items?=echo $rss-items($posts, 'transformRSS'); ?/items On Feb 1, 3:49 am, leo [EMAIL PROTECTED] wrote: BTW, please note the question mark in the subject line. I was asking not denouncing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Rss bug in 1.2.6311?
After testing, I've come to the conclusion that RssHelper::items() is broken. RssHelper::item() works ticketyboo. I've now written my own function to render the XML. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
How did you test? Why do you think it is broken? How did you try to use this? How did you come to this conclusion? Without providing any detail you are declaring it broken? Is not it nonsense? On Jan 31, 2008 3:30 PM, leo [EMAIL PROTECTED] wrote: After testing, I've come to the conclusion that RssHelper::items() is broken. RssHelper::item() works ticketyboo. I've now written my own function to render the XML. -- Thanks Anupom Trippert Inc. [http://www.trippert.com] GopherNow. [http://www.gophernow.com/] Homepage. [http://www.anupom.wordpress.com/] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
On Jan 31, 10:36 am, Anupom [EMAIL PROTECTED] wrote: How did you test? Why do you think it is broken? How did you try to use this? How did you come to this conclusion? Without providing any detail you are declaring it broken? Is not it nonsense? If you care to look at the rest of this thread, and it would appear that not many people have, you will see example usage and resulting output. I think it's broken because it doesn't produce the correct output, even when invoked in isolation with hard-coded input. Leo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
On Jan 31, 2008 5:24 AM, leo [EMAIL PROTECTED] wrote: If you care to look at the rest of this thread, and it would appear that not many people have, you will see example usage and resulting output. I think it's broken because it doesn't produce the correct output, even when invoked in isolation with hard-coded input. How about you back up that statement by making a bug report over at trac.cakephp.org. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
How about you back up that statement by making a bug report over at trac.cakephp.org. I did that before the last guy bit my head off. (#4038: RssHelper::items() dysfunctional) I'd like to think it's not a bug but nobody seemed to notice my earlier posts, so I don't have any input other than the apparent disbelief that there may be something wrong. I found your article very useful and wouldn't have been able to proceed down this path without it - thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Rss bug in 1.2.6311?
Check it out. http://mentalramblings.info/posts/view/cakephp-rss-helper-implementation Just whipped this up today. HTH Ron Chaplin http://t73-softdesign.com http://mentalramblings.info On Feb 1, 6:27 pm, nate [EMAIL PROTECTED] wrote: How is this a bug? Why can't you just wrap the output in an items / tag? On Jan 31, 12:21 pm, leo [EMAIL PROTECTED] wrote: How about you back up that statement by making a bug report over at trac.cakephp.org. I did that before the last guy bit my head off. (#4038: RssHelper::items() dysfunctional) I'd like to think it's not a bug but nobody seemed to notice my earlier posts, so I don't have any input other than the apparent disbelief that there may be something wrong. I found your article very useful and wouldn't have been able to proceed down this path without it - thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in cake beta 1.2 model
The problem is in /cake/libs/model/model.php line 364 and on. In the code it says: Line 1193 in Revision: 6398, Date: 2008-01-20 20:21:28 -0600 (Sun, 20 Jan 2008) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in cake beta 1.2 model
I found (and fixed) a bug in the model.php file, and I can't report it in the trac system, so I thought I'd report it here in case someone sees it and can fix it. Whaaao!! Thanks a lot! I am a newbie to cake and since 2 days I was running around this strange behaviour when saving a HABTM relation. I thought it was necessary to write more code to handle this case, and I began to doubt of my cake understanding! So, thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: weird behavior in CakePHP 1.2 (possible bug)
Hey guys, I have been stumped at this for days with something similar - I had to upload my entire cakephp app to a remote server because my local one was just crashing and I couldn't work out any errors whatsoever well I'll explain my situation and see how it goes with responses.. I am in my Customers Controller and am using a findAll() query to search for any possible 'Clubs'. THis works fine and sets in my 'edit' view.. however, when I go to submit the information through a form, it crashes.. if I get rid of displaying this array in the view, everything works fine - its only as soon as i try and utilise this 'Club' call array in the view that it crashes.. this was my error message... Fatal error: Out of memory (allocated 37486592) (tried to allocate 40961 bytes) in path/to/my/site/cake/libs/debugger.php on line 421 I commented out the same thing and got this result... Notice (8): Undefined variable: myClubNames [APP\views\customers \edit.ctp, line 101] So.. there's my error... a definate bug I think and not just me missing something.. what do you guys reckon? I'll post if i can get my app working without too many troubles.. cheers!! Lloyd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: ClassRegistry bug?
btw I'm using: Cake 1.2.0.6311 beta PHP 5.2.4-2+b1 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan 6 2008 23:43:13) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies mysql Ver 14.12 Distrib 5.0.51, for debian-linux-gnu (i486) using readline 5.2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: ClassRegistry bug?
You must have unique aliases in for your associated models. If you search the tickets you will find that this has been reported and closed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: ClassRegistry bug?
Thanks for giving attention to this Gwoo. I was trying to find where is documented the use of unique aliases across different models on the tickets and couldn't find it. After some searching I found this bug: https://trac.cakephp.org/ticket/3584 The behavior reported here is exactly the same I'm encountering. According to the bug resolution the code should work, however I can't make the example code to work. I think the following section of ClassRegistry is causing the loop: 00246 if ($_this-isKeySet($alias)) { 00247 $model = $_this-getObject($alias); 00248 if (is_a($model, $class)) { 00249 $duplicate = true; 00250 } 00251 unset($model); 00252 } which in my case always returns false. Thanks in advance for any help anyone can give on this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
ClassRegistry bug?
I just found a problem with the way ClassRegistry handles aliases for associations. I wonder why nobody else has reported it, so it may be my fault. I have two models: class FirstObject extends AppModel { public $belongsTo = array( 'Parent' = array( 'className' = 'FirstObject', 'foreignKey' = 'parent_id', ) ); public $hasMany = array( 'Children' = array( 'className' = 'FirstObject', 'foreignKey' = 'parent_id' ), 'SecondObject' ); } class SecondObject extends AppModel { public $belongsTo = array( 'Parent' = array( 'className' = 'SecondObject', 'foreignKey' = 'parent_id', ), 'FirstObject' ); public $hasMany = array( 'Children' = array( 'className' = 'SecondObject', 'foreignKey' = 'parent_id' ) ); } A simple FirstObject-findAll() results in a blank page caused by an endless loop inside ClassRegistry. It seems this is because ClassRegistry uses the alias of the association as a key. Is something wrong with my setup or is indeed a bug with ClassRegistry if you use the same aliases for different classes? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: weird behavior in CakePHP 1.2 (possible bug)
Hi, you are not the only one experiencing this problem. ME TOO!!! Here's my error message: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 36571 bytes) in D:\webserver\awa\cake\libs\debugger.php on line 412 When I comment out the same thing, I get a valid error: Notice (8): Undefined variable: deptAdminStatus [APP\views\timecharges \ajax_tog_dept_admin.ctp, line 1] I think this might be a bug! On Jan 22, 2:18 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm seeing some weird behavior in CakePHP 1.2 that may be a possible bug, and wonder if anyone else can confirm it, or if it's just my server. I'm using the beta download from cakephp.org. Whenever I make a call to a variable in my view that is undefined I get this error: Fatal error:Allowedmemorysizeof 134217728 bytes exhausted (tried to allocate 58337 bytes) in C:\InstantRails\www\emerge\cake\libs \debugger.php on line 398 and the parser stops. Line 398 ofdebuggeris in the middle of function __object($var), if I comment out the call to this on lin 364: //causes some sort of overflow //case 'object': // return get_class($var) . \n . $_this-__object($var); The overflow disappears and I get the correct error in my view: Notice (8): Undefined variable: newdasfsd [APP\views\users \index.thtml, line 10] Can anyone else reproduce this? Thanks, Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: weird behavior in CakePHP 1.2 (possible bug)
Just an update to my situation. I'm pretty sure this error is due to my fault. I was debugging to pin point the source of error in my codes and I figured this: $departmentAdminData = array( DepartmentAdmin = array( account_id = $account_id, department_id = $department_id, ), ); $this-Account-DepartmentAdmin-del($departmentAdminData); The delete was causing some kind of overflow somewhere. Oh well, at least I know where my error is. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
weird behavior in CakePHP 1.2 (possible bug)
I'm seeing some weird behavior in CakePHP 1.2 that may be a possible bug, and wonder if anyone else can confirm it, or if it's just my server. I'm using the beta download from cakephp.org. Whenever I make a call to a variable in my view that is undefined I get this error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 58337 bytes) in C:\InstantRails\www\emerge\cake\libs \debugger.php on line 398 and the parser stops. Line 398 of debugger is in the middle of function __object($var), if I comment out the call to this on lin 364: //causes some sort of overflow //case 'object': // return get_class($var) . \n . $_this-__object($var); The overflow disappears and I get the correct error in my view: Notice (8): Undefined variable: newdasfsd [APP\views\users \index.thtml, line 10] Can anyone else reproduce this? Thanks, Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in cake beta 1.2 model
@Chris I tried reporting to trac, but I got a 403 forbidden error when I tried to create a new ticket (at https://trac.cakephp.org/newticket). I realize now that I need to be registered (I just scanned the page and looked for the report a bug button and clicked), and I will report bugs through the proper channels in the future, because I totally get where you are coming from. :-) Nina On Jan 17, 10:01 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On Jan 16, 2008 10:56 AM, Nina [EMAIL PROTECTED] wrote: Hi All I found (and fixed) a bug in the model.php file, and I can't report it in the trac system, so I thought I'd report it here in case someone sees it and can fix it. Nina, Is that can't or won't report the bug? It takes no more than 5 minutes to sign up for an account on trac in order to report a bug. I tell you this because I can say with great certainty that patches posted on the mailing list are extremely unlikely to be noticed. It's great that you might have found a bug, but PLEASE take the time to report it properly through trac. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: maybe a bug in findAllThreaded() in version cake-1.2.0.6311-beta
On Jan 18, 10:39 am, Chaso [EMAIL PROTECTED] wrote: Hi! the following code works in cake-1.2.0.5875 $this-Modelname-findAllThreaded(null,null, '`order` ASC'); but in cake-1.2.0.6311-beta the children are missing in the threaded array (children is empty). I did a little further investigation on this: I compared cake/libs/ model.php in both mentioned versions and I found out that the problem is the model variable 'alias': If i set var $alias = 'Modelname'; in the model class then everything works fine. If I don't state this explicitly Modelname-alias is an empty array (which can't be an array key, as like it is used in __doThread in version cake-1.2.0.6311-beta). I hope this is useful for debugging... Best Regards, Florian https://trac.cakephp.org/wiki/bugreport see bug #3810 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: maybe a bug in findAllThreaded() in version cake-1.2.0.6311-beta
thanks! changeing the line works! On 18 Jan., 10:50, AD7six [EMAIL PROTECTED] wrote: On Jan 18, 10:39 am, Chaso [EMAIL PROTECTED] wrote: Hi! the following code works in cake-1.2.0.5875 $this-Modelname-findAllThreaded(null,null, '`order` ASC'); but in cake-1.2.0.6311-beta the children are missing in the threaded array (children is empty). I did a little further investigation on this: I compared cake/libs/ model.php in both mentioned versions and I found out that the problem is the model variable 'alias': If i set var $alias = 'Modelname'; in the model class then everything works fine. If I don't state this explicitly Modelname-alias is an empty array (which can't be an array key, as like it is used in __doThread in version cake-1.2.0.6311-beta). I hope this is useful for debugging... Best Regards, Florian https://trac.cakephp.org/wiki/bugreport see bug #3810 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
maybe a bug in findAllThreaded() in version cake-1.2.0.6311-beta
Hi! the following code works in cake-1.2.0.5875 $this-Modelname-findAllThreaded(null,null, '`order` ASC'); but in cake-1.2.0.6311-beta the children are missing in the threaded array (children is empty). I did a little further investigation on this: I compared cake/libs/ model.php in both mentioned versions and I found out that the problem is the model variable 'alias': If i set var $alias = 'Modelname'; in the model class then everything works fine. If I don't state this explicitly Modelname-alias is an empty array (which can't be an array key, as like it is used in __doThread in version cake-1.2.0.6311-beta). I hope this is useful for debugging... Best Regards, Florian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in cake beta 1.2 model
On Jan 16, 2008 10:56 AM, Nina [EMAIL PROTECTED] wrote: Hi All I found (and fixed) a bug in the model.php file, and I can't report it in the trac system, so I thought I'd report it here in case someone sees it and can fix it. Nina, Is that can't or won't report the bug? It takes no more than 5 minutes to sign up for an account on trac in order to report a bug. I tell you this because I can say with great certainty that patches posted on the mailing list are extremely unlikely to be noticed. It's great that you might have found a bug, but PLEASE take the time to report it properly through trac. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in cake beta 1.2 model
Wow, I'm really glad you found this. I read this yesterday and thought well, I guess I'll leave it the way it is until I see problems Then today I was testing my code and found major problems with saving HABTM data. I thought it was because I was storing extra data in the join tables but then I remembered this post. Thanks for your work, I would have spent way to much time figuring this out (In fact I was just about to change me code to use $this-model-query() to save the data when I remembered this). Thanks, Dave On Jan 16, 8:56 am, Nina [EMAIL PROTECTED] wrote: Hi All I found (and fixed) a bug in the model.php file, and I can't report it in the trac system, so I thought I'd report it here in case someone sees it and can fix it. The problem is in /cake/libs/model/model.php line 364 and on. In the code it says: if (isset($v[$n])) { $v = $v[$n]; } $joined[$n] = $v; But it should say: if (isset($v[$n])) { $v = $v[$n]; $joined[$n] = $v; } This error is in the save function and it causes a save to save habtm associated fields wrong, putting empty values into the database. I found the bug by comparing to the pre_beta code. Sincerely Nina Jansen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Bug in cake beta 1.2 model
Hi All I found (and fixed) a bug in the model.php file, and I can't report it in the trac system, so I thought I'd report it here in case someone sees it and can fix it. The problem is in /cake/libs/model/model.php line 364 and on. In the code it says: if (isset($v[$n])) { $v = $v[$n]; } $joined[$n] = $v; But it should say: if (isset($v[$n])) { $v = $v[$n]; $joined[$n] = $v; } This error is in the save function and it causes a save to save habtm associated fields wrong, putting empty values into the database. I found the bug by comparing to the pre_beta code. Sincerely Nina Jansen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: 1.1.19 Model Associations Bug - endless loop ??
Oops, meant to reply to following thread, http://groups.google.com/group/cake-php/browse_thread/thread/4fe253582dc85aed/5a51ff85d99061aa#5a51ff85d99061aa but started this new one instead. Please continue under the original thread - I will propagate this post there. On Jan 15, 5:29 pm, keymaster [EMAIL PROTECTED] wrote: I'm having exactly the same problem. An app which has worked no problem since cake 1.1.11 up to and including 1.1.18, is all of a sudden stuck in infinite loop due to model associations in 1.1.9. For what it's worth, the venerable BakeSale stable version is also seg faulting in 1.1.19 due to model associations, but works fine in 1.1.18 and before. Anybody know any more about this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
1.1.19 Model Associations Bug - endless loop ??
I'm having exactly the same problem. An app which has worked no problem since cake 1.1.11 up to and including 1.1.18, is all of a sudden stuck in infinite loop due to model associations in 1.1.9. For what it's worth, the venerable BakeSale stable version is also seg faulting in 1.1.19 due to model associations, but works fine in 1.1.18 and before. Anybody know any more about this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake 1.2 Console - Fatal Errors - Possible Bug?
I'm a little confused about this, perhaps I'm missing something... but when I update via svn, this fix doesn't happen in my core library. For instance, I just looked at line 30 in schema.php (bug fix 6319) and the string class is not included after I updated. However, I manually added the 'string' class on my box in schema.php and it still didn't solve the problem in the console. - Cake Fan On Jan 3, 5:00 pm, Christian Winther [EMAIL PROTECTED] wrote: It looks related tohttps://trac.cakephp.org/ticket/3793and changesethttps://trac.cakephp.org/changeset/6312to me -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:57 To: Cake PHP Subject: Re: Cake 1.2 Console - Fatal Errors - Possible Bug? Christian, I am at Revision 6319, but the console still says 6311. I am only updating the cake folder, so I'm not changing the app or vendors folders at all. Am I missing something here because the problem still persists after I updated as you suggested. Thanks for the help! - Cake Fan On Jan 3, 3:32 pm, Christian Winther [EMAIL PROTECTED] wrote: Update to SVN head from 1.2 branch, was fixed there :) -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:20 To: Cake PHP Subject: Cake 1.2 Console - Fatal Errors - Possible Bug? I have my cake 1.2 shell script working properly in most regards; it will help me immensely in converting a large flat table into relational data for Cake consumption. However, in the shell, whenever I try to call any of the Model query commands, I get a failure. So far, it has happened with findCount(), find(), findall(), save(), and saveall(); The problem seems to be inconsistent and no matter what I try or eliminate, it seems to persist. My shell script ultra-simplified to this: -- function main() { $i = 0; while ($i 1000) { $formatted_data_array = array ( 'Business' = array ('name' = 'test') ); $this-Business-save($formatted_data_array, false); $i++; } } -- It will save one time successfully, and then errors out. I get the following error message from the console: ++ C:\Apache\htdocs\project\appcake raw_data Welcome to CakePHP v1.2.0.6311 beta Console --- App : app Path: C:\Apache\htdocs\project\app --- PHP Fatal error: Class 'String' not found in C:\Apache\htdocs\project \cake\libs\model\datasources\dbo_source .php on line 1455 Fatal error: Class 'String' not found in C:\Apache\htdocs\project\cake \libs\model\datasources\dbo_source.php on line 1455 C:\Apache\htdocs\project\app + Any help would be greatly appreciated! - Cake Fan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake 1.2 Console - Fatal Errors - Possible Bug?
I submitted a ticket on this problem: https://trac.cakephp.org/ticket/3828 - Cake Fan On Jan 4, 11:16 am, Cake Fan [EMAIL PROTECTED] wrote: I'm a little confused about this, perhaps I'm missing something... but when I update via svn, this fix doesn't happen in my core library. For instance, I just looked at line 30 in schema.php (bug fix 6319) and the string class is not included after I updated. However, I manually added the 'string' class on my box in schema.php and it still didn't solve the problem in the console. - Cake Fan On Jan 3, 5:00 pm, Christian Winther [EMAIL PROTECTED] wrote: It looks related tohttps://trac.cakephp.org/ticket/3793andchangesethttps://trac.cakephp.org/changeset/6312tome -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:57 To: Cake PHP Subject: Re: Cake 1.2 Console - Fatal Errors - Possible Bug? Christian, I am at Revision 6319, but the console still says 6311. I am only updating the cake folder, so I'm not changing the app or vendors folders at all. Am I missing something here because the problem still persists after I updated as you suggested. Thanks for the help! - Cake Fan On Jan 3, 3:32 pm, Christian Winther [EMAIL PROTECTED] wrote: Update to SVN head from 1.2 branch, was fixed there :) -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:20 To: Cake PHP Subject: Cake 1.2 Console - Fatal Errors - Possible Bug? I have my cake 1.2 shell script working properly in most regards; it will help me immensely in converting a large flat table into relational data for Cake consumption. However, in the shell, whenever I try to call any of the Model query commands, I get a failure. So far, it has happened with findCount(), find(), findall(), save(), and saveall(); The problem seems to be inconsistent and no matter what I try or eliminate, it seems to persist. My shell script ultra-simplified to this: -- function main() { $i = 0; while ($i 1000) { $formatted_data_array = array ( 'Business' = array ('name' = 'test') ); $this-Business-save($formatted_data_array, false); $i++; } } -- It will save one time successfully, and then errors out. I get the following error message from the console: ++ C:\Apache\htdocs\project\appcake raw_data Welcome to CakePHP v1.2.0.6311 beta Console --- App : app Path: C:\Apache\htdocs\project\app --- PHP Fatal error: Class 'String' not found in C:\Apache\htdocs\project \cake\libs\model\datasources\dbo_source .php on line 1455 Fatal error: Class 'String' not found in C:\Apache\htdocs\project\cake \libs\model\datasources\dbo_source.php on line 1455 C:\Apache\htdocs\project\app + Any help would be greatly appreciated! - Cake Fan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake 1.2 Console - Fatal Errors - Possible Bug?
A duplicate ticket...Read my comment in the ticket On Jan 4, 2008 10:15 AM, Cake Fan [EMAIL PROTECTED] wrote: I submitted a ticket on this problem: https://trac.cakephp.org/ticket/3828 - Cake Fan On Jan 4, 11:16 am, Cake Fan [EMAIL PROTECTED] wrote: I'm a little confused about this, perhaps I'm missing something... but when I update via svn, this fix doesn't happen in my core library. For instance, I just looked at line 30 in schema.php (bug fix 6319) and the string class is not included after I updated. However, I manually added the 'string' class on my box in schema.php and it still didn't solve the problem in the console. - Cake Fan On Jan 3, 5:00 pm, Christian Winther [EMAIL PROTECTED] wrote: It looks related tohttps://trac.cakephp.org/ticket/3793andchangesethttps://trac.cakephp.org/changeset/6312tome -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:57 To: Cake PHP Subject: Re: Cake 1.2 Console - Fatal Errors - Possible Bug? Christian, I am at Revision 6319, but the console still says 6311. I am only updating the cake folder, so I'm not changing the app or vendors folders at all. Am I missing something here because the problem still persists after I updated as you suggested. Thanks for the help! - Cake Fan On Jan 3, 3:32 pm, Christian Winther [EMAIL PROTECTED] wrote: Update to SVN head from 1.2 branch, was fixed there :) -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:20 To: Cake PHP Subject: Cake 1.2 Console - Fatal Errors - Possible Bug? I have my cake 1.2 shell script working properly in most regards; it will help me immensely in converting a large flat table into relational data for Cake consumption. However, in the shell, whenever I try to call any of the Model query commands, I get a failure. So far, it has happened with findCount(), find(), findall(), save(), and saveall(); The problem seems to be inconsistent and no matter what I try or eliminate, it seems to persist. My shell script ultra-simplified to this: -- function main() { $i = 0; while ($i 1000) { $formatted_data_array = array ( 'Business' = array ('name' = 'test') ); $this-Business-save($formatted_data_array, false); $i++; } } -- It will save one time successfully, and then errors out. I get the following error message from the console: ++ C:\Apache\htdocs\project\appcake raw_data Welcome to CakePHP v1.2.0.6311 beta Console --- App : app Path: C:\Apache\htdocs\project\app --- PHP Fatal error: Class 'String' not found in C:\Apache\htdocs\project \cake\libs\model\datasources\dbo_source .php on line 1455 Fatal error: Class 'String' not found in C:\Apache\htdocs\project\cake \libs\model\datasources\dbo_source.php on line 1455 C:\Apache\htdocs\project\app + Any help would be greatly appreciated! - Cake Fan -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Pagination and Layout Bug???
Ok, So this is completely weird ... anyone ever seen this before, maybe I'm doing something wrong... whenever I go to mydomain.com/employees/index/ the layout that I have selected in the index function of my controller loads, but when I click a pagination link like mydomain.com/employees/index/page:3 then the it looks like the layout is loading, but my stylesheets aren't rendering its really weird here is my controller code class EmployeesController extends AppController { var $name = employees; var $paginate = array( 'limit' = 25, 'order' = array('Employee.id' = 'DESC') ); function index() { $this-layout = 'default'; $this-pageTitle = SEOT CORE - Employee Module; $dataSet = $this-paginate('Employee'); $this-set(compact('dataSet')); } function update($employeeID) { //$this-layout = 'thickbox'; $constraints = array('id' = $employeeID); $employee = $this-Employee-findAllById($employeeID); $this-set(compact('employee')); } } ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Pagination and Layout Bug???
Not sure if it would have any effect, have you tried changing var $name = 'employees'; to var $name = 'Employees'; Other thing I would check is the the links to your css are not relative. Use Firebug to quickly see any 404's or other errors that might be occurring. Adam Travis wrote: Ok, So this is completely weird ... anyone ever seen this before, maybe I'm doing something wrong... whenever I go to mydomain.com/employees/index/ the layout that I have selected in the index function of my controller loads, but when I click a pagination link like mydomain.com/employees/index/page:3 then the it looks like the layout is loading, but my stylesheets aren't rendering its really weird here is my controller code class EmployeesController extends AppController { var $name = employees; var $paginate = array( 'limit' = 25, 'order' = array('Employee.id' = 'DESC') ); function index() { $this-layout = 'default'; $this-pageTitle = SEOT CORE - Employee Module; $dataSet = $this-paginate('Employee'); $this-set(compact('dataSet')); } function update($employeeID) { //$this-layout = 'thickbox'; $constraints = array('id' = $employeeID); $employee = $this-Employee-findAllById($employeeID); $this-set(compact('employee')); } } ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: bug for find('All'
error there instead of $res = $this-Tag-find('All', you should use lowercase $res = $this-Tag-find('all', --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Cake 1.2 Console - Fatal Errors - Possible Bug?
I have my cake 1.2 shell script working properly in most regards; it will help me immensely in converting a large flat table into relational data for Cake consumption. However, in the shell, whenever I try to call any of the Model query commands, I get a failure. So far, it has happened with findCount(), find(), findall(), save(), and saveall(); The problem seems to be inconsistent and no matter what I try or eliminate, it seems to persist. My shell script ultra-simplified to this: -- function main() { $i = 0; while ($i 1000) { $formatted_data_array = array ( 'Business' = array ('name' = 'test') ); $this-Business-save($formatted_data_array, false); $i++; } } -- It will save one time successfully, and then errors out. I get the following error message from the console: ++ C:\Apache\htdocs\project\appcake raw_data Welcome to CakePHP v1.2.0.6311 beta Console --- App : app Path: C:\Apache\htdocs\project\app --- PHP Fatal error: Class 'String' not found in C:\Apache\htdocs\project \cake\libs\model\datasources\dbo_source .php on line 1455 Fatal error: Class 'String' not found in C:\Apache\htdocs\project\cake \libs\model\datasources\dbo_source.php on line 1455 C:\Apache\htdocs\project\app + Any help would be greatly appreciated! - Cake Fan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake 1.2 Console - Fatal Errors - Possible Bug?
Update to SVN head from 1.2 branch, was fixed there :) -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:20 To: Cake PHP Subject: Cake 1.2 Console - Fatal Errors - Possible Bug? I have my cake 1.2 shell script working properly in most regards; it will help me immensely in converting a large flat table into relational data for Cake consumption. However, in the shell, whenever I try to call any of the Model query commands, I get a failure. So far, it has happened with findCount(), find(), findall(), save(), and saveall(); The problem seems to be inconsistent and no matter what I try or eliminate, it seems to persist. My shell script ultra-simplified to this: -- function main() { $i = 0; while ($i 1000) { $formatted_data_array = array ( 'Business' = array ('name' = 'test') ); $this-Business-save($formatted_data_array, false); $i++; } } -- It will save one time successfully, and then errors out. I get the following error message from the console: ++ C:\Apache\htdocs\project\appcake raw_data Welcome to CakePHP v1.2.0.6311 beta Console --- App : app Path: C:\Apache\htdocs\project\app --- PHP Fatal error: Class 'String' not found in C:\Apache\htdocs\project \cake\libs\model\datasources\dbo_source .php on line 1455 Fatal error: Class 'String' not found in C:\Apache\htdocs\project\cake \libs\model\datasources\dbo_source.php on line 1455 C:\Apache\htdocs\project\app + Any help would be greatly appreciated! - Cake Fan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake 1.2 Console - Fatal Errors - Possible Bug?
Christian, I am at Revision 6319, but the console still says 6311. I am only updating the cake folder, so I'm not changing the app or vendors folders at all. Am I missing something here because the problem still persists after I updated as you suggested. Thanks for the help! - Cake Fan On Jan 3, 3:32 pm, Christian Winther [EMAIL PROTECTED] wrote: Update to SVN head from 1.2 branch, was fixed there :) -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:20 To: Cake PHP Subject: Cake 1.2 Console - Fatal Errors - Possible Bug? I have my cake 1.2 shell script working properly in most regards; it will help me immensely in converting a large flat table into relational data for Cake consumption. However, in the shell, whenever I try to call any of the Model query commands, I get a failure. So far, it has happened with findCount(), find(), findall(), save(), and saveall(); The problem seems to be inconsistent and no matter what I try or eliminate, it seems to persist. My shell script ultra-simplified to this: -- function main() { $i = 0; while ($i 1000) { $formatted_data_array = array ( 'Business' = array ('name' = 'test') ); $this-Business-save($formatted_data_array, false); $i++; } } -- It will save one time successfully, and then errors out. I get the following error message from the console: ++ C:\Apache\htdocs\project\appcake raw_data Welcome to CakePHP v1.2.0.6311 beta Console --- App : app Path: C:\Apache\htdocs\project\app --- PHP Fatal error: Class 'String' not found in C:\Apache\htdocs\project \cake\libs\model\datasources\dbo_source .php on line 1455 Fatal error: Class 'String' not found in C:\Apache\htdocs\project\cake \libs\model\datasources\dbo_source.php on line 1455 C:\Apache\htdocs\project\app + Any help would be greatly appreciated! - Cake Fan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake 1.2 Console - Fatal Errors - Possible Bug?
It looks related to https://trac.cakephp.org/ticket/3793 and changeset https://trac.cakephp.org/changeset/6312 to me -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:57 To: Cake PHP Subject: Re: Cake 1.2 Console - Fatal Errors - Possible Bug? Christian, I am at Revision 6319, but the console still says 6311. I am only updating the cake folder, so I'm not changing the app or vendors folders at all. Am I missing something here because the problem still persists after I updated as you suggested. Thanks for the help! - Cake Fan On Jan 3, 3:32 pm, Christian Winther [EMAIL PROTECTED] wrote: Update to SVN head from 1.2 branch, was fixed there :) -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cake Fan Sent: 3. januar 2008 22:20 To: Cake PHP Subject: Cake 1.2 Console - Fatal Errors - Possible Bug? I have my cake 1.2 shell script working properly in most regards; it will help me immensely in converting a large flat table into relational data for Cake consumption. However, in the shell, whenever I try to call any of the Model query commands, I get a failure. So far, it has happened with findCount(), find(), findall(), save(), and saveall(); The problem seems to be inconsistent and no matter what I try or eliminate, it seems to persist. My shell script ultra-simplified to this: -- function main() { $i = 0; while ($i 1000) { $formatted_data_array = array ( 'Business' = array ('name' = 'test') ); $this-Business-save($formatted_data_array, false); $i++; } } -- It will save one time successfully, and then errors out. I get the following error message from the console: ++ C:\Apache\htdocs\project\appcake raw_data Welcome to CakePHP v1.2.0.6311 beta Console --- App : app Path: C:\Apache\htdocs\project\app --- PHP Fatal error: Class 'String' not found in C:\Apache\htdocs\project \cake\libs\model\datasources\dbo_source .php on line 1455 Fatal error: Class 'String' not found in C:\Apache\htdocs\project\cake \libs\model\datasources\dbo_source.php on line 1455 C:\Apache\htdocs\project\app + Any help would be greatly appreciated! - Cake Fan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
bug for find('All'
i think that i found a bug en find('All'. i have this source echo $tag; $res = $this-Tag-find('All',array('conditions' = array('nombre' = %.strtolower($tag))).%); and i get this error musica Query: SELECT `Tag`.`Array%` FROM `tags` AS `Tag` WHERE All LIMIT 1 any idea ? how can help me is a bug or my mistake ? thanks :D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: bug for find('All'
Report all bugs to trac.cakephp.org trust me, it's much better and faster. It goes straight to the developers. On Jan 2, 2008 8:51 PM, stefano [EMAIL PROTECTED] wrote: i think that i found a bug en find('All'. i have this source echo $tag; $res = $this-Tag-find('All',array('conditions' = array('nombre' = %.strtolower($tag))).%); and i get this error musica Query: SELECT `Tag`.`Array%` FROM `tags` AS `Tag` WHERE All LIMIT 1 any idea ? how can help me is a bug or my mistake ? thanks :D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: bug for find('All'
$this-Tag-findAll( array('nombre' = 'LIKE %'.strtolower($tag).'%') ); On Jan 3, 12:51 pm, stefano [EMAIL PROTECTED] wrote: i think that i found a bug en find('All'. i have this source echo $tag; $res = $this-Tag-find('All',array('conditions' = array('nombre' = %.strtolower($tag))).%); and i get this error musica Query: SELECT `Tag`.`Array%` FROM `tags` AS `Tag` WHERE All LIMIT 1 any idea ? how can help me is a bug or my mistake ? thanks :D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
generateDateTime bug
Hi, I was using generateDateTime and what I found I was that if the value in my datetimefield field is say '2007-12-28 12:30:00', the meridian would be rendered AM in my view, though it should be PM. Any Ideas ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Page_Title Bug in Flash()/Render()
Hi Rob, On Nov 23, 5:15 pm, Rob [EMAIL PROTECTED] wrote: Running through the Blog tutorial, I noticed that the HTML Title was not being output. I've tracked this down to this line inflash.thtml :- title?php echo $page_title?/title Although the other parameters for url, pause, etc are being created before calling this page, $page_titleis not. I've tried to track the calling function, but can only get as close as _render() in view.php. Sometimespage_titleis called as pageTitle, which I think is where the bug lies. I've just noticed the exact same thing :) Just been taking a look at CakePHP and like Rob, was doing the Blog tutorial when I noticed the same problem. The problem lies in 2 places: 1) controller\controller.php (Line ~625) in the flash() method - $this- set('page_title', $message); - this sets the page title as the flash message 2) view\view.php (Line ~599) in the _render() method - $page_title = $this-pageTitle; - this then overwrites it with $this-pageTitle which is set to false when declared in controller.php To resolve the problem here, I edited controller\controller.php and changed $this-set(page_title, $message); (line 625) to $this- _setTitle($message);. the flash() method is now working as desired for me. Thanks, Alan. P.S. I've only been looking at CakePHP for a couple of hours now but so far I'm very impressed. I can see why Mambo decided to go with it now. Good job to all involved in its development :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Trac Bug #3537
I encountered a problem with using paginator with: https://svn.cakephp.org/repo/trunk/cake/1.2.x.x/cake r6147 For some reason all the table sort links and paging links are coming out like so: /admin/faqs/admin_index/page:2 That extra /admin_index/ should really be /index/. It appears there's two patch diffs posted on this bug to fix this problem, but the bug was marked invalid before these were posted. The patches fix the sort column issue, but not the paging links. I created a consolidated patch for paginator.php file, which I could not attach to the ticket. Index: paginator.php === --- paginator.php (revision 6147) +++ paginator.php (working copy) @@ -212,6 +212,7 @@ *key the returned link will sort by 'desc'. */ function sort($title, $key = null, $options = array()) { + $admin = Configure::read('Routing.admin'); $options = am(array('url' = array(), 'model' = null), $options); $url = $options['url']; unset($options['url']); @@ -225,6 +226,11 @@ if ($this-sortKey($options['model']) == $key $this- sortDir($options['model']) == 'asc') { $dir = 'desc'; } + + if (preg_match('/'.$admin.'_/i', $this- params['action'])) { + $url['action'] = preg_replace('/'.$admin.'_/ i', '', $this-params['action']); + unset($url[$admin]); + } $url = am(array('sort' = $key, 'direction' = $dir), $url, array('order' = null)); return $this-link($title, $url, $options); @@ -238,6 +244,7 @@ * @return string A link with pagination parameters. */ function link($title, $url = array(), $options = array()) { + $admin = Configure::read('Routing.admin'); $options = am(array('model' = null, 'escape' = true), $options); $model = $options['model']; unset($options['model']); @@ -252,6 +259,12 @@ $urlOption = $options['url']; unset($options['url']); } + + if (preg_match('/'.$admin.'_/i', $this- params['action'])) { + $url['action'] = preg_replace('/'.$admin.'_/ i', '', $this-params['action']); + unset($url[$admin]); + } + $url = am(array_filter(Set::diff(am($paging['defaults'], $paging['options']), $paging['defaults'])), $urlOption, $url); if (isset($url['order'])) { @@ -489,4 +502,4 @@ return $this-output($out); } } -? \ No newline at end of file +? James --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Page_Title Bug in Flash()/Render()
Running through the Blog tutorial, I noticed that the HTML Title was not being output. I've tracked this down to this line in flash.thtml :- title?php echo $page_title ?/title Although the other parameters for url, pause, etc are being created before calling this page, $page_title is not. I've tried to track the calling function, but can only get as close as _render() in view.php. Sometimes page_title is called as pageTitle, which I think is where the bug lies. Rob. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Complex Find Conditions (using arrays) , a bug in 1.2?
I agree - it gets pretty convoluted when you add a bit of complexity into the conditions. However, I haven't yet come up with a better syntax (aside from writing plain sql of course). Have you got any suggestions? Adam On Nov 21, 3:23 am, zonium [EMAIL PROTECTED] wrote: I figured it out: The statement should be: $count =$this-PromoCode-findCount(array('or'=array(array(PromoCode.start_date = $datetime, 'PromoCode.promo_code'=$promo_code), array('PromoCode.active'='1'; and the result is as expected: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE (((`PromoCode`.`start_date` '2007-11-20 09:11:23') AND (`PromoCode`.`promo_code` = 'freemug')) OR (`PromoCode`.`active` 1)) But ... Too complicated a statement for a simple query. Don't you think? Thanks! On Nov 20, 8:55 am, zonium [EMAIL PROTECTED] wrote: In fact, my select statement was $count =$this-PromoCode-findCount(array(PromoCode.start_date = $datetime, 'PromoCode.promo_code'=$promo_code, OR=array('PromoCode.active'='1'))); and Cake created: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE `PromoCode`.`start_date` '2007-11-19 08:50:20' AND `PromoCode`.`promo_code` = 'freemug' AND ((`PromoCode`.`active` 1)) I expected SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE (`PromoCode`.`start_date` '2007-11-19 08:50:20' AND `PromoCode`.`promo_code` = 'freemug') OR ((`PromoCode`.`active` 1)) Thanks, On Nov 19, 8:42 pm, Grant Cox [EMAIL PROTECTED] wrote: Put both conditions in the 'or' key: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode-findCount(array(OR=array(PromoCode.start_date = $datetime, 'PromoCode.active'='1'))); On Nov 20, 11:49 am, zonium [EMAIL PROTECTED] wrote: I have these statements: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode-findCount(array(PromoCode.start_date = $datetime, OR=array('PromoCode.active'='1'))); With debug enabled I saw cake tried to create this query: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE `PromoCode`.`start_date` '2007-11-19 17:38:54' AND ((`PromoCode`.`active` 1)) According to the official manual (http://manual.cakephp.org/chapter/ models) I expected OR (`PromoCode`.`active` 1) instead of AND ((`PromoCode`.`active` 1)) Is it a bug or my statement was not correctly written. Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Complex Find Conditions (using arrays) , a bug in 1.2?
On Nov 21, 3:23 pm, Adam Royle [EMAIL PROTECTED] wrote: I agree - it gets pretty convoluted when you add a bit of complexity into the conditions. Where is the complexity in the stated example? Any nested array that is written on a single line is going to be 'difficult' to read as such it's easier to read if it's written as: $conditions['OR']['PromoCode.start_date'] = $datetime; $conditions['OR']['PromoCode.promo_code'] = $promo_code; $conditions['NOT']['PromoCode.active'] = 1; // or $condiions['PromoCode.active'] = ' ' . 1; $count =$this-PromoCode-findCount($conditions); OR as: $conditions = array( 'OR' = array( 'PromoCode.start_date' = $datetime, 'PromoCode.promo_code' = $promo_code ) 'NOT' = array('PromoCode.active' = 1) // or 'PromoCode.active' = ' ' . 1 ); $count =$this-PromoCode-findCount($conditions); Both of which are unambiguos (, identical) and easy to read. If you / do/ write a more complex constraint you'll find it's quite easy to do so if you adopt on or the other means of writing them. my 2c, hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Complex Find Conditions (using arrays) , a bug in 1.2?
In fact, my select statement was $count =$this-PromoCode-findCount(array(PromoCode.start_date = $datetime, 'PromoCode.promo_code'=$promo_code, OR=array('PromoCode.active'='1'))); and Cake created: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE `PromoCode`.`start_date` '2007-11-19 08:50:20' AND `PromoCode`.`promo_code` = 'freemug' AND ((`PromoCode`.`active` 1)) I expected SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE (`PromoCode`.`start_date` '2007-11-19 08:50:20' AND `PromoCode`.`promo_code` = 'freemug') OR ((`PromoCode`.`active` 1)) Thanks, On Nov 19, 8:42 pm, Grant Cox [EMAIL PROTECTED] wrote: Put both conditions in the 'or' key: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode-findCount(array(OR=array(PromoCode.start_date = $datetime, 'PromoCode.active'='1'))); On Nov 20, 11:49 am, zonium [EMAIL PROTECTED] wrote: I have these statements: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode-findCount(array(PromoCode.start_date = $datetime, OR=array('PromoCode.active'='1'))); With debug enabled I saw cake tried to create this query: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE `PromoCode`.`start_date` '2007-11-19 17:38:54' AND ((`PromoCode`.`active` 1)) According to the official manual (http://manual.cakephp.org/chapter/ models) I expected OR (`PromoCode`.`active` 1) instead of AND ((`PromoCode`.`active` 1)) Is it a bug or my statement was not correctly written. Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Complex Find Conditions (using arrays) , a bug in 1.2?
I figured it out: The statement should be: $count =$this-PromoCode- findCount(array('or'=array(array(PromoCode.start_date = $datetime, 'PromoCode.promo_code'=$promo_code), array('PromoCode.active'='1'; and the result is as expected: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE (((`PromoCode`.`start_date` '2007-11-20 09:11:23') AND (`PromoCode`.`promo_code` = 'freemug')) OR (`PromoCode`.`active` 1)) But ... Too complicated a statement for a simple query. Don't you think? Thanks! On Nov 20, 8:55 am, zonium [EMAIL PROTECTED] wrote: In fact, my select statement was $count =$this-PromoCode-findCount(array(PromoCode.start_date = $datetime, 'PromoCode.promo_code'=$promo_code, OR=array('PromoCode.active'='1'))); and Cake created: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE `PromoCode`.`start_date` '2007-11-19 08:50:20' AND `PromoCode`.`promo_code` = 'freemug' AND ((`PromoCode`.`active` 1)) I expected SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE (`PromoCode`.`start_date` '2007-11-19 08:50:20' AND `PromoCode`.`promo_code` = 'freemug') OR ((`PromoCode`.`active` 1)) Thanks, On Nov 19, 8:42 pm, Grant Cox [EMAIL PROTECTED] wrote: Put both conditions in the 'or' key: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode-findCount(array(OR=array(PromoCode.start_date = $datetime, 'PromoCode.active'='1'))); On Nov 20, 11:49 am, zonium [EMAIL PROTECTED] wrote: I have these statements: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode-findCount(array(PromoCode.start_date = $datetime, OR=array('PromoCode.active'='1'))); With debug enabled I saw cake tried to create this query: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE `PromoCode`.`start_date` '2007-11-19 17:38:54' AND ((`PromoCode`.`active` 1)) According to the official manual (http://manual.cakephp.org/chapter/ models) I expected OR (`PromoCode`.`active` 1) instead of AND ((`PromoCode`.`active` 1)) Is it a bug or my statement was not correctly written. Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Complex Find Conditions (using arrays) , a bug in 1.2?
I have these statements: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode-findCount(array(PromoCode.start_date = $datetime, OR=array('PromoCode.active'='1'))); With debug enabled I saw cake tried to create this query: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE `PromoCode`.`start_date` '2007-11-19 17:38:54' AND ((`PromoCode`.`active` 1)) According to the official manual (http://manual.cakephp.org/chapter/ models) I expected OR (`PromoCode`.`active` 1) instead of AND ((`PromoCode`.`active` 1)) Is it a bug or my statement was not correctly written. Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Complex Find Conditions (using arrays) , a bug in 1.2?
Put both conditions in the 'or' key: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode- findCount(array(OR=array(PromoCode.start_date = $datetime, 'PromoCode.active'='1'))); On Nov 20, 11:49 am, zonium [EMAIL PROTECTED] wrote: I have these statements: $datetime = date(Y-m-d H:i:s); $count =$this-PromoCode-findCount(array(PromoCode.start_date = $datetime, OR=array('PromoCode.active'='1'))); With debug enabled I saw cake tried to create this query: SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE `PromoCode`.`start_date` '2007-11-19 17:38:54' AND ((`PromoCode`.`active` 1)) According to the official manual (http://manual.cakephp.org/chapter/ models) I expected OR (`PromoCode`.`active` 1) instead of AND ((`PromoCode`.`active` 1)) Is it a bug or my statement was not correctly written. Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake 1.2 Router::url method and 'id' parameter -- bug or feature?
feature --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: generateList bug(?) in PHP4
Just found the problem: long story short, it was me being stupid. Sorry, J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
generateList bug(?) in PHP4
Hi guys, Found this problem when amending an existing site for a new customer. I'm using generateList with a table with just one item in it. Instead of returning array(2 = 447) as it should, I get the empty array. I updated cake to the most recent stable version (1.1.18.5850) and had a dig around, and something very odd seems to be happening. In model_php4.php, the generateList method includes code $return = array_combine($keys, $vals); return $return; /code I can print_r($return) in that function, and get the expected array. If I print_r the array I get following my call to generateList, I get the empty array( ); code $areas = $this-Area-generateList( null, 'area_name ASC', null, '{n}.Area.id', '{n}.Area.area_name' ); print_r($areas); /code Does anybody recognise this bizarre occurrence? My instinct is that it is a bug in PHP rather than cake, but I cannot recreate it in a stand- alone test script so I thought I'd ask some cake people. J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: generateList bug(?) in PHP4
My version of php might be important: $ php -v PHP 4.3.9 (cgi) (built: May 4 2007 11:04:51) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies Thanks, J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cookie With Multi Dimensional Array Cannot Be Read (Sometimes) Is This A Bug?
I agree with Grant Cox.. You can't just write any variable to a cookie. With plaintext strings this works, but when you have complex datatypes like multidimensional arrays, you have to convert it somehow to a plaintext string. This is exactly where the serialize() function kicks in: the only thing this function does is generate a storable representation (plaintext string) of any value. So there's no encryption involved at all (though it looks encrypted if you look at the value). If you want to encrypt your information (seems to be a good thing since it's about user-logins), you should serialize your array, and then encrypt it's output before you pass it to the cookie. When retrieving the cookie, it's obviously the other way round. On Nov 12, 5:43 am, Grant Cox [EMAIL PROTECTED] wrote: The reason it works in the first controller is because it is not reading from the cookie itself - it also saves the data to a local variable and it is reading back from that. Because there is no automatic serialization going on, only strings are written to the cookie - so a complex data type will never work in your second controller (or after refreshing the page, or whatever so that it does actually read the cookie). I can't think of any reason that it would not work without encryption though... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cookie With Multi Dimensional Array Cannot Be Read (Sometimes) Is This A Bug?
Sorry, didn't know cookies were plain text. So serialization *should* work always, but it doesn't if you set the encryption option to *off*. I'm just sharing information trying to save others the hours I've spent with this problem. -- Baz L Web Development 2.0: Web Design, CakePHP, Javascript http://www.WebDevelopment2.com/ On Nov 12, 2007 11:31 AM, Ivolution [EMAIL PROTECTED] wrote: I agree with Grant Cox.. You can't just write any variable to a cookie. With plaintext strings this works, but when you have complex datatypes like multidimensional arrays, you have to convert it somehow to a plaintext string. This is exactly where the serialize() function kicks in: the only thing this function does is generate a storable representation (plaintext string) of any value. So there's no encryption involved at all (though it looks encrypted if you look at the value). If you want to encrypt your information (seems to be a good thing since it's about user-logins), you should serialize your array, and then encrypt it's output before you pass it to the cookie. When retrieving the cookie, it's obviously the other way round. On Nov 12, 5:43 am, Grant Cox [EMAIL PROTECTED] wrote: The reason it works in the first controller is because it is not reading from the cookie itself - it also saves the data to a local variable and it is reading back from that. Because there is no automatic serialization going on, only strings are written to the cookie - so a complex data type will never work in your second controller (or after refreshing the page, or whatever so that it does actually read the cookie). I can't think of any reason that it would not work without encryption though... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Cookie With Multi Dimensional Array Cannot Be Read (Sometimes) Is This A Bug?
*Sigh*, So I've been pulling out my hair for a while until I figured, this thing just doesn't work the way it should. Here's my scenario very simplified with test data: Controller1: $arr['name']['1'] = '21'; $arr['name']['2'] = '21'; $arr['name1']['1'] = '21'; $this-Cookie-write('zilla', $arr, false); $this-log('What\'s my cooking'); $this-log($this-Cookie-read('zilla')); Output: ( [name] = Array ( [1] = 21 [2] = 21 ) [name1] = Array ( [1] = 21 ) ) Controller 2: $this-log('What\'s my cooking'); $this-log($this-Cookie-read('zilla')); Output: ( [name] = Array [name1] = Array ) It basically eats up the second dimension on an array. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cookie With Multi Dimensional Array Cannot Be Read (Sometimes) Is This A Bug?
*Probably* the following will work: before writing your array to the cookie: $arr = serialize($arr); after reading it from your cookie (when $cookval is the value you read from your cookie): $arr = @unserialize($cookval); This way you should have your whole array back. Note however that I didn't test this code at all, it's just the first thing that jumps into my mind. Ivo On Nov 11, 12:45 pm, Baz [EMAIL PROTECTED] wrote: *Sigh*, So I've been pulling out my hair for a while until I figured, this thing just doesn't work the way it should. Here's my scenario very simplified with test data: Controller1: $arr['name']['1'] = '21'; $arr['name']['2'] = '21'; $arr['name1']['1'] = '21'; $this-Cookie-write('zilla', $arr, false); $this-log('What\'s my cooking'); $this-log($this-Cookie-read('zilla')); Output: ( [name] = Array ( [1] = 21 [2] = 21 ) [name1] = Array ( [1] = 21 ) ) Controller 2: $this-log('What\'s my cooking'); $this-log($this-Cookie-read('zilla')); Output: ( [name] = Array [name1] = Array ) It basically eats up the second dimension on an array. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cookie With Multi Dimensional Array Cannot Be Read (Sometimes) Is This A Bug?
Thanks for the response, but here's a few FYIs. - What I posted before works fine with Sessions. That's actually how I determined the problem. I was building a remember me for a login. And I thought I could just dump the session variable in a cookie and retrieve later. So maybe if anyone decides to fix this, they might look at the Session::write and Session::read. - I don't know much about cookies, but it appears that after the cookie is saved AND the pages has loaded, we have problems. - Now here's the kicker. Your solutions seems fine. And it might be, but I've noticed that it doesn't work when the cookie is NOT encrypted. I was storing non-encrypted while debug so I could look at values, but when I switched to encrypted, it worked like a charm. Go figure. - Another FYI, it failed when I tried to store: $this. The initial write and read worked, but from the second controller, it failed to read. I'm guessing max cookie or something? Maybe I'm trying to do too much. But regular, small, single dimensional arrays work fine. And the serialize options works for small multi dimensional arrays. ThanX again. On Nov 11, 2007 9:20 AM, Ivolution [EMAIL PROTECTED] wrote: *Probably* the following will work: before writing your array to the cookie: $arr = serialize($arr); after reading it from your cookie (when $cookval is the value you read from your cookie): $arr = @unserialize($cookval); This way you should have your whole array back. Note however that I didn't test this code at all, it's just the first thing that jumps into my mind. Ivo On Nov 11, 12:45 pm, Baz [EMAIL PROTECTED] wrote: *Sigh*, So I've been pulling out my hair for a while until I figured, this thing just doesn't work the way it should. Here's my scenario very simplified with test data: Controller1: $arr['name']['1'] = '21'; $arr['name']['2'] = '21'; $arr['name1']['1'] = '21'; $this-Cookie-write('zilla', $arr, false); $this-log('What\'s my cooking'); $this-log($this-Cookie-read('zilla')); Output: ( [name] = Array ( [1] = 21 [2] = 21 ) [name1] = Array ( [1] = 21 ) ) Controller 2: $this-log('What\'s my cooking'); $this-log($this-Cookie-read('zilla')); Output: ( [name] = Array [name1] = Array ) It basically eats up the second dimension on an array. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cookie With Multi Dimensional Array Cannot Be Read (Sometimes) Is This A Bug?
The reason it works in the first controller is because it is not reading from the cookie itself - it also saves the data to a local variable and it is reading back from that. Because there is no automatic serialization going on, only strings are written to the cookie - so a complex data type will never work in your second controller (or after refreshing the page, or whatever so that it does actually read the cookie). I can't think of any reason that it would not work without encryption though... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in renderElement?
Must be the s from pluralize with $module['Module']['name'] beeing empty. On 8 Nov., 17:57, mbavio [EMAIL PROTECTED] wrote: Hi, i´m trying to add a menu using renderElement, all works fine except that Cake is adding an 's' before the generated code... Is it a bug? Or i´m a bug? Here is the code... In layout 'backend.ctp': ul id=menu ?php echo $this-element('admin_menu');? /ul In element 'admin_menu.ctp': ?php $modules = $this-requestAction('modules/createMenu'); foreach($modules as $module): $moduleLabel = $module['Module']['label']; $moduleLink = Inflector::pluralize($module['Module']['name']); echo li; echo $html-link($moduleLabel, /admin/$moduleLink/, array(id = menu$moduleLabel)); echo /li\n; endforeach; ? In controller 'modules_controller': function createMenu() { $modules = $this-Module-findAll(); if(isset($this-params['requested'])) { return $modules; } $this-set(compact('modules')); } Here is the HTML generated: ul id=menu slia href=/cake/admin/generals/ id=menuGeneralesGenerales/ a/li lia href=/cake/admin/listings/ id=menuPropiedadesPropiedades/ a/li lia href=/cake/admin/helps/ id=menuAyudaAyuda/a/li /ul The fuck*** s is located after the oppening of the ul... Anybody has a clue about this? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in renderElement?
No, I delete the Inflector function and the 's' is still showing there. Here is a little test that i did: With the same modules_controller.php: ?php class ModulesController extends AppController { function createMenu() { $modules = $this-Module-findAll(); if(isset($this-params['requested'])) { return $modules; } $this-set(compact('modules')); } } ? I try two different elements: ?php echo TEST\n; /* $modules = $this-requestAction('modules/createMenu'); foreach($modules as $module): $moduleLabel = $module['Module']['label']; $moduleLink = Inflector::pluralize($module['Module']['name']); echo li; echo $html-link($moduleLabel, /admin/$moduleLink/, array(id = menu$moduleLabel)); echo /li\n; endforeach; */ ? In this first version, i comment the most important part of the element, and i´m only printing a 'TEST' string. The output is correct, showing only the word TEST. The second test element is the followind: ?php echo TEST\n; $modules = $this-requestAction('modules/createMenu'); /* foreach($modules as $module): $moduleLabel = $module['Module']['label']; $moduleLink = Inflector::pluralize($module['Module']['name']); echo li; echo $html-link($moduleLabel, /admin/$moduleLink/, array(id = menu$moduleLabel)); echo /li\n; endforeach; */ ? Here I uncomment the call for the action createMenu in modules_controller. Only that line is uncommented. The result: TEST s The s is still showing! So I have to say that my problem is in the action of the controller that I show before. But I cant find any error Can anybody help me please, it´s getting me crazy. Thanks. On Nov 8, 2:12 pm, schneimi [EMAIL PROTECTED] wrote: Must be the s from pluralize with $module['Module']['name'] beeing empty. On 8 Nov., 17:57, mbavio [EMAIL PROTECTED] wrote: Hi, i´m trying to add a menu using renderElement, all works fine except that Cake is adding an 's' before the generated code... Is it a bug? Or i´m a bug? Here is the code... In layout 'backend.ctp': ul id=menu ?php echo $this-element('admin_menu');? /ul In element 'admin_menu.ctp': ?php $modules = $this-requestAction('modules/createMenu'); foreach($modules as $module): $moduleLabel = $module['Module']['label']; $moduleLink = Inflector::pluralize($module['Module']['name']); echo li; echo $html-link($moduleLabel, /admin/$moduleLink/, array(id = menu$moduleLabel)); echo /li\n; endforeach; ? In controller 'modules_controller': function createMenu() { $modules = $this-Module-findAll(); if(isset($this-params['requested'])) { return $modules; } $this-set(compact('modules')); } Here is the HTML generated: ul id=menu slia href=/cake/admin/generals/ id=menuGeneralesGenerales/ a/li lia href=/cake/admin/listings/ id=menuPropiedadesPropiedades/ a/li lia href=/cake/admin/helps/ id=menuAyudaAyuda/a/li /ul The fuck*** s is located after the oppening of the ul... Anybody has a clue about this? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Bug in renderElement?
Solved: The stupid 's' was in the module! Before the ?php... So stupid...Thanks anyway. Cheers. On Nov 9, 1:01 am, mbavio [EMAIL PROTECTED] wrote: No, I delete the Inflector function and the 's' is still showing there. Here is a little test that i did: With the same modules_controller.php: ?php class ModulesController extends AppController { function createMenu() { $modules = $this-Module-findAll(); if(isset($this-params['requested'])) { return $modules; } $this-set(compact('modules')); } } ? I try two different elements: ?php echo TEST\n; /* $modules = $this-requestAction('modules/createMenu'); foreach($modules as $module): $moduleLabel = $module['Module']['label']; $moduleLink = Inflector::pluralize($module['Module']['name']); echo li; echo $html-link($moduleLabel, /admin/$moduleLink/, array(id = menu$moduleLabel)); echo /li\n; endforeach; */ ? In this first version, i comment the most important part of the element, and i´m only printing a 'TEST' string. The output is correct, showing only the word TEST. The second test element is the followind: ?php echo TEST\n; $modules = $this-requestAction('modules/createMenu'); /* foreach($modules as $module): $moduleLabel = $module['Module']['label']; $moduleLink = Inflector::pluralize($module['Module']['name']); echo li; echo $html-link($moduleLabel, /admin/$moduleLink/, array(id = menu$moduleLabel)); echo /li\n; endforeach; */ ? Here I uncomment the call for the action createMenu in modules_controller. Only that line is uncommented. The result: TEST s The s is still showing! So I have to say that my problem is in the action of the controller that I show before. But I cant find any error Can anybody help me please, it´s getting me crazy. Thanks. On Nov 8, 2:12 pm, schneimi [EMAIL PROTECTED] wrote: Must be the s from pluralize with $module['Module']['name'] beeing empty. On 8 Nov., 17:57, mbavio [EMAIL PROTECTED] wrote: Hi, i´m trying to add a menu using renderElement, all works fine except that Cake is adding an 's' before the generated code... Is it a bug? Or i´m a bug? Here is the code... In layout 'backend.ctp': ul id=menu ?php echo $this-element('admin_menu');? /ul In element 'admin_menu.ctp': ?php $modules = $this-requestAction('modules/createMenu'); foreach($modules as $module): $moduleLabel = $module['Module']['label']; $moduleLink = Inflector::pluralize($module['Module']['name']); echo li; echo $html-link($moduleLabel, /admin/$moduleLink/, array(id = menu$moduleLabel)); echo /li\n; endforeach; ? In controller 'modules_controller': function createMenu() { $modules = $this-Module-findAll(); if(isset($this-params['requested'])) { return $modules; } $this-set(compact('modules')); } Here is the HTML generated: ul id=menu slia href=/cake/admin/generals/ id=menuGeneralesGenerales/ a/li lia href=/cake/admin/listings/ id=menuPropiedadesPropiedades/ a/li lia href=/cake/admin/helps/ id=menuAyudaAyuda/a/li /ul The fuck*** s is located after the oppening of the ul... Anybody has a clue about this? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: sanitize bug or ?
You should update your cake core. The newest escape function reads: 00073 function escape($string, $connection = 'default') { 00074 $db = ConnectionManager::getDataSource($connection); 00075 if (is_numeric($string)) { 00076 return $string; 00077 } 00078 $string = substr($db-value($string), 1); 00079 $string = substr($string, 0, -1); 00080 return $string; 00081 } And will deal right with your number. Cheers, Joachim On Oct 26, 11:21 pm, vg2k [EMAIL PROTECTED] wrote: i forgot say, using cakephp 1.2 alpha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
sanitize bug or ?
sanitize.php /** * Makes a string SQL-safe. * * @param string $string String to sanitize * @param string $connection Database connection being used * @return string SQL safe string * @access public * @static */ function escape($string, $connection = 'default') { $db = ConnectionManager::getDataSource($connection); $value = substr($db-value($string), 1); $value = substr($value, 0, -1); return $value; } if try at controler code: $san = new Sanitize(); $var = $san-escape('12345'); die(var_dump($var)); take: string '234' (length=3) WHY ? if code: $san = new Sanitize(); $var = $san-escape('1'); die(var_dump($var)); take: boolean false --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: sanitize bug or ?
i forgot say, using cakephp 1.2 alpha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Writing to session in an Ajax request starts new session in SVN 1.2.x.x - Bug?
Well, I looked closer and it's not on an AJAX call, but on a redirect to a previously visited page. I think it's a caching issue with FireFox, but I cannot figure out how to resolve this On Oct 5, 6:36 am, jonathan [EMAIL PROTECTED] wrote: I believe I am experiencing the same thing. Session is fine one minute, and gone the next (after AJAX call). IE is fine, problem only happens in FireFox. Anyone come up with a solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Writing to session in an Ajax request starts new session in SVN 1.2.x.x - Bug?
I believe I am experiencing the same thing. Session is fine one minute, and gone the next (after AJAX call). IE is fine, problem only happens in FireFox. Anyone come up with a solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Writing to session in an Ajax request starts new session in SVN 1.2.x.x - Bug?
I'm experiencing the problem in every other browsers I've tried: IE6, Opera, Safari (mac). Your problem sounds different, but for all I know it could be related. Are you writing data to the user's session in the action that's being called as well? - Arjen On 10/5/07, jonathan [EMAIL PROTECTED] wrote: Well, I looked closer and it's not on an AJAX call, but on a redirect to a previously visited page. I think it's a caching issue with FireFox, but I cannot figure out how to resolve this On Oct 5, 6:36 am, jonathan [EMAIL PROTECTED] wrote: I believe I am experiencing the same thing. Session is fine one minute, and gone the next (after AJAX call). IE is fine, problem only happens in FireFox. Anyone come up with a solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---