DbAcl Failed ARO/ACO node lookup (SOLVED accidentally)

2010-12-29 Thread John Maxim
~~ERROR msg~~ Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references: Aro: User::44 Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273] ~~ The error is shown above. I solved this accidentally, maybe someone could rectify if my solution is

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-29 Thread John Maxim
Hi cricket ! you're awesome, thanks your working and explanation solved the puzzle I had.. Amit, I will check that link out..thanks too. Regards, Maxim On Dec 30, 12:54 pm, Amit Badkas wrote: > Hi, > > By default, Auth component redirects to referrer page (if set) otherwise to > the page set i

Re: using onmouseup to update database

2010-12-29 Thread Amit Badkas
Hi, The code doesn't seem to be as per CakePHP standard. However, you need to handle onchange event of a select to save the selected option (probably using an AJAX request). Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 30, 2010 at 12:58 AM, roundrightfarm wrote:

Re: is it possible to include the failed input string in the validation message?

2010-12-29 Thread Greg Skerman
Bit of a moot point for me... was using Username as an example, but its actually not a username, so the only validation rule I have on the field is isUnique... also not using localization... having said that, would be nice if the model validation rules supported returning the input string in the m

Re: Save and Loops

2010-12-29 Thread Amit Badkas
Hi, You said that first and last iterations failed to insert. Was there any errors outputted? Try to output $this->Enrollment->Appointment->validationErrors array for failed data. Please remember to test this with debug level 2 so that it will output errors (if any) as well as SQL queries. Amit B

Re: post form data from URL

2010-12-29 Thread Karthikeyan P
I guess I got your question correctly, what u want to do is Pre-Populate the form on loading I think you have to see the EDIT function in the BLOG tutorial of cakePHP. There we actually PRE-POPULATE the data on the EDIT page . Thanks Karthikeyan P On Thu, Dec 30, 2010 at 8:14 AM, Steve Mallett w

Re: URGENT - Help needed - Model Association

2010-12-29 Thread Karthikeyan P
John I think the class name conventions are correct as the code is a generated one ..I didn't write the code.It was generated by "cake bake" command . *" Model 'Comment' has a 'comments' table, not a 'Comments' table. "* I have not defined anywhere as *Comments* Table..I have done as *comments

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-29 Thread Amit Badkas
Hi, By default, Auth component redirects to referrer page (if set) otherwise to the page set in loginRedirect. So you may need to overwrite 'Auth.redirect' session parameter. FYI, please have a look at http://book.cakephp.org/view/1270/loginRedirect Amit Badkas PHP Applications for E-Biz: http:

Re: Problems Creating Shells (Tutorial)

2010-12-29 Thread John Maxim
> Go to /orders/add and add some > orders to the database. Hi, may I know does it mean going to app/views/orders/add.ctp which is a file we need to manually create or does it auto-create ? >Is your app called 'app' ? I'm not sure what you mean, my root folder is named cakephp, in there I have:

Re: Problems Creating Shells (Tutorial)

2010-12-29 Thread John Maxim
Hi John L and John lyles, Fixed it by simply creating the table following John L's table's description. After that I got undefined PHP error which I placed what John L's fix in his last post. I ran cake report> and I got empty results: C:\wamp\www\cakephp>cake report ♀ Welcome to CakePHP v1.3.6

post form data from URL

2010-12-29 Thread Steve Mallett
Hi, How do I pass data to a Form from the URL? I have add.ctp: Form->input('url', array( 'type' => 'text', 'value' => $this->params['url'] )); ?> Hitting localhost/links/add?url=http://cakephp.org produces the following error:

Re: Where to store email configuration

2010-12-29 Thread cricket
On Tue, Dec 28, 2010 at 5:22 PM, gilsilas wrote: > hey, > > I want to send mail from different controllers in my application, > and I wondering how to do that without declare the Email component > data ( smtpOptions, from, etc ) in any method I want to send mail > from. > > The app_controller is n

Re: MAX() in query

2010-12-29 Thread nurvzy
http://book.cakephp.org/view/1030/Complex-Find-Conditions That should help you, read through how to build complex conditions with subqueries and build the conditions array described. Once you have your conditions array just pass it to $this- >paginate($conditions); You should be all set. Hope t

Re: URGENT - Help needed - Model Association

2010-12-29 Thread john lyles
If the model names are Post and User then the table names should be 'posts' and 'users' lowercased. The field name is 'user_id' not 'UserId'. Model 'Comment' has a 'comments' table, not a 'Comments' table. You have to respect CakePHP's File and Classname conventions, see section 2.4.1 in the manual

Re: is it possible to include the failed input string in the validation message?

2010-12-29 Thread john lyles
>> But wouldn't this error message be displayed when *any* validation error >> with the username field occurs? What if I also have validation checks for >> whether it's >>empty, whether it's too short, whether it includes invalid >> characters? Anyway, wouldn't I want to specify validation error

Re: pagination SELECT COUNT(*) query slow

2010-12-29 Thread Andras Kende
Hello, Indexing the foreign keys would be ideal too.. Also you could override the core paginateCount, so its will not join 6 tables at the count(*) query http://book.cakephp.org/view/1237/Custom-Query-Pagination I did it this way, its handled by the 'extra': controller: $this

Re: Unable to get Template in my first page(configure problem)

2010-12-29 Thread Ryan Schmidt
On Dec 29, 2010, at 05:32, Aniruddh wrote: > I need to work in an existing project developed in cake PHP 1.2. I am > trying to configure my project in my local system. But i am unable to > see the template in my first page. when i submit my first page form, > it says Object not found! > > The p

Re: pagination SELECT COUNT(*) query slow

2010-12-29 Thread Ryan Schmidt
On Dec 29, 2010, at 13:00, arron wrote: > So i have a relationship table that has 6 tables the primary id is > indexed as well as the models that paginate is using . > > > The problem i am having with pagination is when i edit a row or add a > row the SELECT COUNT(*) query takes forever aroun

Re: is it possible to include the failed input string in the validation message?

2010-12-29 Thread Ryan Schmidt
On Dec 29, 2010, at 11:24, john lyles wrote: > If your form looked something like this you would get the result you > are looking for: > echo $this->Form->input('username', array('error' => > $this->data['User']['username'] . ' is taken')); And of course if you wanted that to be localizable: e

using onmouseup to update database

2010-12-29 Thread roundrightfarm
I have a drop down menu in a view and I'm wondering if i can send data based on the selected result to my database when it is selected onmouseup. the s are populated from the optional_share_products table. I'd like to send data about the selected product (actually Item.id) to the optional_share_u

pagination SELECT COUNT(*) query slow

2010-12-29 Thread arron
So i have a relationship table that has 6 tables the primary id is indexed as well as the models that paginate is using . The problem i am having with pagination is when i edit a row or add a row the SELECT COUNT(*) query takes forever around 11956MS it also maxes out my CPU for about 8 seconds

MAX() in query

2010-12-29 Thread vasquinho
I have a table of a number of issues id, number, year, user_id 1 | 1 | 2009 | 1 2 | 2 | 2009 | 1 3 | 3 | 2009 | 1 4 | 1 | 2010 | 1 5 | 2 | 2010 | 1 and for each user_id I want to retrieve the greatest number grouped by year. I could solve my problem with the following query: SELECT `Issue`.`id`

URGENT - Help needed - Model Association

2010-12-29 Thread pinastro
I have created a Blog Application using a base table as 'Posts'. Later Model-Associated with another table 'Users' with 'belongsTo' relationship like below in the MODEL var $belongsTo = array( 'User' => array( 'className' => 'User', 'foreignKey' => 'user_id', 'conditions' => '', 'fields' => '', 'o

Unable to get Template in my first page(configure problem)

2010-12-29 Thread Aniruddh
Hi, I need to work in an existing project developed in cake PHP 1.2. I am trying to configure my project in my local system. But i am unable to see the template in my first page. when i submit my first page form, it says Object not found! The project was in the server like : http://sitename.co

Save and Loops

2010-12-29 Thread Mark
Hi everyone, I just need some help on inserting records using loops. To give you an overview, I have programs that run for a certain number of days and this code will insert a separate row for each appointment record. The problem is that the loop fails at the first iteration. Another weird thing

Where to store email configuration

2010-12-29 Thread gilsilas
hey, I want to send mail from different controllers in my application, and I wondering how to do that without declare the Email component data ( smtpOptions, from, etc ) in any method I want to send mail from. The app_controller is not an option because the Email component is use only in few cont

Re: Scaffolding vs Bake

2010-12-29 Thread Larry E. Masters
Larry pointed this out earlier > > >> you might add a new table to your database, it is easier to create the >> controller/model combination while you are creating all of the fields in >> your new table and see how it is working instead of going to the command >> line every change you make. > > > s

Re: Scaffolding vs Bake

2010-12-29 Thread Sam Sherlock
Larry pointed this out earlier > you might add a new table to your database, it is easier to create the > controller/model combination while you are creating all of the fields in > your new table and see how it is working instead of going to the command > line every change you make. scaffolding

Re: Owner Check - FORGET IT

2010-12-29 Thread cricket
On Wed, Dec 29, 2010 at 2:46 PM, Dave Maharaj wrote: > Ok well if someFunction is getting the $id of being asked and the conditions > are getting the record where $id = Model.id and Model.user_id = Auth then is > that not checking? How is that different than read id then compare the data? > > If t

RE: Owner Check - FORGET IT

2010-12-29 Thread Dave Maharaj
Ok well if someFunction is getting the $id of being asked and the conditions are getting the record where $id = Model.id and Model.user_id = Auth then is that not checking? How is that different than read id then compare the data? If there is no "match" with id and auth nothing is pulled correct..

JS Helper - getting value of a select

2010-12-29 Thread Greg Skerman
Ok, so i'm trying to break old habits of putting all my javascript in a file, and have decided to try out the JS helper. Basic rundown is a form with a select, that loads other elements of the form via Js->request based on the selection in the select box. is there a way to get the value of the se

Re: is it possible to include the failed input string in the validation message?

2010-12-29 Thread Greg Skerman
thanks! On Thu, Dec 30, 2010 at 3:24 AM, john lyles wrote: > You can override the error message using FormHelper :http:// > book.cakephp.org/view/1401/options-error > If your form looked something like this you would get the result you > are looking for: > echo $this->Form->input('username', arra

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-29 Thread cricket
On Tue, Dec 28, 2010 at 11:58 PM, John Maxim wrote: > Users_controllers.php: > > > var $name = 'Users'; > > /*some codes in between*/ > > function login() > { >         if(!empty($this->data)) >        { >                 // If the username/password match >                 if($this->Auth->log

Re: Owner Check

2010-12-29 Thread cricket
On Wed, Dec 29, 2010 at 12:23 AM, Dave Maharaj wrote: > > Because in the first example the $id will read from the db no matter what as > long as $id is passed and $id is in the db so your going to the db no matter > what and reading the data. > In my way with $data = $this->Model->someFunction( $i

Re: Scaffolding vs Bake

2010-12-29 Thread John L
Why is scaffolding an option when baking since baking CRUD actions and views is so easy? This I never understood 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 Gr

Re: Scaffolding vs Bake

2010-12-29 Thread John L
Why is scaffolding an option when baking since baking when CRUD actions and views is so easy? This I never understood 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 Goog

Re: Problems Creating Shells (Tutorial)

2010-12-29 Thread John L
This table works for the tutorial: CREATE TABLE orders( id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, amount DEC(5,2), created DATETIME, shipped DATETIME ); Then bake the model, controller and views. Go to /orders/add and add some orders to the database. Assuming the cake command is in your PA

Re: Problems Creating Shells (Tutorial)

2010-12-29 Thread john lyles
Do you have a model called Order and a database table called orders? And if you do, does your table have the fields the error message says are missing. The tutorial doesn't say (but maybe it should this stuff needs to exist). On Dec 29, 12:36 pm, john lyles wrote: > Is your app called 'app' ? Als

Re: Problems Creating Shells (Tutorial)

2010-12-29 Thread john lyles
Is your app called 'app' ? Also if you do only the first step of the tutorial, this part, and then do: cake report, what happens then? On Dec 29, 11:33 am, John Maxim wrote: > I'm suspecting something's wrong with my paths: > ~~~ > ♀ > Welcome to CakePHP v1.3.6 Console > -

Re: is it possible to include the failed input string in the validation message?

2010-12-29 Thread john lyles
You can override the error message using FormHelper :http:// book.cakephp.org/view/1401/options-error If your form looked something like this you would get the result you are looking for: echo $this->Form->input('username', array('error' => $this- >data['User']['username'] . ' is taken')); On Dec

Re: Scaffolding vs Bake

2010-12-29 Thread Greg Skerman
I find scaffold is useful when mucking about with the data model... once i'm happy with that i go back and bake out the basic CRUD and go from there. On Thu, Dec 30, 2010 at 2:26 AM, John Maxim wrote: > Hi everyone, > > Thanks I'm learning Bake at the moment. I thought scaffolding can be > used

Re: Setflash change background color

2010-12-29 Thread john lyles
You are not telling it to look in the right place. You are giving a location of .message but in fact it is located at div.message, the div in this case being div id="content". Remove this div and then .message would make sense. It also matters if you put your styles before or after you include the

Re: Problems Creating Shells (Tutorial)

2010-12-29 Thread John Maxim
I'm suspecting something's wrong with my paths: ~~~ ♀ Welcome to CakePHP v1.3.6 Console --- Current Paths: -app: app -working: C:\wamp\www\cakephp\app -root: C:\wamp\www\cakephp -core: C:\wamp\www\cakephp Changing Paths: your working

Re: Scaffolding vs Bake

2010-12-29 Thread John Maxim
Hi everyone, Thanks I'm learning Bake at the moment. I thought scaffolding can be used for production. Anyway thanks for clarifying. Regards, Maxim On Dec 30, 12:12 am, "Larry E. Masters" wrote: > I would not use scaffolding in production, it was never intended for that > purpose. It has nothin

Problems Creating Shells (Tutorial)

2010-12-29 Thread John Maxim
http://book.cakephp.org/view/1107/Creating-Shells-Tasks Hi, While going through the tutorial above, as I run >cake report Error: Missing database table 'orders' for model 'Order' - Do we need to create one ? I created one but just to find out more errors after running the second

Re: Scaffolding vs Bake

2010-12-29 Thread Larry E. Masters
I would not use scaffolding in production, it was never intended for that purpose. It has nothing to do with security or being unstable. The only purpose for scaffolding is to prototype and develop your models/database. Bake is used to get you closer to a production code base. You can customize y

is it possible to include the failed input string in the validation message?

2010-12-29 Thread Greg Skerman
Hi, I'm trying to make my validation messages a little more meaningful. I would like to include the failed input in the validation message itself. So rather than a message like "That username is already taken" I would like to show "The username is already taken" Is this possible? Check out th

Setflash change background color

2010-12-29 Thread lvdb
Hello, I want to change the appearance of the default message (edit success). I have put the following code in the standard layout: .message { position:absolute; top:0px; left:100px; width:300px; font-size:14px; background-color:green; } It works but the backgroun

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Thanks Sam, that youtube tutorial helped. I'm continuing with the link you sent earlier, right after finishing the cookbook soon..hopefully. Regards, Maxim On Dec 29, 10:07 pm, Sam Sherlock wrote: > setting cake for commandline is easy - don't be put off > > it take minutes > > windows or *nix (

Re: Can we mix plain php,html and cakephp?

2010-12-29 Thread prithvi adhikari
yes sir. i got it... The bottm line is.. The naming CONVENTIONS must be kept in mind... I got errors about undefined variables in my view. And when i Corrected some variable names in the controller, it worked fine!!! On Wed, Dec 29, 2010 at 7:58 PM, Renato de Freitas Freire < renat...@gmail.com>

Re: Scaffolding vs Bake

2010-12-29 Thread Felipe Roman
Hi John, The main difference between scaffold and bake is bake will generate the PHP code (model, controller,view) and you can customize it how you want. When I'm developing I start using bake to generate all CRUD and after I start to change the generated code. If the scaffolding is OK for you (w

Re: Scaffolding vs Bake

2010-12-29 Thread Larry E. Masters
Scaffold was implemented before bake was added to the core so it has stayed. There are cases when you might add a new table to your database, it is easier to create the controller/model combination while you are creating all of the fields in your new table and see how it is working instead of goin

Re: Can we mix plain php,html and cakephp?

2010-12-29 Thread Renato de Freitas Freire
E point is: Cakephp IS PHP. Of course you can use cake + php. There is no meaning your question. Did you even tried to do what you are asking? You have the full power of your application in your hands. If you want to write some specific code (html or php), just do it! Got it? On Wednesday, De

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Sam Sherlock
setting cake for commandline is easy - don't be put off it take minutes windows or *nix (these require quicktime - I think) http://cakephp.org/screencasts or (windows setup on youtube) http://www.youtube.com/watch?v=21Rt9HgITig&feature=related you won't regret setting this up - it opens so many

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Hi Sam, I tried quite a number of times logging in IRC on cake but there were always connection failure or something..given up and use googlegroup as of now.. I can't carry on with the link you recommended; it asks me to be familiar with console, I'm not, I don't know what/how exactly to begin wi

Scaffolding vs Bake

2010-12-29 Thread John Maxim
Hi, I used scaffolding.. it was quite easy and fast. But I learned that Bake is a better way... Any comment why there is scaffold in the first place since it would be replaced with Bake later on when developing a programme? Regards, Maxim Check out the new CakePHP Questions site http://cakeqs.

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Sam Sherlock
you'll find that ACL is a heavy task. setting up a dummy application (own db files etc) -- deleting and reinstating things over and over will make things clearer trail and error extremely useful when learning ACL. if you back up the db in between and compare what differences after doing things

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Thanks Sam, it's clearer now...but still struggling with Acl; I was confused when I hear the word "populate" a general term. In oracle, I populated db/tables/sql scripts in a batch file, last time. So it brought me a meaning of the same when I hear it again. Now I know it could mean using command l

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Sam Sherlock
Hi John, you want to setup cake so you can use it from commandline bake is one part of cakes commandline also acl too: (output from commandline) $ cake acl Available ACL commands: - create - delete - setParent - getPath - check - grant

Re: admin edit points featured videos, groups, etc...

2010-12-29 Thread Amit Rawat
Hi Chris, You need to adjust the way you update in controller function admin_points() { if($this->data) { $this->FocikiUser->id = 'id which you want to update'; $this-> FocikiUser->setField('featured_video_points ',$this->data['User']['featured_video_points']); } $result=$this->F

admin edit points featured videos, groups, etc...

2010-12-29 Thread chris...@yahoo.com
Hi guys, How yo.. guys doinnn... I need help calling "$point" from User Table... I'm getting this error... Notice (8): Undefined index: data [CORE/app/controllers/ videos_controller.php, line 17] Apparently, I admit,.. lol... I don't know how to do this in CAKE. Can some one please help... This is

Re: Can we mix plain php,html and cakephp?

2010-12-29 Thread Sam Sherlock
Another reason to use the form helper is the error handling if your marking the form yourself you'd lose this. Taking the time to learn to use the form helper really pays off. - S On 29 December 2010 04:08, cricket wrote: > On Tue, Dec 28, 2010 at 3:27 PM, euromark > wrote: > > no, you c

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Is Bake continued from scaffolding ? can I jump straight to learn Bake ? Must we use Bake to populate the Acl tables ? Regards, Maxim On Dec 29, 6:12 pm, Amit Badkas wrote: > Hi, > > My question was 'are the ACL tables (aros, acos and aros_acos) populated > correctly?', please refer > tohttp:

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi, My question was 'are the ACL tables (aros, acos and aros_acos) populated correctly?', please refer to http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application to understand how to populate ACL tables. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 2

Google adword help

2010-12-29 Thread Amit Rawat
Hi, Can anyone tell me how to get data(scrap it) from google adword keyword tool for a particular keyword? Thanks and Regards, Amit 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 subscr

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Thanks Amit, Yes, the first undefined: is solved, I posted a post before yours. I ran the DB sql scripts with no error. The sql is as follow: CREATE TABLE acos ( id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, parent_id INTEGER(10) DEFAULT NULL, model VARCHAR(255) DEFAULT '', forei

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
> Notice (8): Undefined index: content [APP\views\posts\index.ctp, line > 7] ~ Solved the error above, just minor mistake.. Now left unsolved is: > Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in > permissions check. Node references: > Aro: User::44 > Aco: Post [CORE\cake\

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi, About 'Undefined index: content' error, you should already know how to fix it. About 'DbAcl::check() - Failed ARO/ACO node lookup in permissions check' error, are the ACL tables (aros, acos and aros_acos) populated correctly? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Hi Amit, Thanks...! I just put it in the controllers components--access.php: -- user = $this->Auth->user(); } function check($aco, $action='*'){ if(!empty($this->user) && $this->Acl->check('User::'.$this- >user['User']['id'], $aco, $action)){

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi, Have you had AccessComponent class defined in app/controllers/components/access.php? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 29, 2010 at 1:30 PM, John Maxim wrote: > class AccessHelper extends Helper{ >var $helpers = array("Session"); >

HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Access = new AccessComponent(); App::import('Component', 'Auth'); $this->Auth = new AuthComponent(); $this->Auth->Session = $this->Session; $this->user = $this->Auth->user(); } function check($aco, $action='*'){