Re: $ajax->form('/cntr/action'...) problem RC2

2008-07-25 Thread Jon Hinson

I'm not 100% if this is the problem, but since you're creating the
form in /users/view, it's going to assume that you want to use the
users controller since you did not specify a different controller.
Again, I'm not 100% sure, but it might need to be something like this:

form('Notes', 'post', array('update'=>'notes',
'action'=>'addquick'));?>

Jon Hinson

On Jul 25, 9:49 am, Elmo <[EMAIL PROTECTED]> wrote:
> From the test case(s) for the $ajax->form() helper, the book was wrong
> (or at least according to the latest RC2). The correct syntax is:
>          // WRONG: $ajax->form('/notes/addquick', 'post',
> array('update'=>'notes'));
> // RIGHT: (Note: I still don't know what the 'showForm' is for)
>         echo $ajax->form('showForm', 'post',
>                 array('model' => 'Note',
>                         'url' => array('action'=> 'addquick',
> 'controller' => 'notes'),
>                         'update' => 'notes_div'));
> ?>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



counterQuery or fields not working in hasMany association (getting DISTINCT results) for 1.2?

2007-12-04 Thread Jon Hinson

Does counterQuery not work in 1.2? Instead of it doing COUNT(*), I
want it to do COUNT(DISTINCT User.id). Also, in my hasMany
association, I was trying to put fields in the 'fields' key, and it
wasn't working. I tried just one field (User.id), and it was still
returning all fields.

Also, is there any simple way to add a DISTINCT to the query? Or a
GROUP BY? That would be great.

Thanks,
Jon
--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



I'm having problems with associations...

2007-12-03 Thread Jon Hinson

Ok, I can't seem to solve this problem for the life of me. I have a
User model and a Zipcode model. Zipcode hasMany users. I want them to
join on User.zip = Zipcode.zip. I have to join on Zipcode.zip and not
Zipcode.id because a zipcode can have many rows because of several
city names, etc. I know this is not normalized, but it is much easier
like this. So I have a hasMany association that looks like this:

var $hasMany = array('User' =>
array('className'=> 'User',
  'conditions'   => '',
  'order'=> '',
  'dependent'=>  true,
  'foreignKey'   => '',
  'finderQuery'  => '   SELECT *

FROM users as User

JOIN zipcodes as Zipcode ON (User.zip = Zipcode.zip)'
)
  );

I tried using the finderQuery after doing foreignKey => 'zip' didn't
work. I also had a belongsTo Zipcode in User with foreignKey =>
'zip' :

var $belongsTo = array('Zipcode' =>
array('className'=> 'Zipcode',
  'conditions'   => '',
  'order'=> '',
  'dependent'=>  true,
  'foreignKey'   => 
'zip'
)
  );

With everything that I've tried, when I do a $this->Zipcode->User-
>findAll, or try to paginate with $this->Zipcode->User, it tries to
join on User.zip = Zipcode.id instead of Zipcode.zip.

Any help is much appreciated.
Jon

PS- I'm using Cake 1.2
--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Form data not being posted ( $_POST not being populated ) after first submission - Driving me INSANE

2007-09-26 Thread Jon Hinson

I'm not sure what the  trick is. I tried sticking  in my , adding the hidden
field with a random value, and adding a random number as a parameter
to the end of my URL. I'm still getting the same outcome. What's
weird, even if $_POST isn't being populated, I can refresh Firefox,
and the popup box that says "The page you are trying to view contains
POSTDATA" comes up. So it has been posted to, but I think $this-data
is not being populated by cake for some reason. If we can somehow find
out why $this->data is not being populated, we can get to the bottom
of this.

Jon

On Sep 26, 5:56 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Okay, I tried using Galeon a few more times.
>
> 1) Enter "abc" / "def"
> 2) Submit
> 3) Page draws with post
> 4) Sumbit again.
> 5) Page draws with no post (clears fields)
> 6) Enter "abc" / "def"
> 7) Submit
> 8) Page draws with post
> 9) add "d" to the end of "abc"
> 10) Submit again
> 11) Page draws with post
>
> So maybe it is a cache thing.  maybe try the  trick
>
> And if all else fails try sticking this:
>
> 
> hidden('User/random', random()) ?>
>
> in your form.  As that should change every time.
>
> Jeff


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Form data not being posted ( $_POST not being populated ) after first submission - Driving me INSANE

2007-09-26 Thread Jon Hinson

Jeff,

Thanks for taking your time to help with this. So it's definitely
browser based. Could it be a caching issue maybe?

Jon

On Sep 26, 5:24 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I typed garbage in the form like 8 times.  I just went back and did it
> like 8 more times and barring some errors the first time (session
> expired stuff) it still works like a charm...
>
> I used firefox 1.5 on mandrivia 10.2 linux.  works without a hitch..
>
> However, I just tried it on Galeon and got your 2nd submission POST
> death.
>
> Wierd.
>
> Jeff
>
> On Sep 26, 3:59 pm, Jon Hinson <[EMAIL PROTECTED]> wrote:
>
> > How many times did you try submitting the form? This is very odd. What
> > browser are you using? I tried to reproduce the problem on my iPhone
> > using Safari, and it took many more submittions, but out of about 20
> > submittions, $_POST was not populated 3 times. I know that doesn't
> > sound like much, but when it's almost EVERY time after the second
> > submission with IE 6 and Firefox, it's very frustrating and I want to
> > know what I'm doing wrong.
>
> > On Sep 26, 4:30 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > >From what I can tell Jon, $_POST populated as expected.
>
> > > It was only empty when I loaded the page the first time.
>
> > > Jeff


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Form data not being posted ( $_POST not being populated ) after first submission - Driving me INSANE

2007-09-26 Thread Jon Hinson

How many times did you try submitting the form? This is very odd. What
browser are you using? I tried to reproduce the problem on my iPhone
using Safari, and it took many more submittions, but out of about 20
submittions, $_POST was not populated 3 times. I know that doesn't
sound like much, but when it's almost EVERY time after the second
submission with IE 6 and Firefox, it's very frustrating and I want to
know what I'm doing wrong.

On Sep 26, 4:30 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> >From what I can tell Jon, $_POST populated as expected.
>
> It was only empty when I loaded the page the first time.
>
> Jeff


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Form data not being posted ( $_POST not being populated ) after first submission - Driving me INSANE

2007-09-26 Thread Jon Hinson

When I try to submit any forms multiple times in a row(if I've entered
incorrect login information, for example), after the first or second
submission, it's as if I just loaded the page without my form posting.
I broke my code down to simplify it and try to find the problem, but
I'm having no luck. Here's my code-http://bin.cakephp.org/view/
1897510959, and here's the page to test it out- 
http://psytherium.com/users/login
. Let me know if the data submits for you after the first few
times(you can put anything in). I've tested it in both Firefox and IE
6.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $this->data not being populated on second form submission

2007-09-23 Thread Jon Hinson

Please ignore my last post. It's not a caching issue, and now for some
reason my solution is not working, in neither Firefox or IE.

I don't have a CLUE what is going on. I reduced the form and
everything down to try and locate the problem-> here's my code of the
view and test action: http://bin.cakephp.org/view/2133448453 . It
takes several form submissions, but eventually the $_POST variable
will be empty after a submission. On my login form, it happens on the
second submission every time. After the $_POST variable is not
populated, subsequent submissions will result in an $_POST as well.

I have print_r($_POST) in my webroot index.php so that's how I know
whether or not it's empty.

Any help is greatly appreciated.

Thanks,
Jon

On Sep 23, 2:23 pm, Jon Hinson <[EMAIL PROTECTED]> wrote:
> I just figured it out. It is indeed a caching problem, but with
> Firefox. The issue goes away when using IE. For now, I solved it by
> adding rand() to my form action to produce a random URL so Firefox
> doesn't cache the page. If anyone can think of a better solution than
> this, please let me know.
>
> Thanks,
> Jon
>
> On Sep 23, 8:35 am, francky06l <[EMAIL PROTECTED]> wrote:
>
> > caching problem maybe (view) ?
>
> > On Sep 22, 8:29 pm, Jon Hinson <[EMAIL PROTECTED]> wrote:
>
> > > Hello, this is happening on all of my forms, but I will use my login
> > > form as the example. I will type in incorrect login information so my
> > > error message comes up and then I will type in incorrect login
> > > information a second time. Instead of the error message coming up
> > > again, my /users/login page is just as if I had just type that in to
> > > the address bar for the first time. I put some code in my login action
> > > to echo "no post" if $this->data was empy, and on the second
> > > submission it is in fact empty. If I wait around 15 seconds between
> > > submissions, then the data is posted once again.
>
> > > Here is my code:http://bin.cakephp.org/view/1897510959
>
> > > Please let me know what I am doing wrong or what I can do to fix this.
>
> > > Thanks,
> > > Jon


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $this->data not being populated on second form submission

2007-09-23 Thread Jon Hinson

I just figured it out. It is indeed a caching problem, but with
Firefox. The issue goes away when using IE. For now, I solved it by
adding rand() to my form action to produce a random URL so Firefox
doesn't cache the page. If anyone can think of a better solution than
this, please let me know.

Thanks,
Jon

On Sep 23, 8:35 am, francky06l <[EMAIL PROTECTED]> wrote:
> caching problem maybe (view) ?
>
> On Sep 22, 8:29 pm, Jon Hinson <[EMAIL PROTECTED]> wrote:
>
> > Hello, this is happening on all of my forms, but I will use my login
> > form as the example. I will type in incorrect login information so my
> > error message comes up and then I will type in incorrect login
> > information a second time. Instead of the error message coming up
> > again, my /users/login page is just as if I had just type that in to
> > the address bar for the first time. I put some code in my login action
> > to echo "no post" if $this->data was empy, and on the second
> > submission it is in fact empty. If I wait around 15 seconds between
> > submissions, then the data is posted once again.
>
> > Here is my code:http://bin.cakephp.org/view/1897510959
>
> > Please let me know what I am doing wrong or what I can do to fix this.
>
> > Thanks,
> > Jon


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



$this->data not being populated on second form submission

2007-09-22 Thread Jon Hinson

Hello, this is happening on all of my forms, but I will use my login
form as the example. I will type in incorrect login information so my
error message comes up and then I will type in incorrect login
information a second time. Instead of the error message coming up
again, my /users/login page is just as if I had just type that in to
the address bar for the first time. I put some code in my login action
to echo "no post" if $this->data was empy, and on the second
submission it is in fact empty. If I wait around 15 seconds between
submissions, then the data is posted once again.

Here is my code: http://bin.cakephp.org/view/1897510959

Please let me know what I am doing wrong or what I can do to fix this.

Thanks,
Jon


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---