PHP Fatal error: Call to undefined method Validation::getinstance()

2008-12-18 Thread Juan Luis Baptiste
Hi, I'm trying to save data to a model from a console shell, very simple: if (!empty($user)) { $user['ip_address'] = $ip; $this->Userr->save($user); } But i't throwing this error: PHP Fatal error: Call to undefined method Validation::getinstance() in /var/www/html/cake/cake/l

Re: Polymorphic behavior troubles

2008-12-18 Thread brian
Spoke too soon. It works a charm for logging in but I'm seeing other problems elsewhere. It seems that Containable & Polymorphic aren't playing well together. Basically, I have a User model and several other models which are types of users, eg. Professional, Organisation, etc. So, I have another

Re: Very slow response times with CakePHP

2008-12-18 Thread Kappa
Hi Jon i didn't checked if cache is actually being written.. if it doesn't happens what could be the problem? As far as the deployment, i know that a MBP doing nothing else is a perfect server.. but in my opinion its 500 ms are still too much. I have switched to cakephp after almost 1 year passed

Re: Using a model without a table

2008-12-18 Thread Kappa
Have you tried to reset the cache? Sometimes i have the same problem, and i solve it deleting the cache in /app/tmp/cache bye, Andrea On Dec 18, 6:55 pm, George wrote: > Hello. > > I'm pretty new to cake and am working on creating a reporting intranet > application. Basically I aggregate a b

Re: Validation with CakePHP/ExtJS

2008-12-18 Thread bingo
I have written two custom function loadError and loadData to load validation errors and form data, respectively. The trick I use is to set name and id of a form field to data [ModelName][fieldName] ..loadError and loadData than automatically populate validation error and form data.. checkout mor

Re: Inflector::singularize converts "Is" to "I"

2008-12-18 Thread bingo
I am trying to build an ontology editorand there is a form that has three fields subject --> predicate --> object.. For instance... CakePHP ---> is --> PHP Framework to keep all the terms consistent...I am encoding them using this custom function function($inString){ return Inflect

Re: Inflector::singularize converts "Is" to "I"

2008-12-18 Thread Adam Royle
Well, "Is" is not actually a plural... so... what behaviour would you expect? Maybe some context of where you are using this would be beneficial. Cheers, Adam On Dec 19, 12:45 pm, bingo wrote: > hi bakers, > > I just stumbled across a weird problem and not sure whether its a bug > in my code o

Release: CakePHP RC4 ...Close

2008-12-18 Thread Nate
CakePHP 1.2 is almost ready... We have all been waiting a long time for 1.2 stable. Today we are happy to announce that we are one step closer to that goal. We are happy to announce the release of CakePHP 1.2 RC4[1]. CakePHP 1.2 RC4 has received more test coverage and over 300 commits. Please re

Re: Controlling automatic weight increment.

2008-12-18 Thread Colin
On Dec 19, 7:01 am, AD7six wrote: > On Dec 18, 10:55 pm, Colin wrote: > > > > > Thanks for your reply Mark. > > > The logic in my app is working fine, the issue I have is that when I > > insert a row into my table table1_table2 all the weights get adjusted. > > eg: > > > table1_id       table2

Re: How to pass data to javascript from cake's controller?

2008-12-18 Thread bingo
a simpler approach, might be to use RequestHandler and ParseException. read more about this approach here http://tinyurl.com/3m9azy regards On Dec 18, 6:12 pm, Penfold wrote: > This might do what your after > > http://debuggable.com/posts/passing-controller-variables-to-your-java... > > On 17

Inflector::singularize converts "Is" to "I"

2008-12-18 Thread bingo
hi bakers, I just stumbled across a weird problem and not sure whether its a bug in my code or Core library. I am using Inflector::Singularize to convert tags into singular form. However, during my test, I found singularize function converts "Is" to "I", which seems wrong. simply try this debug

Re: % in url params

2008-12-18 Thread brian
On Thu, Dec 18, 2008 at 4:45 AM, fito wrote: > > Hi friends. > > I've been using cake for some months, but it was today the first time > I tried to invoke a controller method with a % character in the url. > Something like this: > > $html->link('Example', '/controller/method?width=90%') > A serv

Re: Controlling automatic weight increment.

2008-12-18 Thread Colin
On Dec 19, 11:04 am, Colin wrote: > On Dec 19, 7:01 am, AD7six wrote: > > > > > On Dec 18, 10:55 pm, Colin wrote: > > > > Thanks for your reply Mark. > > > > The logic in my app is working fine, the issue I have is that when I > > > insert a row into my table table1_table2 all the weights get

Re: Controlling automatic weight increment.

2008-12-18 Thread Colin
On Dec 19, 7:01 am, AD7six wrote: > On Dec 18, 10:55 pm, Colin wrote: > > > > > Thanks for your reply Mark. > > > The logic in my app is working fine, the issue I have is that when I > > insert a row into my table table1_table2 all the weights get adjusted. > > eg: > > > table1_id       table2_i

Re: Polymorphic behavior troubles

2008-12-18 Thread brian
Bingo! Thanks so much for responding, Andy. It was fortuitous that I came across Polymorphic yesterday because I was questioning my db schema for this project. The site originally used a "user_type" table to differentiate but it's turned into a nightmare, with more changes on the horizon. In movin

Re: Routing and Pagination Issue

2008-12-18 Thread mwcbrent
So the best idea would be to alter the Paginator class to suit my needs? Any ideas on which vars to alter? On Dec 17, 1:35 pm, mwcbrent wrote: > Sorry!  The actual route code is: > > Router::connect('/:slug/pages/*',array > ('controller'=>'pages','action'=>'index')); > > On Dec 17, 1:30 pm, mwc

Re: Cakephp interactive home page tutorial...

2008-12-18 Thread Marcus Silva
Hi Kyle, That's exactly what I was looking for. thank you Kyle Decot wrote: > I think what your referring to is know is the "Coda Slider Effect". > There's a really good tutorial of how to do this at: > > http://jqueryfordesigners.com/coda-slider-effect/ > > > Marcus Silva wrote: > > Hi fol

Re: A newbie question (I'm unable to find it answered)

2008-12-18 Thread ark0n3
Is there absolutely no way to accomplish that? It seems to me like an obvious way to centralize some model-view i.e. if a Model is flagged "notvisibile" it seems natural to me to define afterFind() to make sure the boolean flag is always printed out like "Yes" and not "1". Thanks On 19 Dic, 00:1

Re: A newbie question (I'm unable to find it answered)

2008-12-18 Thread teknoid
helpers are not meant to be used in the models, they are only to be used in views. if you need something similar to what a helper method does, you could just take a look at the code and re-create a method to be used in your model or app model. On Dec 18, 5:05 pm, ark0n3 wrote: > I'm experimenti

Re: How to pass data to javascript from cake's controller?

2008-12-18 Thread Penfold
This might do what your after http://debuggable.com/posts/passing-controller-variables-to-your-javascript:48b4f0c6-c718-47b2-bca1-05794834cda3 On 17 Dec, 23:29, Hipnotik wrote: > Hi > I would like to build 2 javascript arrays in the view from data loaded > in controller. > > Solution 1: > use

Re: Is it possible to make this query with the find method?

2008-12-18 Thread Rob
Funny, your original SQL said NOT NULL, maybe that was your problem ;-) On Dec 18, 2:07 pm, Ramiro Araujo wrote: > Hah, yes I see. thanks for the response. > > btw, I need i.id IS NULL, not IS NOT NULL > > On Dec 18, 7:59 pm, AD7six wrote: > > > On Dec 18, 9:50 pm, Ramiro Araujo wrote: > > > >

Re: Cake losing sessions randomly

2008-12-18 Thread Dav
same here. using flash doing posts. cookies from and to server looks good = same "id", but still random logouts. getting crazy on this one :) session store = default (which should be PHP) Configure::write('Session.checkAgent', false); // needed since flash post as user-agent flash Configure::wr

Re: Is it possible to make this query with the find method?

2008-12-18 Thread Ramiro Araujo
Hah, yes I see. thanks for the response. btw, I need i.id IS NULL, not IS NOT NULL On Dec 18, 7:59 pm, AD7six wrote: > On Dec 18, 9:50 pm, Ramiro Araujo wrote: > > > > > no, I'm trying stuff like this: > > $data = $this->User->find('all', > >         array( > >                 'fields' => arra

Re: A newbie question (I'm unable to find it answered)

2008-12-18 Thread ark0n3
I'm experimenting with the method you suggested and it's great.. today I had only great problem: how to use an helper in the model? If I define the $helpers array I'm unable to use i.e. Number $number- >currency($number, $currency)... Thanks for your HUGE help!!! On 12 Dic, 23:20, mark_story w

Re: Is it possible to make this query with the find method?

2008-12-18 Thread Ramiro Araujo
OK!! got it working! Here it is: $this->User->unbindModel(array('hasMany' => array('Invitation'))); $this->User->bindModel(array('hasOne' => array('Invitation'))); $data = $this->User->find('all', array( 'fields' => array('User.*', 'Invitation.*'), 'condit

Re: Controlling automatic weight increment.

2008-12-18 Thread AD7six
On Dec 18, 10:55 pm, Colin wrote: > Thanks for your reply Mark. > > The logic in my app is working fine, the issue I have is that when I > insert a row into my table table1_table2 all the weights get adjusted. > eg: > > table1_id       table2_id        weight > 1               1               1

Re: Is it possible to make this query with the find method?

2008-12-18 Thread AD7six
On Dec 18, 9:50 pm, Ramiro Araujo wrote: > no, I'm trying stuff like this: > $data = $this->User->find('all', >         array( >                 'fields' => array('User.*', 'Invitation.*'), >                 'conditions' => array( >                                 'Invitation.id' => NULL >    

Re: SQL syntax error when using comparison operators

2008-12-18 Thread AD7six
On Dec 18, 1:24 pm, boyracerr wrote: > I have now solved this; correct syntax is: > > $this->data['user_count'] = $userObj->findCount(array( >                      'User.status' => '1', >                     'User.id' => '>' . 18) >                 , 0); > > I believe this to be a fault in the

Re: Controlling automatic weight increment.

2008-12-18 Thread Colin
Thanks for your reply Mark. The logic in my app is working fine, the issue I have is that when I insert a row into my table table1_table2 all the weights get adjusted. eg: table1_id table2_idweight 1 1 1 1 2 2 1

Re: Polymorphic behavior troubles

2008-12-18 Thread AD7six
On Dec 18, 8:10 pm, brian wrote: > Andy Dawson's PolymorphicBehavior seems like the perfect answer to a > problem I have but I'm having trouble implementing it. My situation is > that I have  a User model, then several different models which a user > can "be" ie. 'Organization', 'Student', etc.

SmartMarkUp with CakePHP

2008-12-18 Thread gerhardsletten
Just added SmartMarkUp to my CakePHP blog. Its very lightweight and works well with Cakes naming convention. Info here: http://www.gersh.no/posts/view/smartmarkup_with_cakephp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: Not Sure How To Write This Query

2008-12-18 Thread AD7six
On Dec 18, 8:27 pm, Kyle Decot wrote: > I have a Skateparks Model and a Photos Model. I want to query the > Skateparks model and get the number of skateparks that have 1 photos, > 2 photos, etc. I'm not really sure how to go about this. > > Any help would be greatly appreciated. Thank you. you

Re: Pass Session From NON Cakesite to Cakesite

2008-12-18 Thread TonyP
I'm trying to do something similar to what MDB is doing, but with two cakephp apps. How do I pass the auth session info to the other app? I've checked the core.php session.cookie info, that the variables are both named the same. Is there anything else that I need to do? How do I make the two ca

Re: How to use the controller flash() method and what's the expected behaviour and output?

2008-12-18 Thread Fabio M
Wait. Changing the debug value in the core configuration make the flash messages work. Contrarily the change I tried to do in the add.ctp view was not holded outside that context. So the question is: why? Thank you, Fabio --~--~-~--~~~---~--~~ You received this mes

Re: Overkill for a starter project?

2008-12-18 Thread mark_story
A small project is the perfect place to learn a new tool. There is less to learn with a small project, so it works as a good introductory project. Sure you could do it faster with a finished project, but that's not the point :) I started learning cake by building a monster app, and I wished way

How to use the controller flash() method and what's the expected behaviour and output?

2008-12-18 Thread Fabio M
Hi all. I'm starting to move my first steps in a personal application. By now I use a lot the given examples included in the cookbook, like the blog example. At this page... http://book.cakephp.org/view/337/Adding-Posts ...I see a handy usage of the flash() method to show a message to the user.

Error Messages Not Displaying in View or in Validations Array

2008-12-18 Thread Tony
For some reason I can't get my error messages for validations to work. I tried outputting the validations by doing: pr($this->validationErrors); But all I get is an empty array. What do you guys see that I'm doing wrong? Thanks, Tony Here's my model: class User extends AppModel

Re: Is it possible to make this query with the find method?

2008-12-18 Thread Ramiro Araujo
no, I'm trying stuff like this: $data = $this->User->find('all', array( 'fields' => array('User.*', 'Invitation.*'), 'conditions' => array( 'Invitation.id' => NULL ), 'limit' => 100,

Re: Finding content from multiple tables being referred

2008-12-18 Thread Rob
Well, the find('list') will return an array of id values, so you need to look at those arrays (and often the SQL is helpful), so I'd suggest turning debug to 3 and looking at the output. What I would expect to see from what you have there would be: $states would contain a list of States

self referential many to many relationships

2008-12-18 Thread overture
If I have a 'users' table which represents a set of employees and I want to assign a given employee mutiple supervisora (who are obviously also in the 'users' table) then I have a situation where there is a self referential relationship. Not only that it is also many to many. How do I achieve th

AJAX Helper form submit issue

2008-12-18 Thread Dominic K.
I am having a problem with my AJAX form submit and can't quite see a solution in the groups. I also couldn't find any recent (~2008) tutorials on getting AJAX to work in CakePHP. I have seen some people who have just gone on to use JQuery, but I'd rather not. My problem is that the form data neve

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
I even moved all the code into the Model, did what you said, and its still doing an insert instead of an update. Heres the method I call in the controller: function verifyEmailExpiration($username, $password, $hash, $expHours) { $userObj = $this->find('first', array( 'cond

Re: SQL syntax error when using comparison operators

2008-12-18 Thread Rob
BTW, the findCount method is deprecated according to the docs, you should be using find('count'). http://book.cakephp.org/view/454/findCount On Dec 18, 4:24 am, boyracerr wrote: > I have now solved this; correct syntax is: > > $this->data['user_count'] = $userObj->findCount(array( >            

Re: Can saveAll() be Used in this Scenario?

2008-12-18 Thread Rob
Not sure without seeing your model, but the one bit that Cake doesn't like is when you don't follow the naming conventions. So for the tables you described, so for your CommercialVendor model, you need to have a $primaryKey = 'vendor_id', and in your hasOne and belongsTo, you need to make sure yo

Re: Is it possible to make this query with the find method?

2008-12-18 Thread Rob
Probably a dumb question, but did you try a NOT condition on your find? array ("not" => array ( "Invitation.id" => null, ) ) http://book.cakephp.org/view/74/Complex-Find-Conditions On Dec 18, 10:58 am, Ramiro Araujo wrote: > Hi all > > I wasn't really fond to the find method bef

Re: Not Sure How To Write This Query

2008-12-18 Thread Rob
The cake way is to do a find('count'), so you'd do something like $this->Skatepark->Photo->find('count') http://book.cakephp.org/view/449/find Alternatively, you can cheat and use a correlated sub-query as one of your fields in the find, although I'm sure this violates all sorts of Cake principl

Not Sure How To Write This Query

2008-12-18 Thread Kyle Decot
I have a Skateparks Model and a Photos Model. I want to query the Skateparks model and get the number of skateparks that have 1 photos, 2 photos, etc. I'm not really sure how to go about this. Any help would be greatly appreciated. Thank you. --~--~-~--~~~---~--~~

Re: Cakephp interactive home page tutorial...

2008-12-18 Thread Kyle Decot
I think what your referring to is know is the "Coda Slider Effect". There's a really good tutorial of how to do this at: http://jqueryfordesigners.com/coda-slider-effect/ Marcus Silva wrote: > Hi folks, > > while many of you may find this question completely irrelevant, i > still would like to

Polymorphic behavior troubles

2008-12-18 Thread brian
Andy Dawson's PolymorphicBehavior seems like the perfect answer to a problem I have but I'm having trouble implementing it. My situation is that I have a User model, then several different models which a user can "be" ie. 'Organization', 'Student', etc. So, I've tried doing this: users table: id

Re: Newbie-question: Store multiple model-objects with just one form

2008-12-18 Thread volka
Cool! That's exactly what I've been searching for! :-) Thanks a lot! --~--~-~--~~~---~--~~ 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 fro

Cakephp interactive home page tutorial...

2008-12-18 Thread Marcus Silva
Hi folks, while many of you may find this question completely irrelevant, i still would like to ask it and any help would be kindly appreciated. Does anyone know a good tutorial that I could use to create something similar to the Cakephp home page sliding content effects? I do know that Cake us

Is it possible to make this query with the find method?

2008-12-18 Thread Ramiro Araujo
Hi all I wasn't really fond to the find method before, and made a lot of custom query()ies. Now im using it a lot, with quite nice results. Still, im having trouble trying to build a query. Let me explain the situation. I have 2 tables: a users table, and a invitations table. User hasMany Invita

Send feedback while processing with ajax?

2008-12-18 Thread Topper
Hello. I have an ajax form that triggers an action and renders the result inside a div. This works fine, but the view only renders at the end of the action and I want to send ocassionaly feedback to the user while it is processing. It has a loop inside the action and I would like to send stuff lik

Using a model without a table

2008-12-18 Thread George
Hello. I'm pretty new to cake and am working on creating a reporting intranet application. Basically I aggregate a bunch of data through views and stored procedures on the database, and would like to build a "Report" model that will just have a bunch of custom functions to run the various stored

Re: help with find function with many associations

2008-12-18 Thread Rob
OK, first this is getting way beyond my knowledge of how Cake internals work, but it appears that Cake is doing the hasOne separately from the hasMany relationships. I would suggest you talk to the guys on the IRC channel (#cakephp), as there is usually at least one actual Cake contributor monito

Re: Overkill for a starter project?

2008-12-18 Thread pg
Thanks for all the input. I think Gonzalo understood me best. I already have a really simple blog I can use with my clients but I want to learn about cakePHP so thought I could try doing the same thing using cakePHP. My concern was as to whether CakePHP is appropriate for such a simple project.

Re: Overkill for a starter project?

2008-12-18 Thread Gonzalo Servat
On Thu, Dec 18, 2008 at 4:06 PM, thatsgreat2345 wrote: > Don't reinvent the wheel, just use wordpress, or joomla or some other > CMS / Blogging that is already made. > Keep in mind the original poster said he/she is interested in learning CakePHP. The OP also asked: my question is will CakePHP m

Re: Overkill for a starter project?

2008-12-18 Thread thatsgreat2345
Don't reinvent the wheel, just use wordpress, or joomla or some other CMS / Blogging that is already made. On Dec 18, 9:13 am, "Olivier Percebois-Garve" wrote: > If your target is really simple blog, then cake is the perfect tool. if you > are "intermediate" php, you should not have troubles get

Re: validation rule works locally, but not on server

2008-12-18 Thread RyOnLife
Thanks. That helped. Issued discussed here: http://groups.google.com/group/cake-php/browse_thread/thread/0040ac0b744181d5/ I ended up using a custom validation rule. On Dec 18, 10:26 am, Smelly_Eddie wrote: > I believe this is based on the version of PHP your machines are > running. (4 vs 5) >

Re: Overkill for a starter project?

2008-12-18 Thread Olivier Percebois-Garve
If your target is really simple blog, then cake is the perfect tool. if you are "intermediate" php, you should not have troubles getting it done. IMO its better to learn cake on a simple project, with no border-the-line use of the framework. That will avoid you to make structural errors on your ne

Re: data validation for optional fields

2008-12-18 Thread Markus
Hi Grigri, your code seems work as i what i wanted it to do. thanks a lot! On Dec 16, 4:07 pm, grigri wrote: > It just so happens I was playing around with some code for exactly > this purpose. I stress that the code is proof-of-concept, and > definitely needs work and testing before being read

Re: Overkill for a starter project?

2008-12-18 Thread pg
Yeah, I was going to manually code it and wanted to use cakePHP just to start understanding how to use it. Maybe I should save this for another project. Any idea what would constitute a good "starter project?" On Dec 17, 4:00 pm, gearvOsh wrote: > Honestly things like that I would just manually

Re: Can saveAll() be Used in this Scenario?

2008-12-18 Thread Rob Wilkerson
> On Dec 17, 2:54 pm, Rob Wilkerson wrote: > > > I have what I suppose is a 3-level model relationship.  I have a > > vendors table that is "extended" by a commercial_vendors table.  A > > commercial_vendor "is-a" vendor so the commercial_vendors table's > > primary key is vendor_id which is als

Re: validation rule works locally, but not on server

2008-12-18 Thread Smelly_Eddie
I believe this is based on the version of PHP your machines are running. (4 vs 5) I also think there is a submitted ticket for the issue but I have the time to search. Google alphanumeric issue in Cakephp and Im sure you'll find the details. On Dec 17, 3:00 pm, RyOnLife wrote: > This one h

Re: what is the best way to restrict actions to different profiles from the same model User?

2008-12-18 Thread Smelly_Eddie
I think your missing the point of ACLs You should have a record of user ID's that may add new users. On Dec 17, 10:39 am, persivo_cunha wrote: > Hi, > > Im my DB, i have one table called 'user' with a field called profile, > and only the profile 'admin' can add a new user. Is wrong i put on

Re: Controller action randomly running twice

2008-12-18 Thread Adam Royle
By the way, you can also do this: $this->log($this) if you want to really analyse the request. :) Cheers, Adam On Dec 19, 12:13 am, WebbedIT wrote: > Tested your theory that something in my page with a local relative > path was calling the page again.  To do this I added an extra > parameter t

Re: Action-Specific Helpers

2008-12-18 Thread Rob Wilkerson
On Thu, Dec 18, 2008 at 10:08 AM, Adam Royle wrote: > What you are doing is perfectly fine, I personally use $this->helpers > [] = 'Blah'; since it's quick and easy. Thanks for verifying. Native syntax within frameworks can sometimes behave unpredictably, so even though this seemed to work, I wa

Re: Action-Specific Helpers

2008-12-18 Thread Adam Royle
What you are doing is perfectly fine, I personally use $this->helpers [] = 'Blah'; since it's quick and easy. Cake will only load your helper once even if it appears multiple times in your helpers array, so don't even worry about checking for this. Heck, just include it twice to make sure it get

Re: data validation for optional fields

2008-12-18 Thread Markus
Hi, i don't think this is correct, because i already tried to set required => false and it still give error message, only if i set allowEmpty => true then it works. however this is not what i wanted. thank you On Dec 17, 4:14 am, bingo wrote: > hi Markus, > > data validation automatically igno

Re: Controlling automatic weight increment.

2008-12-18 Thread mark_story
HABTM is not relation you are looking for I think, I usually model this with a table_1 hasMany joinTable, table_2 hasMany joinTable, and joinTable belongsTo both table_1 and table_2. -Mark On Dec 18, 3:16 am, Colin wrote: > Hi All, > > I have a model for HABTM like so: > > id > table1_id > tabl

Re: Very slow response times with CakePHP

2008-12-18 Thread Jon Bennett
Hi Kappa, > I also enabled caching on each requestAction (1 day) but nothing > changed; are you sure the cache's are being written? look in /tmp/cache/views for $this->element caches, and /tmp/cache/models for things written in the model with Cache::write > the overall database time is quite

Re: Controller action randomly running twice

2008-12-18 Thread WebbedIT
Matt, that sounds promising as I am running FireBug/PHP and I have heard how it used to duplicate requests to pull back the header information etc. I have recently updated it though and I thought they had stopped doing that ?!? Anyway, I have disabled FirePHP and accessed a few pages, without is

Re: Controller action randomly running twice

2008-12-18 Thread WebbedIT
Tested your theory that something in my page with a local relative path was calling the page again. To do this I added an extra parameter to my edit function to see if it would echo any extra params into my debug message. function edit($id = null, $extra = null) { .. $this->log('Edit form di

Re: Very slow response times with CakePHP

2008-12-18 Thread Kappa
So, i've been experiencing some time problem too on a cakephp based portal. I have seen that with debug setted to 0 the speed increases a few.. but it's still to slow.. I also enabled caching on each requestAction (1 day) but nothing changed; the overall database time is quite small (40msec) but t

Re: Controller action randomly running twice

2008-12-18 Thread Matt Curry
Are you using Firefox w/ FireBug installed? I've seen FireBug make extra requests - at least with older versions. -Matt www.pseudocoder.com On Dec 18, 8:55 am, WebbedIT wrote: > Would that do it intermittently?  See the below debug log ... > > 2008-12-18 13:49:26 Debug: Edit form displayed fo

Re: cake 1.2 forms: date fields left empty => null in database?

2008-12-18 Thread Sebastian Göttschkes
Hi, thanks for your reply. The data field was set to null before. If I update a dataset and assigning the null value to a the birthday field (SET birthday=null) it works fine. So I added the following code to my controller: if(empty($this->data['Employee']['birthday'])) $this->data['Emplo

Re: Controller action randomly running twice

2008-12-18 Thread WebbedIT
Would that do it intermittently? See the below debug log ... 2008-12-18 13:49:26 Debug: Edit form displayed for record # 6815 2008-12-18 13:49:30 Debug: Edit saved for record # 6815 2008-12-18 13:49:32 Debug: TelephonyNumber Index 2008-12-18 13:49:34 Debug: Edit form displayed for record # 877 2

Re: Controller action randomly running twice

2008-12-18 Thread grigri
Cake doesn't call the actions twice, normally. I don't know if this is any help but I had a similar problem a while ago. It was down to a "normal" image tag on the view template: Called from /posts/edit/123, this resulted in a query for /posts/edit/ 123/img/whatver.png which called the action

Re: validate and allow only specified fields

2008-12-18 Thread grigri
Built-in whitelisting: $this->Post->save($data, array('fieldList' => array('field1', 'field2', 'field3'))); hth grigri On Dec 18, 1:29 pm, Henrik Gemal wrote: > Is there a way in the model to say that it should only be possible to > submit these values in the post? > > I want to disallow the u

Re: Controller action randomly running twice

2008-12-18 Thread WebbedIT
Could really do with some help with this. I added some log calls to my edit action and clicked to edit two different records, checked the log and found the following ... 2008-12-18 13:25:57 Debug: Edit form displayed for record # 6815 2008-12-18 13:25:58 Debug: Edit form displayed for record # 6

validate and allow only specified fields

2008-12-18 Thread Henrik Gemal
Is there a way in the model to say that it should only be possible to submit these values in the post? I want to disallow the user posting any other form fields that I have specified in the model's validate array? --~--~-~--~~~---~--~~ You received this message bec

Re: Can saveAll() be Used in this Scenario?

2008-12-18 Thread Rob Wilkerson
The problem with an active group is that things slip quickly. Bumping this (just once) in case someone who can help didn't see it. I promise not to do it again. :-) On Dec 17, 2:54 pm, Rob Wilkerson wrote: > I have what I suppose is a 3-level model relationship.  I have a > vendors table that i

Re: Very slow response times with CakePHP

2008-12-18 Thread Dérico Filho
Well It seems something for _Nate_ to take a look... :-) Perhaps there's something to do with PHP Safe mode ou some sort of hardened PHP plugin which controls and avoids recursion. This Folder->dir method uses recursion to create the file tree structure for CakePHP internals. One last check

Re: controller fixturize drops table in end, how to test data?

2008-12-18 Thread Abhimanyu Grover
That might be effective. Thanks. On Dec 1, 2:16 am, mradosta wrote: > maybe you could overwrite the endController method, and then check for > the result to finish the test case method. > > var $result; > > function endController(&$controller, $params = array()) { >         $this->result = $cont

Re: Updating a single database rows field

2008-12-18 Thread AD7six
On Dec 18, 12:44 pm, gearvOsh wrote: > Like I said, I dont want to Import the locale in every model method. Hint: you don't need to, and it doesn't say you should. > > Also saveField fails at this point: > > if (!empty($this->id)) { >         if (!$db->update($this, $fields, $values)) { >    

Re: SQL syntax error when using comparison operators

2008-12-18 Thread grigri
No, the first one is the correct way; the manual is correct. You must be using an old version of cake. This was changed a while ago to avoid SQL injection. On Dec 18, 12:24 pm, boyracerr wrote: > I have now solved this; correct syntax is: > > $this->data['user_count'] = $userObj->findCount(arra

Re: SQL syntax error when using comparison operators

2008-12-18 Thread boyracerr
I have now solved this; correct syntax is: $this->data['user_count'] = $userObj->findCount(array( 'User.status' => '1', 'User.id' => '>' . 18) , 0); I believe this to be a fault in the documentation at http://book.cakephp.org/view/74/Compl

Re: % in url params

2008-12-18 Thread Bernardo Vieira
You shoul urlencode('90%') I suppose. Anyway, wouldn't it be better to use named parameters? That way you get cake's pretty urls and the html helper does the urlencoding as necessary for you. fito wrote: > Hi friends. > > I've been using cake for some months, but it was today the first time >

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
Like I said, I dont want to Import the locale in every model method. Also saveField fails at this point: if (!empty($this->id)) { if (!$db->update($this, $fields, $values)) { $success = false; } } Because of this, When I know for sure the row exists. if (!$this-

Re: Updating a single database rows field

2008-12-18 Thread AD7six
On Dec 18, 11:57 am, gearvOsh wrote: > I cant use i18n/l10n in models now can I. yes you can. start here: http://book.cakephp.org/view/163/Internationalization-in-CakePHP or use your best friend ;) > Please show me how I would > add errors to the $this->validationErrors array with a locale

Re: help with find function with many associations

2008-12-18 Thread dev
Still tables with hasMany relationships not working. Advert model: var $hasMany = array( 'AdImage' => array( 'className' => 'AdImage', 'foreignKey'=> 'advert_id', 'conditions'=> '', 'order' => '', 'limit'

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
Also I wish to not import and initiate a locale class in the model everytime I need it, which would be most of the time. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send ema

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
I cant use i18n/l10n in models now can I. Please show me how I would add errors to the $this->validationErrors array with a locale. If something works, who cares where it belongs. @grigri - I did updateAll, I just dislike how it doesnt escape and quote the data. --~--~-~--~~--

% in url params

2008-12-18 Thread fito
Hi friends. I've been using cake for some months, but it was today the first time I tried to invoke a controller method with a % character in the url. Something like this: $html->link('Example', '/controller/method?width=90%') The link was well-formed but response from the server was something

plugins, SWFs and dispatcher

2008-12-18 Thread dr. Hannibal Lecter
Hi all, I'm creating a plugin which needs .swf files in vendors folder, and it seems impossible to make it work. I've managed to trace the problem to Dispatcher::cached() where only certain content types are marked as assets ('text/javascript', 'text/css', 'image/gif', 'image/jpeg', 'image/png'),

Re: CakePHP Bi-Weekly Digest

2008-12-18 Thread Ewen Cumming
Hey Matt thanks for this - I've subscribed :) 2008/12/17 Everton Yoshitani > > Great Matt. > > 2008/12/17 Matt Curry : > > > > Hey All, > > Wanted to let everyone know that I've started posting bi-weekly > > updates for all the happenings in the CakePHP world at > http://www.pseudocoder.com. > >

Controlling automatic weight increment.

2008-12-18 Thread Colin
Hi All, I have a model for HABTM like so: id table1_id table2_id weight created modified I only want the weight to be unique for table1_id, but when I do an insert at the moment, all the weights in the table are changed automagically. Is there a way to tell cake to only increment the weight wh

Finding content from multiple tables being referred

2008-12-18 Thread Nature Lover
Hi, I am a newbie for CakePHP. Working on a multilingual E-commerce website. Except the basic learning curve there is problem regarding finding multilingual content based on current selected language and site base language. I have tables as follows for languages, countries, country_translation

Re: Updating a single database rows field

2008-12-18 Thread AD7six
On Dec 18, 8:12 am, gearvOsh wrote: > I still have yet to find a straight forward way to do this, so ill > simply do something like this: > > function update($user_id, $fields) { >         if (is_array($fields)) { >                 App::import('Sanitize'); >                 Sanitize::clean($fie

Re: Updating a single database rows field

2008-12-18 Thread AD7six
On Dec 17, 10:05 pm, gearvOsh wrote: > Oh but the extra code is for extra form validation on my end. Model logic. > Using > invalidate() adds errors to the array that I can then loop through and > display in the view (I dislike having the error show up after the > input). > So don't use the i

  1   2   >