Re: Getting Xdebug to work under CakePHP 1.2 and NetBeans 6.5

2009-07-20 Thread MarcS
have you (or anyone else) figured this out? On Jun 15, 2:26 am, kdubya wrote: > I have recently switched from a plain text development style to using > NetBeans 6.5. I figured I might like some of the niceties of a real > IDE (I have used them before) but my main motivation was to get > debuggin

ajax request after session expired - how to redirect to the front page?

2009-06-07 Thread MarcS
Hi everyone. I have a site that is farely heavy on AJAX. Sometimes it happens that the Session has expired and the user needs to log in again. Is there a way that I can detect that and send the surfer to the log in page instead of the login page loading inside the dom container? --~--~-~-

error logging in a shell application

2009-03-01 Thread MarcS
Hi everyone I'm trying to figure out how I can make cake log errors that occur in a console application to the error.log and debug.log files I can't seem to find a way to do that no matter what I set the debug level (Configure::write('debug',)) to. Can anyone help me? --~--~-~--~

Re: custom error pages -> how to make cake redirect to another page

2009-02-12 Thread MarcS
thanks that's just what I was looking for On Feb 12, 12:51 am, mscdex wrote: > On Feb 11, 9:35 pm, MarcS wrote: > > > Hello everyone, > > > I know that I can change the default cake error messages by changing > > the templates for them. > > Is there a way

custom error pages -> how to make cake redirect to another page

2009-02-11 Thread MarcS
Hello everyone, I know that I can change the default cake error messages by changing the templates for them. Is there a way so I can configure cake to redirect to another page when I specify the URL? --~--~-~--~~~---~--~~ You received this message because you are s

Re: Auth Issues - Session Comes And Goes

2009-02-04 Thread MarcS
I had the same problems I wish there was a way to make this work with security level = high but I didn't figure it out. It seems to be very random. But in general the problem seems to be having 2 requests very quickly after each other On Jan 26, 3:18 pm, Alfredo Quiroga-Villamil wrote: > I think

Problem when installing the bakery applicatoin

2008-12-05 Thread MarcS
Hi everyone, Has anyone here tried to install the bakery application? I'm currently trying to do so but I keep getting a redirect loop when loading the application. It keeps redirecting me to the login page. I have no idea how to fix this? Has anyone had the same problem? thanks --~--~-

Re: How to use MySql's CASE WHEN function with CakePhp

2008-10-15 Thread MarcS
#x27;even\' ELSE \'odd\' END)) AS > parity' >   ) > )); > > Works fine on my (almost latest) build [and has done for a while - > I've used this before] > > hth > grigri > > On Oct 15, 3:34 pm, MarcS <[EMAIL PROTECTED]> wrote: > >

How to use MySql's CASE WHEN function with CakePhp

2008-10-15 Thread MarcS
Hi everyone, I'm trying to figure out how I can use the CASE WHEN function with cakephp I'm trying to run the following query SELECT `type` , ( CASE WHEN `type` = 'type3' THEN 1 WHEN `type` = ''type4' THEN 2 WHEN `type` = ''type1' THEN 3 ELSE 4 END ) AS sort FROM `task_lines` AS `TaskLine` ORDE

How can I change the path of webroot/js and webroot/css?

2008-09-18 Thread MarcS
I've been trying to locate this in the cookbook but I couldn't find it. Is there a way to configure cake to change the default paths for the js and css directories inside the webroot dir? thanks, Marc --~--~-~--~~~---~--~~ You received this message because you are

Why is Model::data set to false after Model::save() ?

2008-09-06 Thread MarcS
Hi, I have trouble understanding why the Model::data array is being set to false after saving the model. Many times I need to save the model (for example because I need the insert Id to work with a associated model) but after that I still need to make changes the Model's data. I find myself doin

Re: bug with invalidating HABTM field

2008-09-06 Thread MarcS
I'm having the same problem right now. Does anyone have a solution to this? On 12 Jul, 09:42, Dia <[EMAIL PROTECTED]> wrote: > hi all, > > I use 1.2 RC2 > I have 2 models (model1 and model2) linked by HABTM > > if I write in model1 / beforeSave() : if (...) { $this->invalidate('Model2', > 'some

Is there a way I can have find('all') return an array that is indexed by the value of one of the fields?

2008-09-01 Thread MarcS
Hi, Currently find('all') will return an array that is indexed by integers in the order of how the records were retrieved. Is there any way that I can make find() return an array that is, for example, indexed by the primary key of the data that is being retrieved? I need to access that like this

Re: please help me with the set class

2008-08-31 Thread MarcS
d', '{n}', '{n}.Person.group_id'); > > Note that the people will be indexed by their ids, but that shouldn't > be a problem. > > hth > grigri > > On Aug 25, 3:14 pm, MarcS <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I have the fol

is there a way to validate that a habtm has at least one association?

2008-08-27 Thread MarcS
Hi, I have 2 models, Model1 and Model2. Is there a way that each Model1 is always associated with at least one Model2? I think I remember seeing this somewhere but I can't find it any more. thanks for your help --~--~-~--~~~---~--~~ You received this message beca

help with 'updated' and 'created' fields: Do I need to manually unset these fields in the data array?

2008-08-27 Thread MarcS
Hi, I just noticed that my 'updated' field won't update when I update data. I tried around for a while and then noticed that it won't update when the 'update' field is included in the Model's data array. But when I load data using Model::read(null,$id) the date fields are obviously always include

please help me with the set class

2008-08-25 Thread MarcS
Hi, I have the following data 0: array = Person: array = id: long = 1 name: string = "n1" group_id: long = 1 1: array = Person: array = id: long = 2 name: string = "n2" group_id: long = 1 2: array = Person: array = id: long = 3 na

cake core causes error when trying to open cache file

2008-07-14 Thread MarcS
I keep seeing the following error in my error.log file 2008-07-14 15:01:22 Warning: Warning (2): fopen(/home/path/tmp/cache/ persistent/cake_core_default_en_us) [function.fopen]: failed to open stream: No such file or directory in >[CORE/cake/libs/file.php, line 146] and in debug.log 2008-07-14

problem with conditions in HABTM find queries

2008-07-10 Thread MarcS
I'm trying to figure out how to build a query with a condition that effects the other Model in a HABTM relationship. To clarify: Let's say we have to models: Model1 and Model2 which are defined as follows var $hasAndBelongsToMany = array( 'Model2' => array('classNam

How to find associated records in a HABTM relationship?

2008-07-04 Thread MarcS
Hi everyone, I have a model setup like the following User -> habtm Group Group -> habtm User How can I find the groups a user belongs to? I tried something like $this->User->Group->find('all',array('conditions' => array('User.id' => $user_id))); but that doesn't work. I have no idea what to tr

-> how can I do that in Cake?

2008-06-05 Thread MarcS
Hi, I'm trying to create a group of checkboxes to pass some options like this I can't seem to find a way to do this in cake. The only thing that is getting close is doing this $form->input('foo.0',array('type'=>'checkbox)) $form->input('foo.1',array('type'=>'checkbox)) $form->input('foo.2',ar

Re: How can I get the name of the view that is being rendered in my layout?

2008-06-03 Thread MarcS
thanks Tarique, I knew about being able to get the controller name. I was hoping there would be something similar for the view name On Jun 3, 11:30 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 3, 2008 at 3:53 PM, MarcS <[EMAIL PROTECTED]> wrote: >

How can I get the name of the view that is being rendered in my layout?

2008-06-03 Thread MarcS
Hi, Is it possible to get the name of the view that is currently being rendered from inside the layout? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@g

is there a way to know if I'm updating or creating a record inside beforeSave() ?

2008-05-15 Thread MarcS
I'm wondering if there is any way that I can know if I'm updating or deleting when I'm inside the beforeSave function afterSave has the $created parameter. But beforeSave doesn't have this. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: strange counter cache behavior - is this supposed to be like that?

2008-05-14 Thread MarcS
endent_count What does it need the join for then? On May 14, 9:10 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Wed, May 14, 2008 at 4:04 PM, MarcS <[EMAIL PROTECTED]> wrote: > > > UPDATE foos as foo LEFT JOIN 'bars' as 'bar' ON ('fo

strange counter cache behavior - is this supposed to be like that?

2008-05-14 Thread MarcS
I came accross an issue with the built in counter cache. My cake version is 1.2.0.6311 The query generated by cake to update the counter uses joins. Suppose I have a model 'foo' which which has many 'dependent 'foo' itself belongs to 'bar' which has many 'foo' The query to update the counter cac

Re: include CSS and Javascript into layout 'on demand'

2008-05-12 Thread MarcS
r $customLayouts = array('admin_ajaxDeleteImage' => 'empty', > 'index' => 'empty', > 'admin_ajaxGetVideosFromArtist' => > 'empty'); >

include CSS and Javascript into layout 'on demand'

2008-05-12 Thread MarcS
Is it possible to include CSS and Javascript into a layout based on what the specific view requires? I would like to use one layout for all my views but there are some javascript libraries that are onl required for very few actions. I remember reading that this is possible a while back but I can'

Re: possible bug? validation successful even though required fields are not empty

2008-04-29 Thread MarcS
orm field for a model that had a required validation and it > wouldn't save. I changed required=True to required=False and it saved > just fine. > > I think the problem MarcS is having is simply a problem in his > validation routine. Can you post some code? --~--~-~--~

Re: possible bug? validation successful even though required fields are not empty

2008-04-29 Thread MarcS
ong for validation > > On Apr 29, 1:55 pm, MarcS <[EMAIL PROTECTED]> wrote: > > > yeah I guess I'll have to do that. > > But it doesn't make much sense to me that cake will save records even > > though validation rules say that the field shouldn't be em

Re: possible bug? validation successful even though required fields are not empty

2008-04-29 Thread MarcS
1.2; but I could be wrong; > try passing array('a'=>'food', 'b'=>'') > > On Apr 29, 1:50 pm, MarcS <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm wondering whether the following is desired behaviour or it is a > > bug.

possible bug? validation successful even though required fields are not empty

2008-04-29 Thread MarcS
Hi, I'm wondering whether the following is desired behaviour or it is a bug. let's say a table has 2 columns a and b. B is required. when I do $this->Model->save('a' => 'foo'); the record validates even though a is required. It seems like fields that are not included in the data passed to save()

how do I stop the SQL queries from display in AJAX calls?

2008-04-29 Thread MarcS
Hi, How can I stop the SQL queries from being displayed at the bottom of the page in AJAX calls. Up until now I've always used Configure::write('debug', '0'); for ajax cals.This, however, make cake not show any error messages which also sucks. I only want to stop the SQL queries from being displa

Re: Problem with the XML class

2008-04-28 Thread MarcS
ccessor method is in > order. Open an enhancement ticket and I'll consider it. > > On Apr 28, 8:06 am, MarcS <[EMAIL PROTECTED]> wrote: > > > Hi everyone. > > > I recently upgraded to the most recent version of cake and as expected > > a few things didn&#x

Problem with the XML class

2008-04-28 Thread MarcS
Hi everyone. I recently upgraded to the most recent version of cake and as expected a few things didn't work. There is one thing, however, which I really can't work out. A part of my application is parsing some XML data which looks pretty much like this 82

Re: Routing to RSS feed

2008-04-24 Thread MarcS
t;[EMAIL PROTECTED]> wrote: > MarcS wrote: > > try > > > Router::connect('/rss',array('controller'=>'main','action'=>'index', > > 'ext' => 'rss)); > > > I guess this ought to work > > This do

Re: Routing to RSS feed

2008-04-24 Thread MarcS
try Router::connect('/rss',array('controller'=>'main','action'=>'index', 'ext' => 'rss)); I guess this ought to work On Apr 24, 3:21 pm, seb <[EMAIL PROTECTED]> wrote: > Hi all bakers > > I succeded in generating RSS feeds following the marvelous tutorial from > Jiri Johannes Kupiainen found o

Re: organizing controlleres into subdirectories

2008-04-09 Thread MarcS
thanks, that's what I'm looking for. I'm not all that worried about the actual url. I just wanna organize my code a bit better. Is there a way to put view templates into directories as well? I tried just moving it to subdirectories but that gives me an error. I suppose I could change the viewpath

Re: organizing controlleres into subdirectories

2008-04-09 Thread MarcS
thank you for this very kind reply. I would have never thought about trying that myself On Apr 9, 12:11 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > Yes, but you will have to learn to use google for this. > > On Wed, Apr 9, 2008 at 5:00 AM, MarcS <[EMAIL

organizing controlleres into subdirectories

2008-04-09 Thread MarcS
Hi, I'm wondering if it is is somehow possible to put controllers into subdirectories. sort of like www.cakeapp.com/subdirectory/controller/action www.cakeapp.com/subdirectory2/controller/action and have the same for the views. It is not really essential but in large apps with lots of controller

Re: model executing INSERT instead of UPDATE - why?

2008-04-01 Thread MarcS
I figured $this->id would be set when calling read thanks for the answer. On Apr 1, 10:44 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Tue, Apr 1, 2008 at 5:33 PM, MarcS <[EMAIL PROTECTED]> wrote: > > >  Hi, > > >  Sorry I'm sti

model executing INSERT instead of UPDATE - why?

2008-04-01 Thread MarcS
Hi, Sorry I'm still being fairly new to cake and I have the follwing problem: I'm mass updating some data and use the following code for that $this->Model->findByName("name"); $this->Model->save($data); when I do that cake is inserting a new record with $data instead of updating the existing on

- is that possible?

2008-03-31 Thread MarcS
Hi, before I started using CakePHP, I frequently used something like which would then $_POST [array] => Array ( [0] => 1 [1] => 2 [2] => 3 ) Is there any way I can do this with cake using the $form->input helper or will have always have

Re: how to validate fields that are not part of a model?

2008-03-31 Thread MarcS
p://groups.google.com/group/cake-php/browse_thread/thread/3a028fb7... > > On Mar 29, 10:56 am, MarcS <[EMAIL PROTECTED]> wrote: > > > Hi, > > > in my applications users should be able to import CSV data. Obviously > > there is not corresponding field in any datab

how to validate fields that are not part of a model?

2008-03-29 Thread MarcS
Hi, in my applications users should be able to import CSV data. Obviously there is not corresponding field in any database table for this textarea. I wanna validate the CSV input and display the errors. I tried $form->input('fieldname',array('error'=>'some error message'); but that doesn't work s

parseextensions problem -> wrong content type

2008-03-26 Thread MarcS
Hi, I have parseExtensions enabled in my routers.php file I'm requesting a URL like this: controller/action.js and I expect the response content type to be javascript. However, cake sets the content type to text/html and wraps the javascript output in tags. I have no idea where these are commin

ajax question: how can I make the controller decide what element to update?

2008-03-25 Thread MarcS
Hi, usually I would use a form like this one echo $ajax->form('edit', 'post', array( 'model'=> 'model', 'url' => array( 'action' => 'edit'), 'update' => 'element_to_update', )); but what if, depending on the success of the edit operation, I want to update another div?