Re: RequestHandler::isAjax() buggy?
Hi, maytbe this will halp you to find your bug. I have add into app_controller before_filter() this lines $this->disableCache(); I've found this solution in http://osdir.com/ml/CakePHP/2010-01/msg00629.html (for view this link content - look into google cache, now it forbidden for me :( ) On Nov 29, 5:57 am, "Dr. Loboto" wrote: > Check that request is really done. I never saw this in anything except > IE, but in IE it is always aggressive caching when browser do not > repeat request to the same URL in the short period of time at all. If > you see same (no real request) in other browsers it is definitely > aggressive caching by headers of your app or your web server. > > On 29 ноя, 02:34, cricket wrote: > > > On Sun, Nov 28, 2010 at 2:56 PM, cricket wrote: > > > I'm seeing some strange behavior on a site. I haven't been able to > > > reproduce it locally, just on the server, and it's also only showing > > > up just once in a while. What's happening is, occasionally, isAjax() > > > is incorrectly returning true, and so just the element is rendered. > > > > public function index() > > > { > > > $this->Session->write('path_back', $this->here); > > > > $this->set('data', $this->paginate()); > > > > if ($this->RequestHandler->isAjax()) > > > { > > > $this->viewPath = 'elements'.DS.'books'; > > > $this->render('pagination'); > > > } > > > } > > > > So, I've got a paginated list of books, and I'm loading further pages > > > using AJAX. The session business allows me to get back to the correct > > > index page from a "view" view. I can't think of any reason why that > > > would be involved, though. > > > > I can't remember seeing anyone else report this sort of thing. Has > > > anyone run into it? Or have any suggestions for why this might be > > > occurring? Or how to go about debugging this? > > > Sorry for the noise. This fell into my lap while I was busily trying > > to get something else to deadline and I wasn't thinking things through > > very well. It's not a Cake issue, although I'll continue here as it > > might be of help to someone someday. > > > The obvious first step is to log the request headers before rendering > > just the element. I did that and see: > > > [X-Requested-With] => XMLHttpRequest > > > So Cake is doing the right thing. Next step: check the browser. I was > > using FF 3.6.12. I could see that the page is being refreshed but > > tried disabling JS anyway. Sure enough, I was able to eventually > > repeat it. I then opened the site in Chrome (7.0.517.44) and clicked > > away for a while (remember, this bug only shows up occasionally). I > > was literally just about to give up on Chrome when the bug showed > > itself. I then was able to get Opera (10.10) to do it. > > > I disabled caching, on the principle that it couldn't hurt, so why > > not? No difference. > > > Speaking of caching: Firefox is showing this un-styled rendered > > element, and I try shift-refresh. After four or five tries, the page > > finally loads correctly. WTF? This makes no sense at all. > > > Maybe an Apache bug? That's beginning to seem like the only > > explanation. Especially as everything's fine locally. Will update that > > and post results. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: pagination url options
Thank you Dr. Loboto This is really great fix. - all works perfectly. p.s. it is really sad that this feature not described in the docs On Nov 24, 5:54 am, "Dr. Loboto" wrote: > $paginator->options(array('url' => array('?' => $this- > > >data['Search'])); > > On 24 ноя, 09:31, Dmitry Shevchenko wrote: > > > I found a very bad solution > > 1. make convert from array to url manually > > 2. add this to parameters array > > 3. unset not flat array's in param > > > f.e. > > $seeking_url = ''; > > if (!empty($this->data['Search']['seeking'])) > > { > > $seeking_url .= "seeking="; //make url to string > > > foreach ($this->data['Search']['seeking'] as $field=> > > $value) > > { > > $seeking_url .= "&seeking[]=".$value; //make url > > to string > > } > > $this->data['Search']['see'] = $seeking_url; //add to > > params > > > unset($this->data['Search']['seeking']); // unset real > > array > > > } > > > but this is VERY UGLY solution. Maybe someone knew better ?? > > > On Nov 23, 3:55 pm, Dmitry Shevchenko wrote: > > > > Hi. > > > I found a some error when using paginator-> options ( .. url ..) > > > > for example this is my call for paginator in view. > > > $paginator->options (array('url' => $this->data['Search'] .. > > > > and if data['Search'] is flat array - all is good - it will create a > > > correct url > > > but if it contain a sub arrays like: > > > $url = array( > > > "controller" => "profiles", > > > "plugin" => null, > > > "page" => 1, > > > "search_type" => "advanced", > > > "age_from" => "0", > > > "age_to" => "0", > > > "with_photo" => "0", > > > "is_online" => "0", > > > "seeking" => array( > > > "5", > > > "7" > > > ), > > > > I'm getting a Array to string conversion [ROOT\cake\cake\libs > > > \router.php, line 952] > > > > It seems cake doesn't convert sub arrays like > > > seeking=&seeking[]=1&seeking[]=2&seeking[]=4&seeking[]=7 > > > > Do anyone knew some workaround for this? > > > > p.s. I'm using cake 1.2.6 and possibly found a bug Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: pagination url options
I found a very bad solution 1. make convert from array to url manually 2. add this to parameters array 3. unset not flat array's in param f.e. $seeking_url = ''; if (!empty($this->data['Search']['seeking'])) { $seeking_url .= "seeking="; //make url to string foreach ($this->data['Search']['seeking'] as $field=> $value) { $seeking_url .= "&seeking[]=".$value; //make url to string } $this->data['Search']['see'] = $seeking_url; //add to params unset($this->data['Search']['seeking']); // unset real array } but this is VERY UGLY solution. Maybe someone knew better ?? On Nov 23, 3:55 pm, Dmitry Shevchenko wrote: > Hi. > I found a some error when using paginator-> options ( .. url ..) > > for example this is my call for paginator in view. > $paginator->options (array('url' => $this->data['Search'] .. > > and if data['Search'] is flat array - all is good - it will create a > correct url > but if it contain a sub arrays like: > $url = array( > "controller" => "profiles", > "plugin" => null, > "page" => 1, > "search_type" => "advanced", > "age_from" => "0", > "age_to" => "0", > "with_photo" => "0", > "is_online" => "0", > "seeking" => array( > "5", > "7" > ), > > I'm getting a Array to string conversion [ROOT\cake\cake\libs > \router.php, line 952] > > It seems cake doesn't convert sub arrays like > seeking=&seeking[]=1&seeking[]=2&seeking[]=4&seeking[]=7 > > Do anyone knew some workaround for this? > > p.s. I'm using cake 1.2.6 and possibly found a bug Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
pagination url options
Hi. I found a some error when using paginator-> options ( .. url ..) for example this is my call for paginator in view. $paginator->options (array('url' => $this->data['Search'] .. and if data['Search'] is flat array - all is good - it will create a correct url but if it contain a sub arrays like: $url= array( "controller" => "profiles", "plugin" => null, "page" => 1, "search_type" => "advanced", "age_from" => "0", "age_to" => "0", "with_photo" => "0", "is_online" => "0", "seeking" => array( "5", "7" ), I'm getting a Array to string conversion [ROOT\cake\cake\libs \router.php, line 952] It seems cake doesn't convert sub arrays like seeking=&seeking[]=1&seeking[]=2&seeking[]=4&seeking[]=7 Do anyone knew some workaround for this? p.s. I'm using cake 1.2.6 and possibly found a bug Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: 2 database, 1 models and controllers, many views
I wanted to create 2 separated web site which will use same models and controllers. main aim - run 2 sites which will use almost the same logic but it will be build with different design. I wanted to use same models and controllers, because I want to support only one version. so database structure, models, controllers will be the same differents - views (design) and domains. On Oct 28, 2:54 pm, Zaky Katalan-Ezra wrote: > What is your goal? > > On Thu, Oct 28, 2010 at 12:31 PM, Dmitry Shevchenko wrote: > > > > > Hi. > > Is it possibly for cake to have 2 different database, which is use > > same models and controllers and different views. > > > I need this to create a almost copy of website, so system logic will > > be the same, I will only have separated DB and views. > > > Seems this could be done by switching config on config.php and maybe > > dispatcher.php... but I'm not sure. > > > Is someone do something similar ? > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.comFor > > more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en > > -- > Regards, > Zaky Katalan-Ezra > QA Administratorwww.IGeneriX.com > Sites.IGeneriX.com > 054-7762312 Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
2 database, 1 models and controllers, many views
Hi. Is it possibly for cake to have 2 different database, which is use same models and controllers and different views. I need this to create a almost copy of website, so system logic will be the same, I will only have separated DB and views. Seems this could be done by switching config on config.php and maybe dispatcher.php... but I'm not sure. Is someone do something similar ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: cakePHP + openID component (cakebaker) + google
Thank you Dr. Loboto: I'm using a https link for test - like https://www.google.com/accounts/o8/id and still has a invalid openID I have made some additional research .. my test server don't bind on 80 port, it use port, so l have to change $returnTo from = 'http://'.$_SERVER['SERVER_NAME'].$this->webroot; to = 'http://'.$_SERVER['HTTP_HOST'].$this->webroot; but when I'm test it with myopenid I'm getting: The request was not a valid OpenID request. While processing the request, the following error occurred: return_to not under trust_root u'X' look like openID response couldn't be send to not standard port? Am I right? Does someone seen this error? Please help me. On Oct 22, 7:20 am, "Dr. Loboto" wrote: > Google needs HTTPS instead of HTTP as MyOpenId. > > On Oct 22, 1:32 am, Dmitry Shevchenko wrote: > > > Hi. > > I'm trying to run example fromhttp://code.42dh.com/openid/. For > > regular openID provider like MyOpenid it works fine, but when I'm > > trying to use it for google (https://www.google.com/accounts/o8/id) > > it show me Invalid OpenID . > > > but when I use demo: http://openid-example.42dh.com/allworks > > perfectly. Maybe someone has the same?? > > > Please help me.. > > > p.s. Maybe someone knew other openid component for cake ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
cakePHP + openID component (cakebaker) + google
Hi. I'm trying to run example from http://code.42dh.com/openid/. For regular openID provider like MyOpenid it works fine, but when I'm trying to use it for google ( https://www.google.com/accounts/o8/id ) it show me Invalid OpenID . but when I use demo: http://openid-example.42dh.com/ all works perfectly. Maybe someone has the same?? Please help me.. p.s. Maybe someone knew other openid component for cake ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Validation translations
Thank you Sanza and Dr. Loboto I've tried Sanza's example and it works. I will try a Dr. Loboto example lately. Thank you!!! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Validation translations
Hi. I have a problem with translation validation messages. seems it didn't takes from view. I have a validation rules for field, it looks like: 'looking_agegroup_to' => array( 'checkRange'=>array ( 'rule' => array('range', 16, 100), 'message'=> 'Please enter a number between 16 and 100', 'allowEmpty' => true ), 'checkAgeGroup' => array( 'rule' => array('_checklookingAgeGroup'), 'message'=> 'Please check age in the from and to checkboxes', ) ), on my view I have displayed this field like this echo $form->input('ProfileExtend.looking_agegroup_to', array('label'=> __('to:',true), 'div' => array('class' => 'shortselect2'), 'empty' => '', 'options' => $age_range, 'error' => array( 'checkRange' => __('Please enter a number between 120 and 210', true), 'checkAgeGroup' => __('Please verify data in the age fields', true) ), ) ); When error happened I see a message which is set in the validation rule, not what I set in the view. If someone knew a solution - please help me. This bug is killing me. Thanks a lot. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: ajax helper for updating a div
Hi, 1. place $this->render('your ajax view'); into controller deleteattachment() function 2. you can add your variables to url will look like array('controller' => 'linkables', 'action' => 'deleteattachment', param1,param2 and it will be available in the controller as $this->params. try to pr($this); to see all available data; On Sep 9, 3:01 pm, Tomfox Wiranata wrote: > hi, > > again, ajax is driving me nuts. shocker! :) > > I have a certain DIV that echoes data from a table. with each data row > comes an ajax link to delete it. when a user clicks that link, a > delete() function in my controller deletes that certain data and this > DIV is supposed to update. I found some code for orientation, but it > wont work. > > the View "render_attachment.ctp" echoes the data from my table and has > the ajax link: > > > echo $javascript->link('prototype'); > echo $javascript->link('scriptaculous'); > > ?> > > > foreach ($attachments as $attachment): > > echo $attachment['LinkTmp']['name']; > echo $ajax->link('x', array('controller' => > 'linkables', 'action' => 'deleteattachment'), array('update' => > 'attachment_div')); > > ?> > > > > > > the render_attachment.ctp View is called after a file-upload-process > to show the user what files he uploaded: > > function __renderattachment() > { > $this->set('attachments', $this->Link->LinkTmp->find('all', > array('conditions' => array('LinkTmp.ed =' => $this -> Session -> > read('Link.eyed'), 'LinkTmp.attachment' => '1'; > $this->render('render_attachment','ajax'); > } > > Now with the ajax link I try to call the "deleteattachment()" fnction > in my controller, that acutally deletes that data from the table: > > function deleteattachment($name) > { > $this->Link->LinkTmp->deleteAll(array('LinkTmp.eyed' => $this > -> > Session -> read('Link.eyed'), 'LinkTmp.name' => $name)); > > } > > so, how do I > > a) tell cake to render my view "render_attachment.ctp" in the DIV that > i defined in the link, after i called deleteattachment() ? > > b) how can i pass variables to deleteattachment() with my ajax link? > echo $ajax->link('x', array('controller' => 'linkables', 'action' => > 'deleteattachment'), array('update' => 'attachment_div')); > > thx :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
cakePHP + openid on windows XP
Hi I have use openId component from cakebaker (http://code.42dh.com/ openid/) and when I'm trying to authentificate fom google I'm getting an errors: handleOpenIDResponse Notice (8): Undefined variable: sregContents [APP\controllers \users_controller.php, line 229] Auth_OpenID_FailureResponse Object ( [status] => failure [endpoint] => [identity_url] => [message] => Server denied check_authentication [contact] => [reference] => ) my config is OS Win XP PHP 5.2.12 cakePHP 1.2.6 I have double check is openSSL and curl enabled, also I have added a patch from http://www.pixelastic.com/blog/171:adding-openid-support for windows Maybe someone stuck in the same trouble? I really appreciate any help. Thank you. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
How to use $session in the helpers
Hi. I use $session in my views like $session->read('some_var') and it have same values as on controller (I mean $this->Session->read('some_var')) But when I tried to use it on helper I get error that session are not defined. Is there any way to use $session inside the helper? Thank you for you help Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Controller::render not running actions?
Hi. You should use a requestAction() http://book.cakephp.org/view/434/requestAction On 26 авг, 18:49, jostster wrote: > Well I would expect Controller::render(); to run the controller action > & the view and only View::render() to render the view. > > On Aug 26, 7:31 am, Jeremy Burns | Class Outfit > > wrote: > > Render just does what it says it will; render a view. It does not run the > > controller action with the same name. You can try $this->index(); which > > will run the action, but I'm not sure if the values you have set will be > > available. You could drop them into a keyed array (instead of loads of > > variable) and pass them into the index action as an optional variable. > > > Jeremy Burns > > Class Outfit > > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > > On 26 Aug 2010, at 00:49, jostster wrote: > > > > Is it just me misunderstanding what this is supposed to do or is it a > > > bug? > > > > I have an Upload controller with 2 actions. > > > > index(): > > > This is where the database query is done to retrieve dropdown list > > > values and send them to the index.ctp where the form is created. > > > > upload(): > > > This is where the validating is done and the uploading to the system > > > is done. > > > > Problem: > > > In upload() I have it do validation and if validation fails then it > > > will do Controller::render('index'); so that it will display the form > > > again with the error messages. Even though the index view is > > > displayed the UploadController::Index is not run so that the values > > > from the database can be retrived. > > > > Temp solution: > > > What I have to do right now is before I call > > > Controller::render('index'); I have to call $this->index(); so that > > > the database query will be ran and the $this->set() values are created > > > for the index.ctp file. > > > > My understanding of how this SHOULD work is if > > > Controller::render('index') is ran then it will run the action for > > > index() and then run the index view. Is this not the case? > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups > > > "CakePHP" group. > > > To post to this group, send email to cake-php@googlegroups.com > > > To unsubscribe from this group, send email to > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
get result in the $options['complete'] callback
Hi I have used ajax for submitting form. And I wanted to know - is there any way to get status of submitting in the $options['complete'] callback for example, I submit a form and get a validation error, code in the $options['complete'] will run, but I need to execute it only if form submit successfully. Maybe someone knew any other way to execute different code depending on submitting result. Many thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: translate emails in cron run
as I understand it use getText, but why it works on http, and completely break when I tried ti run it from console like php cron_dispatcher.php /CronJobs/send does anyone knew something about it Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
translate emails in cron run
Hi. I have used a cron job to send emails to user, and I have a issue with translations. If I use translation in http call all is fine - pages translated correctly (I set Configure::write('Config.language', 'en'); in my app_controller)/ But when I'm trying to set language in cron - it sets, but without any translations. seems that it didn't include any .po data. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: cron dispatcher and route
Hi seems that the fastest solution - is set FULL_BASE_URL in the cron dispatcher if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', 'http://www.mydomain.com'); } if someone knew better way - please tell me. Thank you. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
cron dispatcher and route
Hi I have created a cron job which is send emails. On email template I use route to create correct links. When I send email from "normal" environment all links created correct, but when I'm trying to send it by cron I have get a links without domain, it looks like (/user/login I wanted domain.com/user/login) I have tried to import route and config in the cron action App::import('Core', array('Router','Controller')); include CONFIGS . 'routes.php'; but this is didn't help. Does someone know any workaround for this? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how to disable query caching?
Thank you AD7six and alagar I will try your solutions Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how to disable query caching?
Hi I have turned on debug and saw that query is called only one time. So when I have tried to call it many times in a loop - it was run only in a first call, and for other calls it returned a cached values. Thank you. On 22 Чер, 20:22, Miles J wrote: > What do you mean its "cached"? What is it doing exactly. > > On Jun 22, 7:21 am, Dmitry Shevchenko wrote: > > > > > Hi ! > > Is there any way to disable caching for $this->model->query() > > I have used > > $this->MyModel->cacheQueries = false; and same setting in model var > > $cacheQueries = false; > > but seems that this isn't work > > > Does anyone knew some workaround for this? > > p.s. I use CakePHP 1.2.5 > > > Thanks for your help. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
how to disable query caching?
Hi ! Is there any way to disable caching for $this->model->query() I have used $this->MyModel->cacheQueries = false; and same setting in model var $cacheQueries = false; but seems that this isn't work Does anyone knew some workaround for this? p.s. I use CakePHP 1.2.5 Thanks for your help. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: cakePHP emai component
Thank you Sergei, but ptoblem didn't fixed yetl. I have changed structure in my aoo. now I use email comoinent in controller, but variables didn't set also. And warnings stiil aprear. ... I haven't any Idea why this happen I have tried to use component by var $component, and by app:: import ... On Jun 14, 5:35 am, Sergei wrote: > Because $this->set in model != $this->set in controller. You should > set() varibales for template from controller. set() from model sets > data for DB. > > Use it from controller. > > On Jun 14, 10:00 am, Dmitry Shevchenko wrote: > > > I have tried to import email component in my model, and seems all is > > ok, except I CAN'T send data to template, > > but sender addr, subject and other looks ok. I do this like: > > > App::import('Component', 'Email'); > > $this->Email = new EmailComponent(); > > $this->Email->to = $to; > > $this->Email->subject = $emailSubject; > > $this->Email->replyTo = $replyToEmail; > > $this->Email->from = $from; > > $this->Email->template = $templateName; > > $this->Email->sendAs = $sendAs; > > $this->set('data', $data); > > > $this->Email->send(); > > > Wnen I'm do a debug I'm getting : > > > View Object > > ( > > [base] => > > [here] => > > [plugin] => > > [name] => > > [action] => > > [params] => Array > > ( > > ) > > > [passedArgs] => Array > > ( > > ) > > > [data] => Array > > ( > > ) > > > [helpers] => Array > > ( > > [0] => Html > > ) > > > [viewPath] => ... > > > > > with the warnings > > Notice (8): Trying to get property of non-object [ROOT\cake\cake\libs > > \controller\components\email.php, line 363] > > Notice (8): Trying to get property of non-object [ROOT\cake\cake\libs > > \controller\components\email.php, line 370] > > Notice (8): Undefined property: View::$webroot [ROOT\cake\cake\libs > > \view\view.php, line 755] > > > Could someone help me. > > > Also, When I'm try to send email from other controller = all works > > perfectly Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
cakePHP emai component
I have tried to import email component in my model, and seems all is ok, except I CAN'T send data to template, but sender addr, subject and other looks ok. I do this like: App::import('Component', 'Email'); $this->Email = new EmailComponent(); $this->Email->to = $to; $this->Email->subject = $emailSubject; $this->Email->replyTo = $replyToEmail; $this->Email->from = $from; $this->Email->template = $templateName; $this->Email->sendAs = $sendAs; $this->set('data', $data); $this->Email->send(); Wnen I'm do a debug I'm getting : View Object ( [base] => [here] => [plugin] => [name] => [action] => [params] => Array ( ) [passedArgs] => Array ( ) [data] => Array ( ) [helpers] => Array ( [0] => Html ) [viewPath] => ... with the warnings Notice (8): Trying to get property of non-object [ROOT\cake\cake\libs \controller\components\email.php, line 363] Notice (8): Trying to get property of non-object [ROOT\cake\cake\libs \controller\components\email.php, line 370] Notice (8): Undefined property: View::$webroot [ROOT\cake\cake\libs \view\view.php, line 755] Could someone help me. Also, When I'm try to send email from other controller = all works perfectly Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: validation rules
Thank you for the answers. Could you show me any example please. On Jun 11, 2:02 pm, euromark wrote: > yeah > thats actually one of the downsites of cake's validation rule settings > at least in the default way > > using __construct() you can achieve more dynamically created rules > > On 11 Jun., 05:35, "Dr. Loboto" wrote: > > > Of course you get syntax error. Only constants can be used in class > > definition. > > > You can overload model constructor and setup $validate there. > > > On Jun 11, 8:22 am, Dmitry Shevchenko wrote: > > > > Hi > > > Did someone tried to create a array for the "inList" validation and > > > then use it? > > > for example > > > var $test = array('one_day', 'five_days','never'); > > > > var $validate = array( > > > 'ty_id' => array('numeric'), > > > 'date_arr' => array('allowed_data' => array( > > > 'rule' => array('inList', $test), > > > 'message' => 'Wrong data', > > > 'allowEmpty' => false) > > > ), > > > ); > > > > When I'm try to use this construction . I'm getting a syntax error > > > > Thanks Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
validation rules
Hi Did someone tried to create a array for the "inList" validation and then use it? for example var $test = array('one_day', 'five_days','never'); var $validate = array( 'ty_id' => array('numeric'), 'date_arr' => array('allowed_data' => array( 'rule' => array('inList', $test), 'message'=> 'Wrong data', 'allowEmpty' => false) ), ); When I'm try to use this construction . I'm getting a syntax error Thanks Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Bookmarkable AJAX URLs
Thank you for you advices, but I can't stop using ajax on my site, I have a chat window on my pages, so if page will reloaded - I have to relogin user to chat - this will overload chat server. I knew about SEO problems, but I think we could fix it by sitemap and robots.txt So I needed a solution, how to wrote correct route with using # , like- domain.com/#/controller/action/params I need to explaine route ignor first # Something simmilar to facebook urls - where most of all urls have a #!/ url Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Bookmarkable AJAX URLs
Hi! Thank you Bert Van den Brande for answer. I have added a js script for modify browser address string: echo "location.hash=\"$this->here\";"; What do you mean - I don't need to modify any Cake's urls? if I didn't modify it - I will get a very funny urls - like: domain.com/profiles/view/48229#/profiles/view/31460 to solve this problem I have create a url like: domain.com/#/controller/action/.. for that I have modified a ajax helper function link ($title, $link, $options = array(), $confirm = null, $escapeTitle = true) { $options = $this->_addOptions($options); return parent::link($title,"#".$link,$options,$confirm, $escapeTitle); } BUT how to write a correct route, to explain cake to ignore # and use all what goes after # in url. please help On 16 апр, 19:14, Bert Van den Brande wrote: > Afaik using # is the way to go. > > Changing any other aspect of the url besides what comes after the # will > result in a load of the changed url by the browser. > > You don't need Cake to change the url's, just some javascript code that you > execute every time the user navigates using your ajax links. > > On Fri, Apr 16, 2010 at 5:41 PM, Dmitry Shevchenko wrote: > > > > > Hi! > > I use ajax link (by ajax helper) in my current app almost everywhere. > > I > > now, when user navigate throw the site, URLs in the browser address > > line didn't changed. > > That's why user can't create bookmarks. > > Does anyone knew, how to push browser change address line, or some > > other workaround. > > > p.s. I knew one way - add "#" to each url. Browser will automatically > > add this parameter to address line. But seems that this is too ugly > > workaround. (And I don't know how to implement it by using Cake) > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.comFor > > more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Cake Ajax+prototype file upload
Hi! Does anyone found some component/helper which get ability to Ajax file upload? I have tried to use solution described here: http://bakery.cakephp.org/articles/view/comfortable-ajaxuploads-with-cakephp But seems that it didn't work now. Also, I have read http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-uploader, but it looks a too old solution. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Bookmarkable AJAX URLs
Hi! I use ajax link (by ajax helper) in my current app almost everywhere. I now, when user navigate throw the site, URLs in the browser address line didn't changed. That's why user can't create bookmarks. Does anyone knew, how to push browser change address line, or some other workaround. p.s. I knew one way - add "#" to each url. Browser will automatically add this parameter to address line. But seems that this is too ugly workaround. (And I don't know how to implement it by using Cake) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: SQL injection protect
Thank you for your help Sergei. It really helpfull. I use this validation in many controllers, thats why I wrote component for it. I have too much urls in my project, where last parameter is a digit - unsigned int. And I need to validate it and show error message to user if parameter is wrong. I don't know better way to validate it :( On Apr 14, 4:01 am, Sergei wrote: > Dmitry, > > don't think, look at the source :) > > updateAll is exactly the answer. Your validation routine seems too > heavy for one number. And you don't have to create a component to > validate some data manually. You can always validate in controller. > > On Apr 14, 12:15 am, Dmitry Shevchenko wrote: > > > Sergei > > I think updateAll didn't sanitize data > > -http://book.cakephp.org/view/75/Saving-Your-Data > > > or I'm wrong? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using "remove me" as the subject.
Re: SQL injection protect
Sergei I think updateAll didn't sanitize data - http://book.cakephp.org/view/75/Saving-Your-Data or I'm wrong? mayde it's better to set id and then save data //Update: id is set to a numerical value # $this->Recipe->id = 2; # $this->Recipe->save($this->data); but the questions is still open. Seems that solution -is create a new component and validate data manually. For example function checkIntUnsigned($var, $withZero = false) { //forse type set if (is_numeric($var)) settype($var, 'int'); else return false; //var_dump(is_int($var)); if (is_int($var) == true) { if ($withZero == false) { if ($var > 0 ) return true; else return false; } else // with_zero = true { if ($var >= 0) { // echo "ok >=0 "; return true; } } } return false; } Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using "remove me" as the subject.
Re: SQL injection protect
Thank you Sergei. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using "remove me" as the subject.
SQL injection protect
Hi everyone! As I read documentation Cake automatically clean user input and we can use save() and find() with aprameters without any worries. But, what if we need to use sometning like this $this->MyController->query("UPDATE photos SET profile_pic='1', status = 'public' WHERE id=".$id." AND profile_id=".$this->Session- >read('Profile.id')); where $id is taking from $this->data... Do we need to call saitize->clean() or mysql_real_escape_string() each time to clean param, or someone knew correct way to use this globally. Thanks Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using "remove me" as the subject.