bug with invalidating HABTM field

2008-07-12 Thread Dia
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 text'); return false; } when the form is displayed, I juste see the first letter of the error message for me, the error seems to come fro

Re: Validation of HABTM linked models datas

2008-07-10 Thread Dia
I pasted my code here (only the interesting points): http://bin.cakephp.org/view/2137985698 if someone could say me what I'm doing wrong, please... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To

Re: Validation of HABTM linked models datas

2008-07-09 Thread Dia
up, anyone knows ? On 9 juil, 08:42, Dia <[EMAIL PROTECTED]> wrote: > hi all, > > here is my problem: > I have two models linked by a HABTM relation (Game and GameGenre) > I want each row of my main model (Game) to be linked to at least one > row of the other model (

Validation of HABTM linked models datas

2008-07-08 Thread Dia
hi all, here is my problem: I have two models linked by a HABTM relation (Game and GameGenre) I want each row of my main model (Game) to be linked to at least one row of the other model (Game have 1..n GameGenre) how can I check this with form validation rules (multi-select field representing Gam

Re: model validation rules order ?

2008-07-07 Thread Dia
7;message'       => 'Required field.', >                                  'last' => true >                          ), >                          array( >                                  'rule'          => array('minLength', > 3), >                                  

Re: model validation rules order ?

2008-07-06 Thread Dia
PS: using 1.2 RC2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For mor

model validation rules order ?

2008-07-06 Thread Dia
Hi I noticed a strange behaviour and wanted to know if it's there's a order on executing validation rules the example : case 1 : var $validate = array( 'word' => array( array( 'required' => true,

Re: modifying datas in beforeValidate (ya, again...)

2008-02-14 Thread Dia
ler::$data > (it gets passed to view, then to helpers). So pull your changes back > into Controller::$data['Model']. > > HTH, > - Dardo Sordi. > > On Thu, Feb 14, 2008 at 10:16 AM, Dia <[EMAIL PROTECTED]> wrote: > > > so there's no way to modify d

Re: modifying datas in beforeValidate (ya, again...)

2008-02-14 Thread Dia
so there's no way to modify data in model and then see this change in the controller ? On Feb 12, 11:07 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > put this in your controller: > > $this->data = $modifiedData; > > On Feb 12, 2008 7:17 PM, Dia

modifying datas in beforeValidate (ya, again...)

2008-02-12 Thread Dia
hi I know this question was already asked a few times and I read some topics about it on this g.group but didn't find the answer I'm looking for (found "put it in controller", for example) so, how can I change the value of an attribute of a model in beforeValidate and then see this change on the

Re: Error when saving HABTM relations datas

2008-02-01 Thread Dia
it's ok, the bug has already been signaled here : https://trac.cakephp.org/ticket/3814 the solution is given there --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email

Error when saving HABTM relations datas

2008-02-01 Thread Dia
hi I'm using 1.2 beta I have 3 models: game, game_background and game_genre game habtm game_background and game habtm game_genre (see the models code below) to explain my problem, I'll take an example, will be easier result of pr($this->data) in Game model / beforeSave(): Array ( [Game] =>

Re: question about *po files and i18n

2008-01-24 Thread Dia
thanks a lot --~--~-~--~~~---~--~~ 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 op

Re: question about *po files and i18n

2008-01-24 Thread Dia
up no one knows ? --~--~-~--~~~---~--~~ 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 m

Re: help, upgrade from alpha to beta: paginator problem

2008-01-24 Thread Dia
I tried using array but not this (easier) way... ashamed :/ it works, thanks for helping --~--~-~--~~~---~--~~ 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.co

help, upgrade from alpha to beta: paginator problem

2008-01-24 Thread Dia
before, this code worked perfectly : $paginator->prev('<< Page précédente', array('url' => $annee), null, array('class'=>'disabled')) now, I have this error message: array_merge(): Argument #2 is not an array [CORE\cake\libs\view\helpers \paginator.php, line 306] the problem is on 'url' => $ann

question about *po files and i18n

2008-01-22 Thread Dia
hi my question is simple: is it possible use expression like %s in msgid and msgstr in *po files? tried but failed tanks in advance note: manual says encode *po files in ISO-... but in my case I have to encode *po files in UTF-8 in ISO-..., special chars are not displayed correctly my HTML code

simple file uploading (1.2 alpha)

2007-11-14 Thread Dia
hi, I need to upload files into the "files" dir in webroot I saw a few scripts but they are often too complicated for my needs : using a Model or saving files into DB in my case, files are not related with any model is there a very simple way to code it ? should I use the basic file upload php s

Re: Take into account of "jet lag" for "created" when saving in DB

2007-10-24 Thread Dia
I agree, modifying the core should be reserved to very specific situations (did it for a project) I took the easiest way (I think) to fix it :add ini_set('date.timezone','Europe/Paris'); in a configuration file ok, time is not stored in GMT, not the cleanest solution, I know but my guestbook wil

Re: Take into account of "jet lag" for "created" when saving in DB

2007-10-24 Thread Dia
thanks for your answers @ Erich Jansen ok, I'll try it @ Beowolf yeah it's a good idea, I agree with your point of view but the problem is still the same : as the "created" field is automatically filled in by CakePHP, how can I indicate it to use GMT ? --~--~-~--~~~--

Take into account of "jet lag" for "created" when saving in DB

2007-10-24 Thread Dia
hi my website (+ guestbook) is on a west-coast USA server (DreamHost) and I'm French when someone posts a new comment on the guestbook, the "created" field takes the west-coast USA time to resolve this problem, I could just add 9h in a "beforeFilter" method, before diplaying the datas but I would

Ajax form validation with 1.2

2007-09-12 Thread Dia
hi I'm looking for an example / tutorial showing how to validate forms with Ajax in CakePHP 1.2 the only thing I found is : http://bin.cakephp.org/view/242085627 does anyone has something else ? thanks --~--~-~--~~~---~--~~ You received this message because yo

Re: mod_rewrite problem

2007-07-07 Thread Dia
ok, dun take care it's now ok dunno exactly why just downloaded cake again and it worked --~--~-~--~~~---~--~~ 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@googlegroup

mod_rewrite problem

2007-07-07 Thread Dia
hi I use Ubuntu 7.04 + Apache 2 when I install CakePHP, the CSS is not applied I installed mod_rewrite, it is now listed in the phpinfo page then I put AllowOverride to "all" for finally I restarted Apache but nothing to do... 1 hour I read tutorials on Internet and find nothing help please

javascript helper, "defer" problem

2007-05-30 Thread Dia
hi I didn't find if it's possible (I use cake 1.1) to use a second argument with JavascriptHelper::link() I wanted to use this to specify "defer", like this : the only way I found to emulate that is to transform my JS file : // code into window.onload = function() { // code } and to call this

Re: problem when i include javascript files

2007-04-06 Thread Dia
1st, sorry for mistakes I made in my last posts yesterday, was tired cause of work :p 2nd, I'm learning CakePHP for a week, can't yet imagine an action using 2 components (1 included in AppController and 1 in ThingsController) to be sure of what I'm testing but if you have the answer, I'm interr

Re: problem when i include javascript files

2007-04-05 Thread Dia
sorry, $controller[] = 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 PROTECT

Re: problem when i include javascript files

2007-04-05 Thread Dia
you mean if I have var $helpers = array('Html', 'Form', 'Javascript'); in app/app_controller.php and var $helper= array('Text'); in xxxsController only Text helper will be available in xxxsController ? (sorry for just "reformulation-question" but sometimes have troubles with English :p) is it

Re: problem when i include javascript files

2007-04-05 Thread Dia
is it possible to do : // AppController : $components = array(a, b, c); // ThingsController $components[] = c; ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email

Re: problem when i include javascript files

2007-04-05 Thread Dia
I think you should add var $helpers = array('Javascript'); in the controller corresponding to your view --~--~-~--~~~---~--~~ 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

Re: Validation: beforeSave and setting fields

2007-04-05 Thread Dia
I had the same problem : wanted to modify datas in beforeValidates and see these changes in the form in validation failed the topic I opened : http://groups.google.com/group/cake-php/browse_thread/thread/7d9a099a72d079c5/599bacad094e8d3c?lnk=gst&q=lost&rnum=1#599bacad094e8d3c this is my explaina

Re: Struggling greatly with validation

2007-04-05 Thread Dia
in your controller : ... $this->MyModel->set($this->data); if ($this->MyModel->validates()) { ... or, if using CakePHP 1.2.x.x : if ($this->MyModel->create($this->data) and $this->MyModel- >validates()) the array shouldn't be empty any more in beforeValidate function --~--~-~--~~-

Re: lost in validation

2007-04-02 Thread Dia
may be question would be more clear like this : how do you transmit $data from controller to model, then modify these datas with, for example, "sanitize->sql", then send back datas to controller ? is it possible ? is it a bad approach of the way to validate ?... any suggestion :) --~--~---

Re: lost in validation

2007-04-02 Thread Dia
up --~--~-~--~~~---~--~~ 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, v

Re: lost in validation

2007-03-30 Thread Dia
hi and thanx for paying attention to my problem this piece of code is for user registration it's just a little program to begin using CakePHP note : I use a nightly build 1.1.x.x of a few days ago I call validates() in an if condition if it's ok, I check if this username is already used then, if

Re: lost in validation

2007-03-30 Thread Dia
up to pass datas from controller to model I now do like that : // controller $this->User->data = $this->data; if ($this->User->validates()) { ... } // model function beforeValidate() { // can use $this->data } in beforeValidate I use a Sanitize object to clean datas but it changes model dat

lost in validation

2007-03-29 Thread Dia
hi all I've just began in CakePHP and I'm a bit lost in validation datas process I was doing like this : // model $validate = array(...); // controller if (!empty($this->data)) { if ($this->ModelName->validates($this->data)) { ... if ($this->User->save($this->data)) { ... } ...