Re: How to tell if it's an edit or create action?

2012-05-14 Thread Thomas Ploch
I suppose that: a) The hidden input for Model.id is missing from the edit form. b) The record isn't being read in the action beforehand Regards Thomas Am 14.05.2012 13:38, schrieb Jeremy Burns | Class Outfit: Ask yourself this: If the id column is empty, how does the model work out which row

Re: 'Listen' for new database entries from a plugin

2012-03-30 Thread Thomas Ploch
If you are using CakePHP 2.1, use CakeEvent to dispatch events for inter plugin communication: http://book.cakephp.org/2.0/en/core-libraries/events.html On 30.03.2012 16:45, rainerpl wrote: Hi I was wondering , if it is possible to write a plugin, that 'knows' if for example a new user

Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-20 Thread Thomas Ploch
You can tell cronjobs under which user it should run. For your case apparantly it should be the apache user. The default mask value '0664' was intentional because of security issues. Try 'sudo -u {apache-user} cake {shellname} {command}' or set the default mask in core.php __before__ you use

Re: High scalability with CakePHP

2012-02-09 Thread Thomas Ploch
Just as a hint: http://pagodabox.com/features/php-server-configuration-and-administration This seems like an easy to use and payable cloud service for php applications of any kind. Since managing a Master/Slave DB setup, load balancing, code deployment on multiple server instances, etc.. can

Re: REST Error Handling

2012-01-03 Thread Thomas Ploch
The Custom Exception Handler should also send out correct headers. :-) On 03.01.2012 10:06, Matteo Landi wrote: On Jan/02, Will wrote: Hi all, I'm looking for a way to return a generic error every time something goes wrong with a REST request. So for example, I would like to return a

Re: Cakephp 2.0 Missing Database Connection Solved

2011-10-25 Thread Thomas Ploch
On 25.10.2011 12:52, Ryan Schmidt wrote: On Oct 25, 2011, at 02:30, AD7six wrote: On Oct 24, 11:00 pm, Ben D'Angelo wrote: This took me hours to figure out. When I started a new CakePHP 2.0 app. I couldn't connect to the mysql database. I finally figured out you have to enable the

Re: CakePHP 2.0 Released

2011-10-19 Thread Thomas Ploch
Forever We should talk this over again in a billion years. :D On 17.10.2011 18:55, mark_story wrote: Hey Derek, My current plan is to continue releasing bugfix/maintenance releases at least until 3.0 comes out. The frequency of releases will depend on the flow of tickets though. Security

Re: passing post_id to comments

2011-10-12 Thread Thomas Ploch
You would of course have to pass the post_id manually to the view and add a hidden input field: $this-Form-input('Model.post_id', array('type' = 'hidden', 'value' = $post_id)); This way the post id will be added to $this-data and saved to the database (if the form is valid of course).

Re: CakePHP 2: Where to place exception code?

2011-10-12 Thread Thomas Ploch
Yes, a lot. And CakePHP 2.0 comes with an ExceptionRenderer that can be configured: http://book.cakephp.org/2.0/en/development/exceptions.html On 12.10.2011 13:13, flo.kl...@googlemail.com wrote: Good topic, I have neglected using exceptions in my app because I wasn't sure how to make it work

Re: cakephp 2.0 App:import

2011-10-12 Thread Thomas Ploch
Reading the migration guide properly :-) http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html On 11.10.2011 23:19, dype wrote: Hello I started to migrate my application to 2.0 I encountered the following problem. I use a twitter plugin. The file:

Re: Simple deleteAll() yet I am stuck..

2011-10-04 Thread Thomas Ploch
Hello, 1.) When posting a problem to the group, especially database related problems, posting the "some mysql error" is vital for us to help you. 2.) You are overwriting the conditions array in line 2 of your example: Try this instead (the 'AND'

Re: Simple deleteAll() yet I am stuck..

2011-10-04 Thread Thomas Ploch
`.`project_modules_id` = `ProjectModules`.`id`) LEFT JOIN `users` AS `Users` ON (`UsersModule`.`users_id` = `Users`.`id`) WHERE conditions IN ('39', '27') On Oct 4, 5:06 pm, Thomas Ploch profipl...@googlemail.com wrote: Hello, 1.) When posting a problem to the group, especially database

Re: Is this a syntax error in the 1.3 book?

2011-09-29 Thread Thomas Ploch
You don't need the semicolon if you end the PHP script block with '?'. Although you can add the semicolon, it makes no difference to the interpreter. Kind regards Thomas Am Donnerstag, den 29.09.2011, 11:00 -0400 schrieb Yves S. Garret: Just going through the book tutorial. I got to this page:

Re: Is this a syntax error in the 1.3 book?

2011-09-29 Thread Thomas Ploch
Don't apologize to me, apologize to the server hosting the mailing list :D Am Donnerstag, den 29.09.2011, 18:30 +0300 schrieb Teddy Zeenny: Sorry Thomas didn't see your answer :) On Thu, Sep 29, 2011 at 6:29 PM, Teddy Zeenny teddyzee...@gmail.com wrote: You don't need to have a

Re: Trying to convince management that Open Source is a good thing

2011-09-27 Thread Thomas Ploch
Well, in a company with 20.000 employees I can imagine that the License fees for Windows Servers (there probably are a lot of them) and MSSQL databases (There probably are a lot of them too) are pretty high. So my main argument would be the financial savings in licensing costs (running costs) that

Re: converting site/password(salt) conversion

2011-09-21 Thread Thomas Ploch
Hi, you would need to implement a password logic that prepends/appends (you would need to check with the supplier how the salt was applied and which hash algorithm was used, md5, sha1, etc...) the salt to the user password input and check the resulting hash with the hash in the database. I

Re: Using Auth To Limit Results

2011-09-21 Thread Thomas Ploch
Taking that you are new to CakePHP this might be a bit too hard to digest, but I recommend at least reading this article: http://jmcneese.wordpress.com/2009/04/19/rmac-ftw-part-1/ http://jmcneese.wordpress.com/2010/01/28/rmac-is-dead-long-live-rmac/ This is implementing UNIX-style permissions

Re: Undefined property Component::$Session

2011-09-20 Thread Thomas Ploch
. On Sep 19, 8:33 am, heohni heidi.anselstet...@consultingteam.de wrote: Oh that's cool! I didn't know this bin... translator componenthttp://bin.cakephp.org/view/666573507 On 19 Sep., 15:17, Thomas Ploch profipl...@googlemail.com wrote: Please bin your TranslatorComponent

Re: Oop Question? - accessing protected model methods from behaviours.

2011-09-19 Thread Thomas Ploch
Well, you can just use the public method `public Model::delete($id = null, $cascade = true)`, which will call `protected _Model::_deleteDependent($id, $cascade)`. Basically this is just a search and replace operation in the Behavior's code. Kind regards Thomas Am 19.09.2011 09:36, schrieb

Re: Oop Question? - accessing protected model methods from behaviours.

2011-09-19 Thread Thomas Ploch
Well, or you just use Model::delete() with the cascade parameter set to true. This is the cakephp way to do it, no need to add another wrapper method, since Model::delete already is the wrapper for this method... Kind regards Thomas Am 19.09.2011 10:38, schrieb Zaky Katalan-Ezra: It looks

Re: Undefined property Component::$Session

2011-09-19 Thread Thomas Ploch
Load the SessionComponent as the first component in the AppController::$components array, since the other components (obviously) depend on the SessionComponent. Kind regards Thomas Am 19.09.2011 13:58, schrieb heohni: Hi, I struggle now for 2 days on this problem: app_controller: var

Re: Undefined property Component::$Session

2011-09-19 Thread Thomas Ploch
Is the SessionComponent loaded in the TranslatorComponent? http://book.cakephp.org/view/996/Creating-Components#Including-Components-in-your-Controllers-997 Kind regards Thomas Am 19.09.2011 14:07, schrieb heohni: Hi, even with this in app_controller: var $components = array('Session',

Re: Undefined property Component::$Session

2011-09-19 Thread Thomas Ploch
Woops, last message contained a wrong link, this is the correct one: http://book.cakephp.org/view/996/Creating-Components#Using-other-Components-in-your-Component-999 Am 19.09.2011 14:07, schrieb heohni: Hi, even with this in app_controller: var $components = array('Session', 'P28n',

Re: Undefined property Component::$Session

2011-09-19 Thread Thomas Ploch
Please bin your TranslatorComponent code to: http://bin.cakephp.org and post the url to the group so we can check what's going wrong. Kind regards Thomas Am 19.09.2011 14:14, schrieb heohni: No, it wasn't. I added this line class TranslatorComponent extends Object{ var $components =

Re: Cascade delete and HABTM

2011-09-19 Thread Thomas Ploch
Have you set the 'dependent' key in *both* relationship configurations? Kind regards Thomas Am 19.09.2011 16:32, schrieb xamako: Hi! I have the following relationship between HABTM tables: - services - service_categories - Servicecategories_services (the latter is what links the two tables

Re: General question

2011-09-16 Thread Thomas Ploch
Well, using requestAction is only recommended in combination with caching. So using the cached element with requestAction inside the element is the way to go in my oppinion. The other possibility is loading the Language Model in AppController, setting the languages var in

Re: Rendering an element with Jquery

2011-09-14 Thread Thomas Ploch
The easiest way would be an AJAX action that renders the element with the given POST data. The you can just use the rendered HTML and inject it into the DOM. Kind regards Thomas Am 14.09.2011 16:55, schrieb 8vius: Hey all, got a little problem here. I wanna do something similar to what

Re: Rendering an element with Jquery

2011-09-14 Thread Thomas Ploch
As an addition, check out http://book.cakephp.org/view/980/render Am 14.09.2011 17:14, schrieb 8vius: Can you be a little more explicit? I have my ajax action set up that will return a json encoded array. How can I get the html for the element from my controller? Maybe some example code? I'm a

Re: Rendering an element with Jquery

2011-09-14 Thread Thomas Ploch
The RequestHandler Component is not doing any requests, it just verifies that the current request indeed is an AJAX request, so you can check in an action and i.e. render an element with an AJAX layout instead of rendering the whole view. You can of course generate the HTML with javascript

Re: Rendering an element with Jquery

2011-09-14 Thread Thomas Ploch
erm, the same as you would set it to any other view: ?php function action() { [...] // inside your action $myArray = array('tweet' = 'feep feep feep'); // or $myArray = json_decode($yourJsonObject, true); // Set the variable just like any other var

Re: ckaephp 2.0 using Configure::read in model construct method

2011-09-09 Thread Thomas Ploch
Hi, since you are setting Model::actsAs before the parent Model is initialized this is doomed to fail. Try the following: function __construct($id = false, $table = null, $ds = null) { parent::__construct($id, $table, $ds); $this-actsAs['Revision']['limit']

Re: How safe is CakePhps auth component and other ..

2011-09-09 Thread Thomas Ploch
1.) The Auth component is safe. It uses a salted SHA1 encrypted pw by default. It auto-escapes the fields already, so you don't have to bother with it. Just use SSL to encrypt the connection to sensitive parts of the application to be on the (very) safe side. 2.) Well, if you use the Apache

Re: Code reivew of EAV Behavior

2011-09-02 Thread Thomas Ploch
I am liking this as well (since I am doing a lot of stuff for clients with magento), though I think this should be bundled in a plugin, don't you think? This way you can easily drop this into any existing project. Regards Thomas Am 01.09.2011 11:13, schrieb Jeremy Rottman: I have spent a bit

Re: afterFind : possible to get query type?

2011-08-22 Thread Thomas Ploch
Look at Model::findQueryType :-) Am 22.08.2011 15:56, schrieb Anja Liebermann: Hello, is there a possibility to know which query type ( first, all, count etc...) was used, when I call afterFind()? Depending on the query Type I would like to make different checks. If it is not possible,

Re: afterFind : possible to get query type?

2011-08-22 Thread Thomas Ploch
The findQueryType is reset before afterFind() is executed. So assigning the value to a class var in beforeFind() and reading it in afterFind() should work. :-) Am 22.08.2011 16:33, schrieb Anja Liebermann: did that. It is always NULL :( Anja Am 22.08.2011 16:25, schrieb Thomas Ploch: Look

Re: afterFind : possible to get query type?

2011-08-22 Thread Thomas Ploch
that. It is always NULL :( Anja Am 22.08.2011 16:25, schrieb Thomas Ploch: Look at Model::findQueryType :-) Am 22.08.2011 15:56, schrieb Anja Liebermann: Hello, is there a possibility to know which query type ( first, all, count etc...) was used, when I call afterFind()? Depending on the query Type I

Re: afterFind : possible to get query type?

2011-08-22 Thread Thomas Ploch
= $this-_getSearchConditions($search); $cond is an array, to which other conditions are added before it goes via beforeFind and afterFind to the view as a paginated result. Anja Am 22.08.2011 16:45, schrieb Thomas Ploch: Woops, actually Model::findQueryType is __not__ reset before afterFind() is triggered

Re: couchDB datasource

2011-07-13 Thread Thomas Ploch
Hi, I am currently doing the same for my company as well. You are going to face a bit of trouble here, since I can't see how you model your couchdb views to fetch relations. See an introduction on Entity Relations with couchdb views here: http://wiki.apache.org/couchdb/EntityRelationship As an

Re: couchDB datasource

2011-07-13 Thread Thomas Ploch
As an addition to my last post, here is what I am currently doing: - Develop a special CouchDB Model that application models will extend - Add a required docType field to the Models (might be defaulting to Model::$alias) to check for in automatically created views. - In the CouchDB Model

Re: separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-06 Thread Thomas Ploch
/1692840979 in case you prefer paste. my file in app/libs is array_2_iterator_aggregate.php the code inside that file is found here. http://bin.cakephp.org/view/1592385093 On Jul 5, 8:18 pm, Thomas Ploch profipl...@googlemail.com wrote: Hello, well, I would set the Arrays that should

Re: wizard component multiple

2011-07-06 Thread Thomas Ploch
Yes, a very easy way would be how it is supposed to be: 1 Controller for 1 Wizard. 2 Controllers for 2 Wizards. End of story :) I think making the Wizard Component work for this case is more hassle then just use seperate Controllers. Regards Thomas Am Mittwoch, den 06.07.2011, 10:50 -0300

Re: Retrograde counterCache

2011-07-06 Thread Thomas Ploch
Wouldn't a simple find('all') saveAll() script do the trick? Am Mittwoch, den 06.07.2011, 18:29 +0100 schrieb Jeremy Burns | Class Outfit: Doesn't his question relate to populating the counterCache fields with the right values on creation, rather than maintaining it? Jeremy Burns Class

Re: separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-05 Thread Thomas Ploch
Well, you would not do it on the Behavior itself, since you want to pass the object to the view. Probably a static method as in your example that converts the find array into an object that implements IteratorAggregate (probably 'app/lib' is the best place for this). Then in

Re: separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-05 Thread Thomas Ploch
, 6:53 pm, Thomas Ploch profipl...@googlemail.com wrote: Well, you would not do it on the Behavior itself, since you want to pass the object to the view. Probably a static method as in your example that converts the find array into an object that implements IteratorAggregate (probably 'app

Re: After failed validation, empty always captcha input field

2011-07-01 Thread Thomas Ploch
Hello, just set $this-data['Model']['captcha_field'] = null if your validation fails. This way the field will be empty in the view. Dunno what key 'empty' you mean, since validation rules don't have an 'empty' key available. Regards, Thomas Am Freitag, den 01.07.2011, 04:18 -0700 schrieb

Re: CakeFest?

2011-07-01 Thread Thomas Ploch
, Thomas Am Mittwoch, den 29.06.2011, 08:57 -0500 schrieb Larry E. Masters: Thomas, Submit a talk, you still have a few days :) -- Larry E. Masters On Wed, Jun 29, 2011 at 8:14 AM, Thomas Ploch profipl...@googlemail.com wrote: Larry, well, the schedule being

Re: CakeFest?

2011-06-29 Thread Thomas Ploch
I am asking that myself... We are thinking about going to Manchester, but I really hope that there will be some more information soon. Am Mittwoch, den 29.06.2011, 04:03 -0700 schrieb Jeremy Burns: What's the latest with CakeFest (64 days to go)? There are no schedule details, no news items

Re: CakeFest?

2011-06-29 Thread Thomas Ploch
, 2011 at 6:22 AM, Thomas Ploch profipl...@googlemail.com wrote: I am asking that myself... We are thinking about going to Manchester, but I really hope that there will be some more information soon. -- Our newest site for the community

Re: CakeFest?

2011-06-29 Thread Thomas Ploch
Hehe, done :) Am Mittwoch, den 29.06.2011, 08:57 -0500 schrieb Larry E. Masters: Thomas, Submit a talk, you still have a few days :) -- Larry E. Masters On Wed, Jun 29, 2011 at 8:14 AM, Thomas Ploch profipl...@googlemail.com wrote: Larry, well

Re: cakephp 1.3.10 - URL rewriting is not properly configured on your server

2011-06-22 Thread Thomas Ploch
This message will also appear on fatal errors during home page rendering. i.e. the call to check for database connection is sometimes in some circumstances raising Fatal Errors. Am Mittwoch, den 22.06.2011, 11:30 +0100 schrieb Jeremy Burns | Class Outfit: I just experienced this when setting up

Re: Where should i contact right people in CakePHP.org because this security critical problem

2011-06-21 Thread Thomas Ploch
OMG, I certainly could connect to __several__ mysql servers found with this google query. Although I agree that this is a developer's mistake, I am sure that there are a lot of unskilled developers that are doing this because they just dont know it better. So removing those values from the

Re: CakePHP App - server switch causing phpMySQL extreme query speed/results variants (but my query IS returning results as expected)

2011-05-23 Thread Thomas Ploch
Did you try raising the memory limi in php.ini? Am Montag, den 23.05.2011, 10:40 -0700 schrieb OldWest: AD, That earlier thread number of 10563105635 was not a full number, it was accidentally 3 cols combined by paste. If you look closely, both sets of numbers are identical: Error