Re: Scaffold & insert: session problem

2007-04-16 Thread bono
Solved, I had validate_empty in id field :) thanks John! PS. There is no way to edit own post titles here? Would be nice habit to put some status marks to them (Solved: Scaffold & insert: session problem) On Apr 17, 12:08 am, John David Anderson <[EMAIL PROTECTED]> wrote: > On Apr 16, 2007, at

Fatal error in db_acl.php

2007-04-16 Thread MCA
Hi, I'm experiencing the following fatal error on a Sun Solaris box running PHP 4.3.10 Fatal error: Call to member function on a non-object in /cake/libs/ controller/components/dbacl/db_acl.php Which relates to the following line of code $perms = $Perms->findAll(array('ArosAco.aro_id' => $

mod_rewrite Problem

2007-04-16 Thread Vishal
Hi there, This is my forst time with cake PHP and this what I have done so far 1. I have unzip the cakePHP package under /var/www/html/cake... 2. I have change the database.php file and now when I go to URL www.**.com/cake, it shows me the index page (without CSS and images) which says Your d

RE: Call to a member function read() on a non-object in when TEST

2007-04-16 Thread Mariano Iglesias
If you download latest CakePHP 1.2 revision there's now a new method to call CakePHP urls from any test case that inherits CakeTestCase. Take a look at method requestAction() in this changeset: https://trac.cakephp.org/changeset/4863 Let's say we have the following controller: Article->findAll(n

Re: if I use render() ,does the rest codes in action exec?

2007-04-16 Thread [EMAIL PROTECTED]
thx for clarifying that. On 4月17日, 上午11时50分, nate <[EMAIL PROTECTED]> wrote: > Yes, if you render() or redirect() mid-action, the rest of the action > will execute after the view is rendered or the header is written, > respectively. If you don't want that to happen, you should either > return; o

Re: if I use render() ,does the rest codes in action exec?

2007-04-16 Thread nate
Yes, if you render() or redirect() mid-action, the rest of the action will execute after the view is rendered or the header is written, respectively. If you don't want that to happen, you should either return; or exit(); On Apr 16, 10:38 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > if I

RE: Call to a member function read() on a non-object in when TEST

2007-04-16 Thread Mariano Iglesias
Of course it will, hard to find stuff from nate that doesn't ;) Though you will run into trouble when your controller uses Components, or has callbacks (such as beforeRender.) Once again the best way I see now is to use Object::requestAction(), which in fact uses Dispatcher::dispatch(), which in

Request on New Ticket Submissions

2007-04-16 Thread nate
Hey y'all, In order to make the bug tracking and fixing process more of a community effort, we'd like to encourage people to attach unit tests to new bug tickets going forward. Unit tests help us identify the exact source of the bug (which isn't always immediately apparent: a bug may seem like i

blog tutorial problem

2007-04-16 Thread SIXS
I copied the code and got the first page to run showing the files. I clik on add and I dont find the page, but I see the page add. I do the edit and the delete and the same. problem I have cake installed in wamp/www/cake. blog is installed in the app older. I run winxp, mysql, apache and php5.

if I use render() ,does the rest codes in action exec?

2007-04-16 Thread [EMAIL PROTECTED]
if I use render() ,does the rest codes in action exec? if so,do I need to do return after render()? what about redirect()?does the codes after redirect() in action exec? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

view issue

2007-04-16 Thread EricS
I have another newbie question... thanks for everyones patience. I have 2 tables and 2 models. its a hasmany relationship ie restaurant has many specials. While I do want to keep a history of all the past specials I only want to display the most current one. In my controller I have: $this->

Re: Call to a member function read() on a non-object in when TEST

2007-04-16 Thread [EMAIL PROTECTED]
@nate your method works thx. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PR

Re: Writing a test case for controller->params (special characters truncate routes)

2007-04-16 Thread GreyCells
After much digging, I'm now able to sort of answer myself, in case anyone else hits this. I don't think this is a cake issue - which is why the router/dispatcher tests pass OK. The problem appears to stem from the .htaccess - the 'url' is derived from the $1 (i.e. everything after the domain name)

Re: login maintain page?

2007-04-16 Thread John David Anderson (_psychic_)
On Apr 16, 2007, at 5:54 PM, Aaron Thies wrote: > > If I have a simple login form in my header and I want to have the page > maintained so if I am on site.com/user/profile and try to login here I > have an error I will be shown the errors on site.com/user/profile > instead of being forced back t

Re: Help getting rid of strange link issue

2007-04-16 Thread Kio
Thanks a bunch! I knew someone around here would be able to steer me to an answer. Not quite sure I fully understand the hows and whys, but adding: ini_set("url_rewriter.tags",""); ini_set('session.use_trans_sid', false); to bootstrap.php seems to have cleared it up. On Apr 16, 12:47 pm, "Sa

Scaffolding question

2007-04-16 Thread surge
Hi everybody, Let's say I have table "student" and "customer". A customer can have many students and students are unique to a customer. The scaffolded edit page of a student includes a dropdown of all customers -- I included "customer" to the belongsTo relationship of the student model -- and I

Scaffolding question 2

2007-04-16 Thread surge
Another question about scaffolding: Let's say I have table "student" and two other tables: "student_awards", and "award_types". Here's an approximate description of each table: student (id, name), student_awards (id, student_id, award_id) award_types (id, award_name) The idea is that a student

login maintain page?

2007-04-16 Thread Aaron Thies
If I have a simple login form in my header and I want to have the page maintained so if I am on site.com/user/profile and try to login here I have an error I will be shown the errors on site.com/user/profile instead of being forced back to site.com/user/login? -- Aaron Thies "When you're marrie

View this page "Cake Apps/Sites In The Wild"

2007-04-16 Thread [EMAIL PROTECTED]
This is more or less still in a beta stage (it says "alpha" on the site) but I'd like to get some feedback on it and see what people think. Spitgamer: http://spitgamer.com Thanks! -b. Click on http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild - or copy & paste it into your

View this page "Cake Apps/Sites In The Wild"

2007-04-16 Thread Digital Spaghetti
Honda are using CakePHP on their new F1 concept car site (see http://labs.blitzagency.com/?p=214 for details). Click on http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild - or copy & paste it into your browser's address bar if that doesn't work. --~--~-~--~~

Best place to put Custom Object file code

2007-04-16 Thread Steven Chan
Hi all, I was just wondering what the best practices are with respect to placing custom code libraries in the file hierarchy. There will be a custom object that I will be calling extensively from my controllers and/or views. Where is the best place I can put the lib files in the file hierarchy an

state or province required?

2007-04-16 Thread Aaron Thies
If I have a for in CakePHP 1.2 that has a country, state, and province as three distinct fields, how do I setup validation so that state is only required when the country is US and province is required otherwise? -- Aaron Thies "When you're married you'll understand the value of fresh produce.

Re: How to setup multiple sites using one cake installation folder?

2007-04-16 Thread nate
Not that Google isn't great for finding stuff, but, uh, *we have a manual*. Read it. On Apr 16, 5:06 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, I have been trying to find a way to setup multiple site folders in > cake. Each "site folder" would represent a new website. My reasoning

Re: How to setup multiple sites using one cake installation folder?

2007-04-16 Thread John David Anderson
On Apr 16, 2007, at 3:06 PM, [EMAIL PROTECTED] wrote: > > Hi, I have been trying to find a way to setup multiple site folders in > cake. Each "site folder" would represent a new website. My reasoning > for this is so I can share my cake and vendor folders among all the > websites. The alternativ

1.2 validateErrors and $form->error not displaying error messages

2007-04-16 Thread Aaron Thies
I had validation all working fine with my table-less model in CakePHP 1.1 and then I moved to CakePHP 1.2 for the internationalization functionality. Now my validation is not working. I figured out I have ot change my $html->tagErrorMsg() to $form->error() but now my error messages are not dispa

Re: Odd Queries for Pagination

2007-04-16 Thread nate
> Nate: I can post a detailed bug if you'd like. It works, just has > unexpected behavior for last page. Despite it being a limitation with > mssql, there might be some php-side stuff that can be done to overcome > it. In addition, SQL 2005 allegedly has a function that may allow more > expected b

RE: Call to a member function read() on a non-object in when TEST

2007-04-16 Thread Mariano Iglesias
Actually there's no need to instantiate Object in execute(), change it to: function _execute($controller, $action = null, $params = array(), $requested = true) { $url = Inflector::underscore($controller) . ife(!empty($action), '/' . $action, '') . ife(is_array($params) &&

How to setup multiple sites using one cake installation folder?

2007-04-16 Thread [EMAIL PROTECTED]
Hi, I have been trying to find a way to setup multiple site folders in cake. Each "site folder" would represent a new website. My reasoning for this is so I can share my cake and vendor folders among all the websites. The alternative is to cut and paste the entire cake folder, which seems to be a

Re: Scaffold & insert: session problem

2007-04-16 Thread John David Anderson
On Apr 16, 2007, at 1:59 PM, bono wrote: > > Lots of same kind of question but didn't find the answer. I have table > like this: > > CREATE TABLE 'users' ( > 'id' INT( 10 ) NOT NULL AUTO_INCREMENT , > 'username' VARCHAR( 40 ) NOT NULL , > 'password' VARCHAR( 40 ) NOT NULL , > 'email' VARCHAR( 25

RE: Call to a member function read() on a non-object in when TEST

2007-04-16 Thread Mariano Iglesias
That's because instantiating a controller will not construct required classes used by the controller. Take a look at Disaptcher::dispatch() on cake/dispatcher.php to see the action that takes place after a controller is instantiated. I need to build an article on Bakery on how to test controllers

Re: Call to a member function read() on a non-object in when TEST

2007-04-16 Thread nate
Try adding $this->object->constructClasses() to setUp(). On Apr 16, 10:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > when I test controller, > > loadController('Articles'); > > class ArticlesControllerTestCase extends UnitTestCase { > var $object = null; > > function set

Re: (HtmlHelper::submit) Deprecated: Use FormHelper::submit instead | switch off?

2007-04-16 Thread nate
You are getting this error because you are using Cake 1.1 code in Cake 1.2. If your knowledge of Cake is not sufficient for you to be able to solve this problem on your own, you should probably not be using Cake 1.2. Please downgrade to Cake 1.1. Thanks. On Apr 16, 9:42 am, "Schubidu" <[EMAIL

problem with ACL and MSSQL

2007-04-16 Thread ryan
Okay, I am simply trying to add an aro at this point using the command: $aro->create(8, null, '[EMAIL PROTECTED]'); and I get the following error: Warning: mssql_query() [function.mssql-query]: message: Invalid column name 'MAX(rght) as rght'. (severity 16) in C:\apache\cake\cake\libs \model\db

Scaffold & insert: session problem

2007-04-16 Thread bono
Lots of same kind of question but didn't find the answer. I have table like this: CREATE TABLE 'users' ( 'id' INT( 10 ) NOT NULL AUTO_INCREMENT , 'username' VARCHAR( 40 ) NOT NULL , 'password' VARCHAR( 40 ) NOT NULL , 'email' VARCHAR( 255 ) NOT NULL , 'first_name' VARCHAR( 40 ) NOT NULL , 'last_n

Writing a test case for controller->params (special characters truncate routes)

2007-04-16 Thread GreyCells
When using urlencode (or rawurlencode), any keys set up in Routes appear to truncate at the first special character. This is my test case: Router::connect('/search/:searchName', array('controller' => 'search', 'action' => 'saved')); $result = Router::parse('/searc

Re: why $ajax->link('text','/controller/view/p1/p2',array() )does not bring the

2007-04-16 Thread rstuker
sorry, i may not have explained it clear enough, here i go again: I've render a view dinamically using $ajax->link() inside a div tag. now, from this view a need to call others view of other controllers, and i do it using $ajax->link() too & $this->render('Xview','ajax'), so i can accomplish that,

Re: any 1.2 validation example?

2007-04-16 Thread [EMAIL PROTECTED]
I need to see how to use validate in 1.2 also? This page was not useful. How do I bake in order to get validate and invalidate to be used? On Mar 6, 8:52 am, "Zoltan" <[EMAIL PROTECTED]> wrote: > I learned a lot about Cake 1.2 from studying the baked files. > > There's also a look at forms over

Re: Odd Queries for Pagination

2007-04-16 Thread Joshua Benner
Using new version from SVN, works well. As a note to others who may search in relation to pagination related to SQL Server: 1. Be sure you specify a $order on your model (case sensitive), or auto-pagination will not work 2. Last page will not behave as expected. If you have pages of 20 each, the

Cakephp 1.2 paginate

2007-04-16 Thread Jeremy Pointer
In my orders controller I have the following (The idea is to use the orders index view to show a list of orders for a contact, the contact could be a patient or an Audiologist (If it's an audiologist they might be the dispensing or delivery audiologist (don't ask I also thought it was madness

Re: Help getting rid of strange link issue

2007-04-16 Thread Samuel DeVore
it is possible that your php.ini has the session.use_trans_sid set not to one, there has been some discussion about this in the google groups in the past you should try searching there for a solution

Help getting rid of strange link issue

2007-04-16 Thread Kio
Maybe someone can help me track down this problem. For some reason, on my site (http://desha.nlb-creations.com/), when you first load up the page, any internal link ends up looking like: http://desha.nlb-creations.com/stories/chaptered?CAKEPHP=06c7e20f72559a27cd674e0f73b0826b instead of what it

why $ajax->link('text','/controller/view/p1/p2',array() )does not bring the

2007-04-16 Thread rstuker
Hi evebody!! i'm using cake, see( http://groups.google.com/group/cake-php/browse_thread/thread/18c4f272c1d15513?hl=en ) thanks to Gerben for the help, by the way. I'm calling views using "$ajax->" inside another view,with requestAction, inside a div. Works fine, however, that view has particulary

why $ajax->link('text','/controller/view/p1/p2',array() does not bring the

2007-04-16 Thread rstuker
Hi evebody!! i'm using cake, see( http://groups.google.com/group/cake-php/browse_thread/thread/18c4f272c1d15513?hl=en ) thanks to Gerben for the help, by the way. I'm calling views using "$ajax->" inside another view,with requestAction, inside a div. Works fine, however, that vieq --~--~

Call to a member function read() on a non-object in when TEST

2007-04-16 Thread [EMAIL PROTECTED]
when I test controller, loadController('Articles'); class ArticlesControllerTestCase extends UnitTestCase { var $object = null; function setUp() { $this->object = new ArticlesController(); } function tearDown() { unset($this->obje

named parameters with zero value ?

2007-04-16 Thread isk
Hi all! I need to pass named parameter with value 0 - but it seems Router::url(array('par' => 0)) just ignores such parameter. But why? Is this a bug ? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake

Woooooooooooooooooow The Best Music Search Engine

2007-04-16 Thread [EMAIL PROTECTED]
http://www.freemp3sky.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECT

Woooooooooooooooooow The Best Music Search Engine

2007-04-16 Thread [EMAIL PROTECTED]
http://www.freemp3sky.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECT

Problem with Model::afterSave() callback

2007-04-16 Thread Davide
Hello everybody. I'm trying to use the afterSave callback in order to update a field of a just inserted record. I have this code[1]. If I didn't comment the saveField() statement, the browser (FireFox) will complain saying[2]. What could it be? Thanks a lot Davide 1. //controller function

Re: (HtmlHelper::submit) Deprecated: Use FormHelper::submit instead | switch off?

2007-04-16 Thread [EMAIL PROTECTED]
I'm not sure where it is specifically, but I would search your /cake directory for the string "Use FormHelper::submit" and you should find the message and the deprecation. You can comment them at your own risk, as they are generally deprecated for a reason. On Apr 16, 7:42 am, "Schubidu" <[EMA

Re: (HtmlHelper::submit) Deprecated: Use FormHelper::submit instead | switch off?

2007-04-16 Thread Davide
Schubidu wrote: > > I changed > submit('Save') ?> > to > submit('Save') ?> > > but it doesnt works. Did you include the form helper in your controller? $helpers = array(...,"form",...); What error it gives to you? Bye Davide --~--~-~--~~~---~--~~ You received t

how cake direct homepage to home.ctp

2007-04-16 Thread [EMAIL PROTECTED]
I know something about routes.php about what exactly the pages_controller.php do? is display() a magic method? what exactly happen when I at www.mywebsite.com/cakephpdir/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: (HtmlHelper::submit) Deprecated: Use FormHelper::submit instead | switch off?

2007-04-16 Thread Schubidu
I changed submit('Save') ?> to submit('Save') ?> but it doesnt works. Whats wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com T

Re: (HtmlHelper::submit) Deprecated: Use FormHelper::submit instead | switch off?

2007-04-16 Thread Daniel Hofstetter
The answer is in your question ;-) -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To

Re: (HtmlHelper::submit) Deprecated: Use FormHelper::submit instead | switch off?

2007-04-16 Thread Chris Hartjes
On 4/16/07, Schubidu <[EMAIL PROTECTED]> wrote: > > How I switch of this message "(HtmlHelper::submit) Deprecated: Use > FormHelper::submit instead"? > Um, by following the instructions and use FormHelper. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www

(HtmlHelper::submit) Deprecated: Use FormHelper::submit instead | switch off?

2007-04-16 Thread Schubidu
How I switch of this message "(HtmlHelper::submit) Deprecated: Use FormHelper::submit instead"? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googleg

Re: creating static links to documents

2007-04-16 Thread jyrgen
> You mentioned that you place the controllers in a sub-domain. Do you > mean something like this: > > subdom.example.com/admin/userscontroller? > > If not, can you provide an example? the subdomain points to the same directory as the main domain. therefore the same controllers are used, except t

Re: whats the relationship between CakePHP 1.2 test suite N SimpleTest

2007-04-16 Thread hydra12
I may be wrong, but I think it works like this: The cake testsuite (and cakebaker's) are wrappers for simpletest. Simpletest is used as a vendor, and the testsuite 'cake-ifies' it. (Is that a word? Probably not . . .) Anyway, simpletest is doing the actual testing, but the test suite makes ever

Re: creating static links to documents

2007-04-16 Thread Cheeze
Hi, You mentioned that you place the controllers in a sub-domain. Do you mean something like this: subdom.example.com/admin/userscontroller? If not, can you provide an example? On Apr 16, 2:13 am, "jyrgen" <[EMAIL PROTECTED]> wrote: > > I get missing controller errors > > > "AdminusersControll

Re: Jquery ,Ajax

2007-04-16 Thread digital spaghetti
Hi Marco, Here is what I do: link('Cancel', '/admin/home', array('class'=>'button', 'onclick'=>'javascript:$("#admin-area").load("/admin/home");return false;')));?> You need to make sure you have the RequestHandler component loaded, otherwise when you update your div, it will load the whole sit

Re: Extending AppModel and/or AppController

2007-04-16 Thread quincy
Thanks Tarique, I'm surprised i hadn't looked at that before. I guess i don't have as much time as i'd like to get to know the ins and outs of Cake whilst i'm at work!! :) Cheers On 16 Apr, 12:26, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 4/16/07, quincy <[EMAIL PROTECTED]> wrote: > >

Re: Extending AppModel and/or AppController

2007-04-16 Thread Dr. Tarique Sani
On 4/16/07, quincy <[EMAIL PROTECTED]> wrote: > seems that the developers suggested that the best option is to copy > AppModel (or AppController) into the app directory in orer to create > and application-specific version then make changes in that. #1 Take a look at the AppModel (or AppController

Jquery ,Ajax

2007-04-16 Thread [EMAIL PROTECTED]
Hi I'm using Cakephp with jquery. I would use the Jquery Ajax function inside my general view named "index.thtml". I would use the load function exactly for change the content of a div when I click on a image .In this div I would load a particular view named "view_part.thtml". How can i do thi

Extending AppModel and/or AppController

2007-04-16 Thread quincy
I was thinking about extending AppModel and/or AppController to add some application-wide functionality and maybe alter a few things to fit my way of working etc. Now i know this has been discussed here before but from what i've read (threads that were 6-9 months old) i'm not happy with the outco

whats the relationship between CakePHP 1.2 test suite N SimpleTest

2007-04-16 Thread [EMAIL PROTECTED]
whats the relationship between CakePHP 1.2 test suite N SimpleTest? is test suite new feature of the 1.2 ? and does test suite just use SimpleTest as fundamental? and when you download and put SimpleTest in right place ,it enable the test suite?? and when use bake.php ,it seems like it output t

Re: SELECT LAST_INSERT_ID() and COUNT(id)

2007-04-16 Thread majna
tnx nate. I know that this is normal cake behaviour. But SELECT LAST_INSERT_ID() was called twice for one insert. That is why I ask is it a bug. Also if there is mysql error, in sql query dump there is "onError" string. Is it some error callback I can use ( maybe for log or so)? On Apr 16,

$ajax->remoteTimer()

2007-04-16 Thread [EMAIL PROTECTED]
i think the $ajax->remoteTimer() is not working properly.. it doesn't do anything.. can someone check my code.. and see whats wrong. uniquesubmit.thtml --- remoteTimer(array('url' => '/report/uniquesubmit/', 'update' => 'asfd')); ?> --- controller --- set

Re: Session question.

2007-04-16 Thread Marcus T. Jaschen
peterhf wrote: > I have created a thtml file and placed it in the /pages/ directory. In > the file I have "if ($this->Session->check('function')) ...". The > following error message appears: "Fatal error: Call to a member > function on a non-object in ..." which points to the line containing > the

Re: Session problems & Ajax -- help!!

2007-04-16 Thread Olwen Williams
In fact it the REAL reason was that my setup was not configured right --- oh dear. On 16/04/07, Olwen Williams <[EMAIL PROTECTED]> wrote: > In the end I think my session problems were nothing to do with Ajax. > It was an ordinary link in my HTML that was causing the cookie to > vanish -- Don't as

Missing Controller errors with mod_rewrite

2007-04-16 Thread jyrgen
hi, my admin area is located on a subdomain. when i try to make use of mod_rewrite, i get missing controller errors: ### part of appcontroller dump [controller] => AdminusersController [controllerName] => Adminusers ) [pageTitle] => Missing Controller ### part of appcontroller dump th