Re: appmodel save returns true to data not in database

2008-12-19 Thread mike
somehow, the only sql i see in debug mode is DESCRIBE `users` On Dec 16, 4:28 am, grigri wrote: > What SQL is being executed? > > On Dec 16, 5:26 am, mike wrote: > > > > > somehow, its getting to 'test2' in the controller, however, I don't > > see thedatain the table!  I actually had this worki

Re: cakeapp.com

2008-12-19 Thread powtac
Added auto creation of hasmany-, belongsto-, HABTM-relations in the SQL editor. Example: http://cakeapp.com/sqldesigners/sql/test3 Test the result: http://test3.cakeapp.com/ or download the created SQL: http://cakeapp.com/sqldownload/get/141 --~--~-~--~~~---~--~~ Yo

Re: With debug 0 routes stop working and all pages not found

2008-12-19 Thread Ryan McKillen
Good point. But wouldn't a 500 be better than a 404? Not that big a deal, but the 404 just had me all hung up looking for routing mistakes when that was nowhere near the problem. \\Ryan Sent from my iPhone On Dec 19, 2008, at 9:08 PM, mark_story wrote: > > Well you did put the debug off,

Re: With debug 0 routes stop working and all pages not found

2008-12-19 Thread mark_story
Well you did put the debug off, so all nice error messages turn into 404's. Wouldn't be a good idea to leave all the nice errors so an site visitor/attacker could see your mistakes :) -Mark On Dec 19, 5:52 pm, RyOnLife wrote: > Go figure. 3 hours of trying and the moment send my previous messa

Re: Release: CakePHP RC4 ...Close

2008-12-19 Thread Marcelo Andrade
On Fri, Dec 19, 2008 at 1:39 AM, Nate wrote: > > 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]. That's news great to he

Is it possible to redefine Inflector::slug()?

2008-12-19 Thread Jaime
Hi all, I did a nice app which makes heavy use of Inflector::slug() to convert "My Strings" inoto "my_strings". However, now I find that the core slug() function is not working with my uppercase accentuated wovels (Á, É...). Of course I can patch inflector.php, but I DON'T like to touch Cake's c

Re: Finding id field in model

2008-12-19 Thread Donkeybob
if your in the model . . .does this work? $this->Modelname->id; On Dec 19, 6:35 pm, Ken wrote: > This is the worst kind of noob question, but I'm stumped. I've tried > $this->Modelname->getID(); > $this->Modelname->getLastInsertID(); > $this->data['Modelname']['id']; > > a special method from th

Finding id field in model

2008-12-19 Thread Ken
This is the worst kind of noob question, but I'm stumped. I've tried: $this->Modelname->getID(); $this->Modelname->getLastInsertID(); $this->data['Modelname']['id']; a special method from the Wizard Component: $this->Wizard->read('step.Modelname.id'); //by the way, this method retrieves data for

Re: find conditions problem (tables don't join)

2008-12-19 Thread teknoid
query() is not a recommended practice... besides a few points you've mentioned (and don't think that portability is not important, you'd be surprised what happens when oracle invests $1M into your company, but now you gotta switch DB's ;)), i've outlined a few more here: http://teknoid.wordpress.

Re: Validate in 1.2RC4

2008-12-19 Thread Andres Antista
I understand that when "save" is called it validate all the stuff.. maybe i'm wrong... But thanks, i'm gonna try that.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send emai

Re: Issue when saving HABTM form on RC4

2008-12-19 Thread tekomp
Any sites/tutorials that can help a Cakephp newbie with that? I read the Cookbook, but unsure what I'd even be testing for (lack of errors?) and unsure of what method(s)/code to test. Would it be the code on lines 1281 and 1282? I'm happy to give it a try, but could use some guidance. Thanks.

Re: Validate in 1.2RC4

2008-12-19 Thread gearvOsh
Dont you need to call this? if ($this->Task->validates()) { // if no errors, do something } --~--~-~--~~~---~--~~ 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.

Re: find conditions problem (tables don't join)

2008-12-19 Thread erturne
I have to ask... if you have to take extra measures to specify your join conditions, why not just provide a method in a model that uses query() with a simple-to-understand SQL statement? All these find() contortions, while interesting, may not be the easiest to maintain later on when you have to d

Re: how to set session when Auth component is used in login page

2008-12-19 Thread gearvOsh
Its automatic in the Auth component, just do this. if ($this->Auth->user()) { // they are logged in } If user() is null, that means they are not logged in. Hope that helps. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: Routing and Pagination Issue

2008-12-19 Thread mwcbrent
Made the following changes to the paginator.php: instead of: return $this->link($title, $url, array_merge($options, array('escape' => $escape))); I wrote: $outurl = ''; foreach($url as $key => $val) { $outurl .= $key.':'.$val; } return ''.$title.''; Not sure if this will extend well bu

Re: Determine a file's MIME type

2008-12-19 Thread Donkeybob
have you tried getimagesize() http://us3.php.net/getimagesize On Dec 19, 4:30 pm, djXternal wrote: > I am trying to determine a file's MIME type that's on the server.  I > have tried using the PHP finfo function, but came back with a cannot > find function error Is there any other way of

Re: With debug 0 routes stop working and all pages not found

2008-12-19 Thread RyOnLife
Go figure. 3 hours of trying and the moment send my previous message: it hits me. Clear the models cache. I'd added a new table. That fixed it. Wish Cake had some better error handling in that case. Would opening a ticket for that "issue" be appropriate? On Dec 19, 5:41 pm, RyOnLife wrote: > My

With debug 0 routes stop working and all pages not found

2008-12-19 Thread RyOnLife
My app suddenly went haywire. When I set debug to 0, I get 404 not found errors (from Cake, not Apache) on all pages. With the debug setting at 1 or 2 there are no problems. I've been working on this app for months and have never had a problem when changing debug mode to 0. I haven't made any edit

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

2008-12-19 Thread teknoid
Just do that in the view... echo $booleanField ? 'Yes' : 'No'; On Dec 18, 6:27 pm, ark0n3 wrote: > 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 after

Re: Sanitize Question

2008-12-19 Thread teknoid
Doesn't seem like it would be necessary... The only data that's "dangerous" for your DB is any sort of SQL exploit, which you are already protected from by the core. (i.e. the values are escaped before insertion or selection from DB). On the other hand, you do need to make your data safe in the v

Determine a file's MIME type

2008-12-19 Thread djXternal
I am trying to determine a file's MIME type that's on the server. I have tried using the PHP finfo function, but came back with a cannot find function error Is there any other way of determining file type? --~--~-~--~~~---~--~~ You received this message because

Re: Is this all that stands between us and the final release of 1.2?

2008-12-19 Thread 703designs
Yea, I'm not involved enough to know for sure what's of the highest priority, but I'm assuming we're in feature freeze right now, so I figured that these other 285 are probably for 1.3. Thomas On Dec 17, 10:06 am, Adriano Varoli Piazza wrote: > On 17 dic, 13:02, Adriano Varoli Piazza wrote: >

Re: Paginate and recursive

2008-12-19 Thread WebbedIT
Ok, this is not a paginate issue ... trying the following find() results in the same problem: $this->Staff->find('all', array( 'conditions'=>array('Organisation.scheme_id'=>$scheme_id), 'recursive'=>1 )); Am I misunderstanding how associations work? I believed that I should be able to pla

RSS & RequestHandler problem in Safari

2008-12-19 Thread willem
Hi everyone, I'm just getting started using cakePHP by going through the IBM tutorials, and I have a problem which I don't understand, and I also haven't found a solution on the web. I'm trying to set up an RSS feed using the RSS helper and the RequestHandler component. Everything works exactly a

Re: Naming-conventions for plugins (new go at old topic)

2008-12-19 Thread mark_story
If you go with the $useDbConfig you can always have multiple database connections connect to the same database and just implement different prefixes. This gets around the need for multiple databases. var $pizza = array( 'driver' => 'mysql', 'connect' => 'm

Sanitize Question

2008-12-19 Thread Tim
I want to sanitize the post before working with it or saving it to the database. Like this: data['Upload'] = Sanitize::clean($this->data['Upload']); ?> I have two questions: 1) Is this even necessary? Is this going to do anything for me or is it already being done? 2) After I change "<>$%$" to t

Cache::delete

2008-12-19 Thread Tankist
Hello! I have to one problem with Cache::delete function. For example create three Cache records: Cache::write('post.page.1', 'somedata'): Cache::write('post.page.2', 'somedata'): Cache::write('another.data', 'foo'); Now question: How i can delete "post.*" Cache records, without deleting "anothe

Paginate and recursive

2008-12-19 Thread WebbedIT
Hi, I am trying and failing to fetch a paginated result set using a condition on a model which is two associations away. Staff -> Person -> Organisation I would have thought setting recursive to 1 or higher would have let me achieve this but whilst the Staff model joins the Peron model fine, I

Re: Error Messages Not Displaying in View or in Validations Array

2008-12-19 Thread Tony
I don't think I was clear in that last message. I'm using a model name that is not associated with the controller. For example my controller is businesses but my model is users because I'm adding information into my users database for marketing to them. I was under the impression that it's the co

Guys (and gals), we're slackin' here

2008-12-19 Thread Nate
Get out the vote! http://www.brownphp.com/2008/12/popular-php-frameworks-whats-your-fav/ --~--~-~--~~~---~--~~ 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

Re: find conditions problem (tables don't join)

2008-12-19 Thread Webweave
OK, it depends on what you are really trying to fetch. Are you trying to restrict the Advert results to just those that have data in the hasMany tables, or are you trying to restrict the child table values ? If it's the former, I would just use a condition that includes a select for that conditio

how to set session when Auth component is used in login page

2008-12-19 Thread vikas
hello every one... I am learning cakephp myself.. I have used auth component in login page. now I want to set session for that logged in user.. so is there need to use session component or use auth session directly? --~--~-~--~~~---~--~~ You received this message

Re: Error Messages Not Displaying in View or in Validations Array

2008-12-19 Thread Tony
Well I have a model for the user table and I have a controller called businesses and within businesses I have two actions (index and thank_you). In my controller I am using the model Users doing: var $uses = array('User'); But are you saying that I should be adding the form data to this page and t

Re: plugins, SWFs and dispatcher

2008-12-19 Thread dr. Hannibal Lecter
Seriously, anyone? Are plugins limited to certain asset types on purpose? On Dec 18, 10:35 am, "dr. Hannibal Lecter" wrote: > 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:

Re: find conditions problem (tables don't join)

2008-12-19 Thread teknoid
here's more info on it: http://rafaelbandeira3.wordpress.com/2008/11/16/linkable-behavior-taking-it-easy-in-your-db/ On Dec 19, 12:31 pm, teknoid wrote: > Here's another thing you can > try:http://github.com/rafaelbandeira3/cakephp-plugins/tree/master/plugins... > > This is a very nice behavior

HABTM query returns empty

2008-12-19 Thread Juan
Any HABTM guru out there, please I need to be enlightned. There are 3 tables and their models : Equipment (id, name, ...) Expenses (id, name, ...) Equipment_Expenses (equipment_id, expense_id) I want to establish a HABTM relation between equipment a expenses (many expenses 'hanging' from a equip

Re: find conditions problem (tables don't join)

2008-12-19 Thread teknoid
Here's another thing you can try: http://github.com/rafaelbandeira3/cakephp-plugins/tree/master/plugins/linkable_behavior/models/behaviors/linkable.php This is a very nice behavior that will construct JOINs for you... There is a small example of usage in the comments of the code, in a way it is s

Re: self referential many to many relationships

2008-12-19 Thread overture
I had looked at the manual already. Which bit covers 'self' referential relationships? On Dec 19, 1:46 pm, Smelly_Eddie wrote: > http://book.cakephp.org/view/78/Associations-Linking-Models-Together > > On Dec 18, 2:46 pm,overture wrote: > > > > > If I have a 'users' table which represents a set

Validate in 1.2RC4

2008-12-19 Thread anddy
Hi, i'm new and trying to learn how all these work, i'm following in a tutorial the steps for a to-do list, but i cannot make my data validates (the "title") when add or edit a new task and i don't know what i'm doing wrong.. currently i'm using 1.2 RC4 and previously RC3 and didn't work either..

Re: Issue when saving HABTM form on RC4

2008-12-19 Thread Larry E. Masters aka PhpNut
Martin, Join tables do not, and should not require a separate primary key (id) unless you are storing additional data on the table, which in this case it is no longer just a join table. I fixed the bug related to that issue https://trac.cakephp.org/changeset/7918 tekcomp, You need to write a test

Re: find conditions problem (tables don't join)

2008-12-19 Thread Martin Westin
Hi dev, Since Cake does not join on hasMany, you have a few options. You can use containable and then filter the resulting array. This works until the returned dataset starts growing. You are likely to run out of memory of at least slow things down a lot. You can join them yourself in a custom f

Re: Issue when saving HABTM form on RC4

2008-12-19 Thread Martin Westin
Hi, Looks like you have fallen victim to the same thing I did (when RC3 came along)... thinking that Cake would continue to work with join- tables that have a composite pk. It was made clear to me in no uncertain terms that a join-table must now have a separate primary key (id). Martin On Dec

login redirect does not work on ie6

2008-12-19 Thread David Coleman
This is my code: function beforeFilter() { $this->Auth->allow ( 'ajax_combo_subjects_by_area', 'ajax_combo_courses_by_year', 'ajax_combo_skills_by_year', 'search_skills_courses', 'search_

Re: % in url params

2008-12-19 Thread fito
@Bernardo That's a good practise. I'll try it from now on. @brian It could be the problem. I did try the same url in two servers. In the first one all was ok, but in the second one I'd got the problem, probably the two servers have different configuration. Thank you very much guys. --~--~

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

2008-12-19 Thread Smelly_Eddie
Fabio I may not entirely understand, if so I appoligize. If you want to know why using Configure::write('debug', 0); in the / views/posts/add.ctp for the redirect then I offer my explanation. Heres your scenario (as I understand it); Controller calls flash layout passing it a url,delay and m

Re: Error Messages Not Displaying in View or in Validations Array

2008-12-19 Thread Smelly_Eddie
Just a guess but it looks like your sending the form data to a different page... Validation was intended to display on the same model in a circular manner. i.e. empty user/add form is shown -> data submitted to user/ add action -> user/add validates data -> form is repeated if invalid OR redirect

Re: self referential many to many relationships

2008-12-19 Thread Smelly_Eddie
http://book.cakephp.org/view/78/Associations-Linking-Models-Together On Dec 18, 2:46 pm, overture wrote: > 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 situa

Naming-conventions for plugins (new go at old topic)

2008-12-19 Thread Martin Westin
I am interested to hear how others handle names (of classes and therefore files) inside plugins. It has been up for discussion before but I still feel this is an area that could be brought to the front once more. So, what's the problem? Anything you create in a plugin can (not will) conflict with

Admin routing $html->link problem

2008-12-19 Thread bkoc
I've coded a simple login system for admin pages. In core.php I've the line: Configure::write('Routing.admin', 'admin'); Routing and login system works fine but the problem is that when logged in and viewing an admin page eg. http://localhost/cake/app/admin/movies/ all links coded like e($htm

cannot save data into database

2008-12-19 Thread ridwan arifandi
hi all i have an application based on cakephp in the controller, i'm using more than one model. the code : data) && !empty($this->data['TransactionInvoice'] ['action'])) : $userrole = $this->Session->Read('userrole'); $action = $

Re: How can I hide the content on ajax request into CakePHP Ajax Pagination

2008-12-19 Thread bookme
I tried this also $paginator->options( array('update'=>'id_problem_index', 'onCreate' => 'hideProcessing();', 'onComplete' => 'showProcessing();', 'url' => array('controller' => 'problems', 'action' => 'index', 'slug' => $b

Re: Filter on BelongsTo relationship

2008-12-19 Thread AngeloZanetti
Apparently this kind of filtering only works in cakePHP version 1.2. How would I implement this in a previous version of cakePHP? Please send any tips/links/advice. Thanks in advance. AngeloZanetti wrote: > > > > rtconner wrote: >> >> >> You have to use an INNER join. >> >> var $belon

How can I hide the content on ajax request into CakePHP Ajax Pagination

2008-12-19 Thread bookme
Hi, I am trying CakePHP ajax pagination using prototype.js My code is below : options( array('update'=>'CustomerPaging', 'url'=>array('controller'=>'Customers', 'action'=>'display'), 'indicator' => 'LoadingDiv')); ?> image('ajax-loader.gi

email component

2008-12-19 Thread Mantas K.
Hello, I have problems with cakephp email component (and I don't use smtp). When i send html some webmails show html tags: test test When I use both they show both messages. Is there solution for this problem? --~--~-~--~~

Re: Very slow response times with CakePHP

2008-12-19 Thread Flipflops
Hi Bernhard The 1.5 - 2 seconds seems really wierd - maybe something to with the file system on the server ( - particularly with safe mode enabled?) For example I think Dreamhost have their shared servers on NFS - and vaguely remember something about a cache plugin for wordpress that even said th

Re: Issue when saving HABTM form on RC4

2008-12-19 Thread tekomp
I left out the full debug of the warning by mistake. Here is that: Warning (2): Cannot modify header information - headers already sent by (output started at /www/example.com/cake/basics.php:111) [CORE/cake/ libs/controller/controller.php, line 615] Code | Context $status = "Location: ht

Re: Cake losing sessions randomly

2008-12-19 Thread Martin Westin
Like Sam DeVore said back in the first reply... try setting the session store to "cake" since the tmp files might be wiped every now and then. You will now have total control over the session files since they will be inside your app folder. // config/core.php:104 Configure::write('Session.save', '

Issue when saving HABTM form on RC4

2008-12-19 Thread tekomp
I've come across an issue in RC4 when saving a form that has a HABTM relationship within it. The HABTM relationship in this case is "Websites" and "Niches". The forms are using the form helper. When adding or editing either a website or a niche, and debug > 0, the following notices and warning

Re: Updating a single database rows field

2008-12-19 Thread gearvOsh
So really weird. This was my previous action in the controller. function verify($hash = NULL) { } That would fail the saveField(), and the saveField would try to do an insert. It would also grab the wrong id for the User model. But once I changed it to the following it works fine. function veri

find conditions problem (tables don't join)

2008-12-19 Thread dev
i posted code here: http://bin.cakephp.org/saved/40741 How to join Image and Option tables if i want to set these find conditions in Advert? I tried Containable (test2 function), but it selects all Adverts, and if i set conditions in first paginate array - it generates the same error, bicause t

Re: Filter on BelongsTo relationship

2008-12-19 Thread AngeloZanetti
rtconner wrote: > > > You have to use an INNER join. > > var $belongsTo = array( > 'Competition' => array('className' => 'Competition', > > 'foreignKey' => 'competition_id', > 'type' => > 'INNER' >

Trying To Watermark an Image with a 24-bit PNG

2008-12-19 Thread Kyle Decot
I know that this is not a cakePHP specific question but I though someone on here might have some experience with watermarking an image with php/gd. I am attempting to overway a 24-bit PNG with transparency over a set of images. The problem is that when I do this, the transparency is discarded and

Re: Very slow response times with CakePHP

2008-12-19 Thread AD7six
On Dec 19, 8:13 am, Kappa wrote: > 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 ha

Re: Polymorphic behavior troubles

2008-12-19 Thread AD7six
On Dec 19, 8:59 am, brian wrote: > ... minutes later, the clue train pulls in. I can write a behavior to > modify the conditions. But, I've got both Polymorphic & Containable in > the mix -- how can I figure out which comes first? Or change their > order, if necessary. Is their $actAs entry the

Re: Polymorphic behavior troubles

2008-12-19 Thread brian
... minutes later, the clue train pulls in. I can write a behavior to modify the conditions. But, I've got both Polymorphic & Containable in the mix -- how can I figure out which comes first? Or change their order, if necessary. Is their $actAs entry the determining factor? Is that a dumb questio