Validation errors

2010-05-22 Thread Ed Propsner
I have a form that is not displaying validation errors like it should be. The errors are there in the validationErrors array so the model is validating, I'm sure of that. I've been reading through a few other threads on the same subject but none of the causes seem to apply. I have the controller

Re: TimeHelper in cake, french language ?

2010-05-22 Thread Andrei Mita
Are you kidding me? Far from professional? I believe you didn't understood what John suggested. You don't need to change the helper file but rather to create a pot file. Here, this might help you: http://book.cakephp.org/view/162/Internationalizing-Your-Application On Fri, May 21, 2010 at

Re: No validation after deploy

2010-05-22 Thread Matteo
Hi all, solved. I'm posting that hoping it could be of some help. The cause was the name of my model file. I used 'Latest.php' instead of 'latest.php'. Because of the first capital letter, in the host server validation didn't work. My machine and the which one of the remote server are BOTH .nix

Re: How can I consolidate conditions that I will use for every find?

2010-05-22 Thread Andrei Mita
I know you can define in the model what fields should be retrieved when making a find. Maybe you can also add conditions. On Sat, May 22, 2010 at 6:24 AM, shantamg jason.galu...@gmail.com wrote: Every model in my app has a foreign key called schedule_id. I need to narrow my finds so that they

Re: Validate REST input

2010-05-22 Thread Master Ram...!
you can user cakephp validation here the example form cakephp validation. in your model you can user this code. var $validate = array( 'field_name' = array( 'rule' = array( 'minLength',

Re: Validation errors

2010-05-22 Thread Master Ram...!
you can user cakephp validation here the example form cakephp validation. in your model you can user this code. var $validate = array( 'field_name' = array( 'rule' = array( 'minLength',

Re: Validation errors

2010-05-22 Thread Matteo
Hi, you can check my post here and see if it - maybe - fits your needs. Please, see last reply. http://groups.google.com/group/cake-php/browse_thread/thread/2f6a264df0492006 Matteo On May 22, 8:50 am, Ed Propsner crotchf...@gmail.com wrote: I have a form that is not displaying validation

Deleting record

2010-05-22 Thread Ambika Kulkarni
Hi all, This is my model groupstore class GroupStore extends AppModel { var $name = 'GroupStore'; var $primaryKey = 'group_store_id'; var $belongsTo = array( 'Group' = array( 'className' = 'Group',

Re: How can I consolidate conditions that I will use for every find?

2010-05-22 Thread WebbedIT
$this-Person-contain('Hobby', 'Job'); I've never seen anyone set containable options like above, I thought they had to be within the find options array $this-Person-find('first', array(contain=array('Hobby', 'Job'))); I don't see how your conditions array can be set the same for every model

ideas for handling user added images

2010-05-22 Thread WebbedIT
William, please start a new thread with your problem rather than changing the subject of an existing thread. 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

Re: Validation errors

2010-05-22 Thread Ed Propsner
@Master Ram I appreciate the advice but doesn't this seem a bit long winded for something that normally requires no code at all besides the validation rules in the model? if ($form-isFieldError('Model_name.Field_name')){ e($form-error('Model_name.Field_name',

Re: Pagination ordered by a field that is not in the table

2010-05-22 Thread WebbedIT
If you are regularly sorting fields by aggregate values then it may be a lot more efficient to add those as real fields into the database which are calculated afterSave and afterDelete as will save a lot of extra database work in the long run. HTH Paul. Check out the new CakePHP Questions site

Re: cakephp on wamp

2010-05-22 Thread WebbedIT
Google search: http://www.google.co.uk/search?client=firefox-arls=org.mozilla%3Aen-GB%3Aofficialchannel=shl=ensource=hpq=cakephp+bake+on+wampmeta=btnG=Google+Search Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this

Re: Multi-client application

2010-05-22 Thread WebbedIT
Sounds like you're heading down an unmaintable path there Each organisation can have it's own data, but for this to be served from one app that data must be defined within a common schema and feature/function set. If this is the case then it should be stored in a single relational database. I'm

Re: Multi-client application

2010-05-22 Thread rikdc
Hi, The configuration that you suggest is not as unmaintainable as Paul might have been implying - but he does suggest the simplest and most logical approach. Some of the systems I've developed saw me at this cross road, and there was always the concerned with Security issues of cross-company

Re: Unitesting with Simpletest

2010-05-22 Thread Aung
Thank for your advice and suggestions. On May 22, 1:40 am, LunarDraco mdc...@gmail.com wrote: Exactly what are you trying to test? It looks like your trying to test the http POST and response protocols, I'm pretty sure Apache and other web server engines have fully tested those. First make

Re: How can I consolidate conditions that I will use for every find?

2010-05-22 Thread shantamg
@Andrel: I'd love to be able to set the conditions in the model, but the model can't know what's in the session! @Paul: $this-Person-contain('Hobby', 'Job'); I've never seen anyone set containable options like above, I thought they had to be within the find options array

Re: Validation errors

2010-05-22 Thread Matteo
Hi, you could try this: http://cakeqs.org/eng/questions/view/validation_summary there are many posts about validation under cakephp questions, I would check there too if you already didn't. Then lastly I would try changing model name and check if validation behaves correctly. Hope it helps.

Re: Validation errors

2010-05-22 Thread Ed Propsner
@Matteo, I've looked through all the materials and I did try a few things but it still don't work. I'm actually going to trash the model and everything associated with it and start over and see what I get then. It's an extreme solution but I've tried everything I could think of to no avail. It

Re: How can I consolidate conditions that I will use for every find?

2010-05-22 Thread Andy Dirnberger
This is just a rough idea and will need to be completed (and probably improved some), but hopefully it can get you started. In AppModel: var $schedule_id; function find($conditions = null, $fields = array(), $order = null, $recursive = null) { if (is_array($conditions)) { if

Re: Validation errors

2010-05-22 Thread Ed Propsner
I tried to rename the model and everything associated with it and that didn't work. I scrapped the model, controller, views, table ... everything. I started all over again with it (I let the console create everything) and still have the same problem. Everything happens (or don't happen) for a

Re: Validation errors

2010-05-22 Thread John Andersen
Could you post the view code, I haven't seen your presentation of that in the thread! Enjoy, John On May 22, 7:24 pm, Ed Propsner crotchf...@gmail.com wrote: I tried to rename the model and everything associated with it and that didn't work. I scrapped the model, controller, views, table

Re: Validation errors

2010-05-22 Thread Ed Propsner
There's not much too it. Just a form and a single field. [view] echo $form-create('ProfileAttribute', array('controller' = 'profile-attributes', 'action' = 'add')) .$form-select('ProfileAttribute.gender', array( 'M' = 'Male', 'F' = 'Female' ), null, array( 'empty' = '---' ) )

Re: How can I consolidate conditions that I will use for every find?

2010-05-22 Thread Jamie
On May 22, 7:07 am, shantamg jason.galu...@gmail.com wrote: @Andrel: I'd love to be able to set the conditions in the model, but the model can't know what's in the session! It can, you just need to load the Session object. Nothing wrong with that (in my opinion)... App::import('Core',

Re: Validation errors

2010-05-22 Thread John Andersen
There are som inconsistencies in your code! In the view you name the model ProfileAttribute but in the controller you use ProfileAttrib, which is also what you named the model. Could that be the reason? John On May 22, 7:34 pm, Ed Propsner crotchf...@gmail.com wrote: There's not much too

Re: Validation errors

2010-05-22 Thread Ed Propsner
@john, Sorry about that. I was grasping at straws and scrapped everything and started over since my original post. The names are consistent across MVC. It now uses ProfileAttribute - Ed On Sat, May 22, 2010 at 1:35 PM, John Andersen j.andersen...@gmail.comwrote: There are som inconsistencies

Re: Validation errors

2010-05-22 Thread John Andersen
Ok :) Have you tried to use the method described by Master Ram, just so it can be confirmed that the validation errors do get to the form helper? Enjoy, John On May 22, 8:39 pm, Ed Propsner crotchf...@gmail.com wrote: @john, Sorry about that. I was grasping at straws and scrapped everything

Re: Validation errors

2010-05-22 Thread Ed Propsner
Yup, I did and there was no problems with it. I think I'm to the point where I'm going to kick the entire problem to the curb. I manually pulled the errors from $this-validationErrors array and displayed them that way. I'll be starting another model, controller, etc. for another form shortly and

Re: Validation errors

2010-05-22 Thread Ed Propsner
Now I'm really stumped. The new form I just created is having the same problem with validation errors. What am I overlooking here? On Sat, May 22, 2010 at 1:54 PM, Ed Propsner crotchf...@gmail.com wrote: Yup, I did and there was no problems with it. I think I'm to the point where I'm going to

Re: Multi-client application

2010-05-22 Thread Heidi Grab
Hi there, thanks Rick and Paul for your suggestions. There are some reasons why I think putting all clients in one db setup is a bad idea: - legal issues; for instance, one of my clients is from Poland. I am obliged by Polish law to save data from this company on a polish server, I would not be

Action, called by an Ajax request, running twice.

2010-05-22 Thread Felipe Carballo
Hello guys! I'm having a problem using jQuery UI and Ajax Helper, with Prototype. My form is opened in a dialog box using jQuery UI. When I send the form, my action is executed twice. If I remove the library jQuery UI, the action is performed correctly (once). Does anyone know how I can fix this

User Login with Auth but check of two possible Usernames

2010-05-22 Thread Jörg
Hello, i'am working at a relaunch of a website where the user has the possibility to logged in with a Nickname or Email Adress. I think that the Auth Component is the right was for authentification but i had the problem that i can only map username to email or nickname. The other point is that old

Re: How can I consolidate conditions that I will use for every find?

2010-05-22 Thread shantamg
Thanks for all of the ideas. Here's what I ended up doing, which works great and does not break MVC :) In the AppController: function beforeFilter() { // put the latest published schedule into the session if (!$this-Session-check('Schedule')) { $schedule =

Array Set:: Question

2010-05-22 Thread bradmaxs
I have this array: [1] = Array ( [User] = Array ( [id] = 4 [username] = xxx [password] = xxx [first_name] = xxx [last_name] = xxx

Re: Validation errors

2010-05-22 Thread Filipe Teles Rodrigues
Have you done these models with bake? If not, you could bake a model and see how it makes the forms, views, validations, etc. Maybe it helps. 2010/5/22 Ed Propsner crotchf...@gmail.com Now I'm really stumped. The new form I just created is having the same problem with validation errors. What

Re: Validation errors

2010-05-22 Thread Ed Propsner
The models were all baked originally but edited as I went along. One of the tests was with a freshly baked model and controller but the view was not. The view in that case only consisted of a form, one field, and a submit button ... it still didn't work. I'm not quite sure what got changed or

Re: Validation errors

2010-05-22 Thread Filipe Teles Rodrigues
This is strange. Put here the output of pr($this-data) before the validation. 2010/5/23 Ed Propsner crotchf...@gmail.com The models were all baked originally but edited as I went along. One of the tests was with a freshly baked model and controller but the view was not. The view in that case

Re: Validation errors

2010-05-22 Thread Ed Propsner
It returns exactly what I would expect it to: Array ( [ProfileAttribute] = Array ( [gender] = Male ) ) Everything with the data seems to be fine, the model is even validating as expected. The $this-validateErrors array is loaded with the error messages, they are just not displaying. I'm