Re: CakePHP guide

2008-02-06 Thread asturges

I completely agree with the comment about the API. I realize it is a
very technical document with a specific purpose, but a few lines of
example code here and there would broaden its reach to many more
users. I also agree with the sentiment about wanting to contribute but
being unsure of one's qualification to do so. I'd like to add things,
or sometimes just expand and append parts of the manual, but the only
way to do it easily is through your own blog.
-Andrew

On Feb 6, 12:03 pm, Baz <[EMAIL PROTECTED]> wrote:
> Personally, this is the problem I have with the lack of documentation:
>
> CakePHP was somewhat intimidating for me to get started with. With that
> said, I have done a few simple apps, an make-shift CMS that serves my
> purpose, and just general fudging around with stuff and trying to get things
> working.
>
> However, I'm never sure whether I'm doing things the "right" way. To be
> honest, all this MVC stuff was brand new to me by the time I started. This
> is why I've been hesitant to submit articles to the bakery, for example.
> Since a lot of my stuff, can be considered patchwork, I wouldn't want to
> mislead people searching for "official" solutions on the bakery (and even
> Official Docs). That's why I usually keep my ramblings on my own blog.
>
> I can't help but feel that I'm not the only one who feels that way. What
> would "qualify" one to be able to contribute to the Official Cake
> documentation or the Bakery?
>
> Just My 2 cents.
>
> PS:
>  - The API is a great resource as is, but it can be HEAVILY improved by just
> placing a few (well a whole lot) of examples for some of the more difficult
> functions. $form->input() any one? I tend to get lost in the MANY uses of
> options arrays.
>  - I've found some hidden treasures in:http://bin.cakephp.org/saved. The
> pagination on that page doesn't work though. I didn't find a category to
> report it under in trac.
>
> --
> Baz L
> Web Development 2.0http://WebDevelopment2.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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp losing session after redirect

2008-02-06 Thread rafali

I am using an older version from July Last year and I am getting the
same problem with session variable being lost.

Is there some bullet proofing that can be removed - with security set
to 'low' etc to get over session variable being retained after
redirect or after a requestAction.



On Feb 6, 3:00 pm, Anna P <[EMAIL PROTECTED]> wrote:
> I'm using version 1.1.18. The problem is: in the login action I 
> setsessionvariable for user and then redirect. After redirect cakephp 
> islosingsession. I tried with CAKE_SESSION_SAVE - 'php', 'cake' (with
> sessions folder writable), CAKE_SECURITY - 'high', 'medium','low'
> Nothing works. I searched on group but found no solution.
> Anyone please help:-)) it's driving me crazy:/

--~--~-~--~~~---~--~~
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: Inner Join on hasMany

2008-02-06 Thread Baz L

Any ideas anyone?
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Dec 10 2007, 2:55 pm, Baz <[EMAIL PROTECTED]> wrote:
> Hey guys...this is what I'm trying to accomplish:
>
> I got a model (Request). Each request hasMany Dates.
>
> I'm doing a simple find on the Request, but I ONLY want to return those
> requests that have a certain date range.
>
> I'm been able to using the excellent Bindable behavior to set the condition
> on the Date.
>
> But, it always brings back ALL the requests.
>
> After, I'm having to loop through the array and remove requests where the
> ...['Request']['Date'] array is empty. Beside the fact that this is
> extremely sloppy (sorry had a deadline - this is just a demo anyway), it's
> messing up the numbering on my paginator.
>
> Any ideas on how to do this simply?
> Someone once mentioned adding 'type' => 'INNER' to the association, but that
> didn't work (also didn't find code to support it).
>
> Any ideas? ThanX in advance.
>
> BTW: Using Cake 1.2 Nightly (12-08-07)
> --
> Baz L
> Web Development 2.0http://WebDevelopment2.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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Unit testing associations?

2008-02-06 Thread Chris Hartjes

On Feb 5, 2008 6:36 PM, Robby Anderson <[EMAIL PROTECTED]> wrote:
>
>
> I've been working with the cake unit tests, and have gotten them to
> work (with a fair amount of help) on simple models and other simple
> functionality, but I can't seem to get them to work on more
> complicated associations, or in any case where a model calls directly
> creates/calls another model inside a method.
>
> Given what I've seen in the tutorials and looking through the test
> code base, I'm not sure I see an easy way to test using associations
> without redefining the associations in my test models. Is there
> something really obvious I'm missing?
>

Robby,

I touched on this topic during my talk today at CakeFest.  If you are
a user of the Cake console you can use the 'cake console' command to
test out your models, including binding and unbinding associations for
testing purposes, and then seeing what kind of result sets you get in
your queries.

Hope that helps.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Scaffold Templates in 1.2 ?

2008-02-06 Thread Julio Vinicius

Hi Wood, i hope this answer is not to late...

The tempdos is wrong. They already changed on the svn and it will be
online soon.

So to customize a scaffolded view fo a specific controller they say
you need to place you file here:
/app/views/posts/scaffold/index.scaffold.ctp

But rather, you need to put it here:
/app/views/posts/scaffold.index.ctp

And to customize a view scaffold for all your controllers, they say
the place is here:
/app/views/scaffolds/index.ctp

But the right place is:
/app/views/scaffold/index.scaffold.ctp

Hopes this helps others.

The lack of good, consistent and updated documentation is the worst
problem on CakePHP today.

Note: Happy Birthday to me :D

Cheers,
Julio Vinicius Protzek

On 1 fev, 20:49, the_woodsman <[EMAIL PROTECTED]> wrote:
> Ha ha,
>
> Nice one Chris, I probably deserved that.
>
> But listen, I did have a misnamed file in that drectory: previously
> calledscaffold.index.ctp, now renamed, as per thetempdocs, to
> index.scaffold.ctp
>
> I've put this file in /app/views/scaffold, again as per the docs.
>
> I have a controller/model combo, called contracts, which doesn't even
> have a folder in views, so it can't be overriding scaffolding
> templates itself (?).
>
> When I go to /contracts in the browser, I get a standard index list,
> which gets the titleScaffold:: Index :: Contracts, but as my
> template indexscaffoldfile is blank, I'd expect there to be a blank
> page here instead
>
> If I'm being an idiot with a typo or something, It wouldn't be the
> first time... but seriously, has anyone actually got this working? any
> clues??
>
> Thanks,
> Wood
>
> On Feb 1, 6:24 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Feb 1, 2008 12:45 PM, the_woodsman <[EMAIL PROTECTED]> wrote:
>
> > > Please, don't tell me to RTFM (http://manual.cakephp.org/chapter/
> > > scaffolding), as that page has been wrong for yonks ( I think over a
> > > year, even though this ticket is only a month old 
> > > -https://trac.cakephp.org/ticket/3789),
> > > and it's not for 1.2 anyway!
>
> > How about you RTOFM (Read The Other F** Manual) over 
> > athttp://tempdocs.cakephp.orgtosee if the answer might be in there.
>
> > --
> > Chris Hartjes
> > Internet Loudmouth
> > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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: Validate one or two fields?

2008-02-06 Thread Rgarg


do you want to cum pair  user written data with database??
--~--~-~--~~~---~--~~
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: on edit page select radio according database value

2008-02-06 Thread Rgarg


is there nobody who can solve this?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



HABTM filtering with indirect model relationship

2008-02-06 Thread patcoll

I have the following model structure set up:

Model1 -hasOne- Model2 -hasAndBelongsToMany- Model3

I'm trying to run a paginate() call on Model1 (in Model1's controller)
while trying to pass custom conditions having to do with Model3. For
example:

$results = $this->paginate('Model1', array('conditions' =>
array('Model3.title' => 'LIKE %blah%')));

Of course it complains that Model3.title doesn't exist because the
query's not doing any join between Model2 and Model3. I've read all
the posts and articles about binding dummy hasOne associations before
doing my paginate call.

OK, so I decided to put the dummy bindModel() in the beforeFind()
function in Model2. Then I did my paginate() call on Model2, but of
course now I'm querying the wrong data because I really need
paginate() support for Model1. Arg.

Has anyone had any success solving this problem? I've seen lots of
solutions for filtering between two models that have a HABTM
relationship and the dummy bindModel() calls seem to work for that,
but this problem seems to be a different animal. Any ideas?
--~--~-~--~~~---~--~~
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: AppModel retaining previous insert ID

2008-02-06 Thread Samuel DeVore

it's in here http://tempdocs.cakephp.org/#TOC73001
and http://manual.cakephp.org/chapter/models
and http://api.cakephp.org/1.2/class_model.html#ffd04e1cae18cb61d1e219f5283eab35
the nice thing about create is that you can initialize your model with
default data as well

SamD

On Feb 6, 2008 7:02 PM, Tim W <[EMAIL PROTECTED]> wrote:
>
> Thanks Samuel, I didn't think to check if there was a create type
> method, cheers :)
>
> On Feb 7, 3:00 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> > I usually use $this->ModelName->create();
> >
> > On Feb 6, 2008 5:50 PM, Tim W <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > Hi all,
> >
> > > I've got a piece of code that does an insert, then and update of the
> > > previous row inserted, then the code loops around and does the same
> > > thing again for a different data set. I've found an issue that the
> > > second time around the loop the AppModel is retaining the ID of the
> > > previous insert and so is doing an update instead of an insert. After
> > > stepping into the model.php source eventually found that it was
> > > getting an ID from "$this->contr->ModelName->id" that was saved on the
> > > previous insert.
> >
> > > Adding "$this->contr->ModelName->id = null" fixed the issue, and made
> > > the model do an insert instead of an update. This feels like a hack
> > > though, and I don't like hacks, they often come back to bite you
> > > later.
> >
> > > Does anyone know why the model's retaining this ID value, and why it's
> > > picking it up from the previous insert when it's missing from the
> > > array of data I tell it to save?
> >
> > > Thanks
> >
> > > Tim
> >
> > --
> > --
> > (the old fart) the advice is free, the lack of crankiness will cost you
> >
> > - its a fine line between a real question and an idiot
> >
> > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/http://blog.samdevore.com/cakephp-pages/i-cant-bake/
>
> >
>



-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

--~--~-~--~~~---~--~~
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: AppModel retaining previous insert ID

2008-02-06 Thread Tim W

Thanks Samuel, I didn't think to check if there was a create type
method, cheers :)

On Feb 7, 3:00 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> I usually use $this->ModelName->create();
>
> On Feb 6, 2008 5:50 PM, Tim W <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi all,
>
> > I've got a piece of code that does an insert, then and update of the
> > previous row inserted, then the code loops around and does the same
> > thing again for a different data set. I've found an issue that the
> > second time around the loop the AppModel is retaining the ID of the
> > previous insert and so is doing an update instead of an insert. After
> > stepping into the model.php source eventually found that it was
> > getting an ID from "$this->contr->ModelName->id" that was saved on the
> > previous insert.
>
> > Adding "$this->contr->ModelName->id = null" fixed the issue, and made
> > the model do an insert instead of an update. This feels like a hack
> > though, and I don't like hacks, they often come back to bite you
> > later.
>
> > Does anyone know why the model's retaining this ID value, and why it's
> > picking it up from the previous insert when it's missing from the
> > array of data I tell it to save?
>
> > Thanks
>
> > Tim
>
> --
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/http://blog.samdevore.com/cakephp-pages/i-cant-bake/
--~--~-~--~~~---~--~~
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: AppModel retaining previous insert ID

2008-02-06 Thread Samuel DeVore

I usually use $this->ModelName->create();

On Feb 6, 2008 5:50 PM, Tim W <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I've got a piece of code that does an insert, then and update of the
> previous row inserted, then the code loops around and does the same
> thing again for a different data set. I've found an issue that the
> second time around the loop the AppModel is retaining the ID of the
> previous insert and so is doing an update instead of an insert. After
> stepping into the model.php source eventually found that it was
> getting an ID from "$this->contr->ModelName->id" that was saved on the
> previous insert.
>
> Adding "$this->contr->ModelName->id = null" fixed the issue, and made
> the model do an insert instead of an update. This feels like a hack
> though, and I don't like hacks, they often come back to bite you
> later.
>
> Does anyone know why the model's retaining this ID value, and why it's
> picking it up from the previous insert when it's missing from the
> array of data I tell it to save?
>
> Thanks
>
> Tim
> >
>



-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Validate one or two fields?

2008-02-06 Thread Siebren Bakker
I have a Users controller and model, and in the users_controller, I have an
edit function, where users can updates their email address or password. What
I'm trying to figure out is how I can validate say the 'email', and
'confirm_email' fields, or the 'password' and 'passwd' fields through the
model's validation rules, without it invalidating the whole thing because of
missing fields that aren't even in the form, it will invalidate the whole
password form based on the fact that there is no email entered, and vice
versa. Does anyone know of a way to just validate a select amount of data?

-- 
In the name of Life, Liberty, and the pursuit of my sanity.
Siebren Bakker(Aevum Decessus)
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s+: a19 C UL++ P L++
!E W++ N(-) o? K? w(+) O? M-- V?
PS+ PE Y- PGP- t+ 5? X- R tv--
b++ Di D+ G+ e h! r y-
--END GEEK CODE BLOCK--

--~--~-~--~~~---~--~~
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: Question about sessions

2008-02-06 Thread rafael bonifaz
On Feb 6, 2008 5:08 PM, Chris <[EMAIL PROTECTED]> wrote:

>
> What database are you using?  Mysql, oracle, etc.
>
Postgres

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



AppModel retaining previous insert ID

2008-02-06 Thread Tim W

Hi all,

I've got a piece of code that does an insert, then and update of the
previous row inserted, then the code loops around and does the same
thing again for a different data set. I've found an issue that the
second time around the loop the AppModel is retaining the ID of the
previous insert and so is doing an update instead of an insert. After
stepping into the model.php source eventually found that it was
getting an ID from "$this->contr->ModelName->id" that was saved on the
previous insert.

Adding "$this->contr->ModelName->id = null" fixed the issue, and made
the model do an insert instead of an update. This feels like a hack
though, and I don't like hacks, they often come back to bite you
later.

Does anyone know why the model's retaining this ID value, and why it's
picking it up from the previous insert when it's missing from the
array of data I tell it to save?

Thanks

Tim
--~--~-~--~~~---~--~~
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: Saving Date and Time NOT in the Model/Database (cleanUpFields not working)

2008-02-06 Thread Baz L

There 'work around' doesn't exactly work:

I'd have to override schema() in my model to add the fields. Then I
could manually call deconstruct().

However, overriding schema will be done for ALL of the model's
functions. I would then get problems when performing find('all'), etc.

On Jan 13, 2:00 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Try:
>
> $property_formatted_date_string = $this->Model->deconstruct($this-
>
> >data['Model']['datefield']);
>
> When you're saving data, it seems to work fine without calling
> Model::deconstruct, but if you're doing 'custom' date fields (e.g.,
> searching records in a database) it appears that you need to
> deconstruct it yourself. When I updated from pre-beta to beta I ran
> into this problem.
>
> - B. D.
>
> On Dec 11 2007, 2:04 pm, Baz <[EMAIL PROTECTED]> wrote:
>
> > It says it was replaced by: Model::deconstruct()
>
> > But the functionality is different. Doing a direct call didn't work for me.
>
> > Even if it did, there's another issue with the latest version not saving
> > dates and times to the database. I think I'll just hold up on the SVN for
> > now. At least until they update the API.
>
> > On Dec 11, 2007 9:33 AM, Gwoo <[EMAIL PROTECTED]> wrote:
>
> > > What does it saycleanUpFields() was replaced by? Maybe you could use
> > > that
--~--~-~--~~~---~--~~
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: turn off certain associations for a model

2008-02-06 Thread Baz
Well it depends...

If you only want to turn OFF a few, unbind() is fine. The bindable behavior
really shines when you only want to ADD a few...

On Feb 6, 2008 4:20 PM, Robby Anderson <[EMAIL PROTECTED]> wrote:

>
>
> I'm using Martin's behavior, and its very, very useful.
>
> -r
>
> On Feb 6, 11:32 am, Defranco <[EMAIL PROTECTED]> wrote:
> > Hi Dardo,
> >
> > Very interesting this article.
> >
> > Thanks for the reply.
> >
>

--~--~-~--~~~---~--~~
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: cakephp version 1.1.19.6305 causes segmentation fault (solution)

2008-02-06 Thread [EMAIL PROTECTED]

Thanks. Saved us.

On Jan 29, 8:25 pm, hamidskey <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I upgraded my cakephp from 1.1.18 to 1.1.19.6305, I did a direct copy
> of cake directory and I found that it causes segmentation fault in my
> apache 2. After searching the entire web I couldn't find any solution
> about it other than the ones which says just get the latest copy and
> it will work. I decided to find a solution for it myself so I looked
> into cakephp's code and I found the problem with model_php5 file.
>
> Here I will try to describe my situation and the (temporary) solution
> that I implemented for myself. Beware that this solution will modify
> the core cakephp model_php5 file so if you don't know what your doing
> then don't touch it. I only did it because my application uses lot of
> auto association and 1.1.18 didn't recursively fetch associations so I
> had to do something about it. I know it is not good to update the core
> files, but I know what is going on in there and I can always reverse
> it once new version of cakephp fixes the problem.
>
> Back to the problem. The problem is caused when you have a self
> referencing Model, cakephp goes into a bad recursion and causes
> segmentation fault.
>
> I have a model as following:
>
> class Category extends AppModel{
> var $name = 'Category';
>
> var $belongsTo = array(
> 'ParentCategory'=>array(
> 'className'=>'Category',
> 'foreignKey'=>'category_id'
> )
> );
>
> }
>
> As soon as cake php reaches this association in the __construct of
> model_php5 it tries to create the associations, instantiate the
> association classes and create their association, because
> ParentCategory is of type Category, it keeps looping in this
> association forever.
>
> The reason that it doesn't stop is because in model_php5's constructor
> at line 311 cakephp puts the alias of the object in the ClassRegistry
> like this:
>
> ClassRegistry::addObject($this->alias, $this);
>
> This is used to check if an object is created later on and it will
> avoid re-creating the object which cause the recursion. the value of
> $this->alias is "ParentCategory". When cakephp reaches line 466 it
> checks if the object is created or not with its class name
> ("category")! which of course never matches because originally the
> object was registered with its alias.
>
> I changed the code in model_php5 at line 466 from this:
>
> if (ClassRegistry::isKeySet($colKey)) {
> $this->{$assoc} = ClassRegistry::getObject($colKey);
> $this->{$className} = $this->{$assoc};
>
> }
>
> to
>
> if (ClassRegistry::isKeySet($colKey) ||
> ClassRegistry::isKeySet($model['alias'])) {
> if( ClassRegistry::isKeySet($colKey))
> $this->{$assoc} = ClassRegistry::getObject($colKey);
> else
> $this->{$assoc} = ClassRegistry::getObject($model['alias']);
>  $this->{$className} = $this->{$assoc};
>
> }
>
> and it fixed the problem.
>
> I hope this helps someone.
--~--~-~--~~~---~--~~
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: Case by case validation

2008-02-06 Thread Robby Anderson


Using cake's automagic, you could add to your model's beforeSave()
method, doing this:

1) Save a temp copy of $this->validate
2) Create and assign a new version of $this->validate, based on the
state (create vs update)
3) Get the return value of $this->validates() - a true return value
means you validated, false means you did not
4) Reset your copy of $this->validate
5) Return the value saved earlier of $this->validates()

Steps 1 and 4 are totally optional; I'd do them in case there was a
base set of validations you always before, and then you want to add
additional validations based on the model state at the time of saving/
updating.

--~--~-~--~~~---~--~~
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: Unit testing associations?

2008-02-06 Thread Robby Anderson


I waited for this to fall off the 1st page of the discussions before
bumping ... no one has used the unit testing on models with multiple
associations? :(

I built a quick-and-dirty way to handle these associations by writing
an app_model method that loops through all models listed in the model-
>tableToModel array and sets all the model useDbConfig properties to
'test' (which should catch all the associations, but doesn't handle
any temporary models created in a model method) - but I'm pretty sure
this isn't the prescribed method. I'm highly interested to see the
"official" way, and I haven't been able to discern it through the code
and testing various ideas.

--~--~-~--~~~---~--~~
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: Saving related model data

2008-02-06 Thread lgarcia

I would prefer a solution without touching the database... finally if
there aren't solutions i would make that change, but i'm asking for a
non-database solution.

thanks!!!

On 6 feb, 23:23, Robby Anderson <[EMAIL PROTECTED]> wrote:
> My take on using Cake is that you need a single-column primary key in
> all your tables. Assuming that perception is correct, it would be the
> root of your problems.
>
> Can you simply add an autoincrement column into your
> ProductDescription table, and make the product_id/lang_code a
> candidate key (unique combination)? That would probably solve your
> issue.
>
> -r
--~--~-~--~~~---~--~~
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: Question about sessions

2008-02-06 Thread lgarcia

The difference is just the path PHP stores the session.

CAKE: app/tmp/sessions
PHP: php tmp directory defined in php.ini
DATABASE: cake_sessions table.

Check you have sessions folder in tmp directory created and check it
permissions.

Regards.

On 6 feb, 22:02, "rafael bonifaz" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I would like to know what are the differences of using php sessions vs using
> cake sessions or database sessions. We are developing an application and we
> have a weird behavior. If we use php session the application works find, but
> if we use cake session the session get lost. No idea why.
>
> BTW /var/www/html/app/tmp is writable by the web browser.
>
> Greetings,
>
> Rafael
--~--~-~--~~~---~--~~
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: Saving related model data

2008-02-06 Thread Robby Anderson


My take on using Cake is that you need a single-column primary key in
all your tables. Assuming that perception is correct, it would be the
root of your problems.

Can you simply add an autoincrement column into your
ProductDescription table, and make the product_id/lang_code a
candidate key (unique combination)? That would probably solve your
issue.

-r

--~--~-~--~~~---~--~~
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: turn off certain associations for a model

2008-02-06 Thread Robby Anderson


I'm using Martin's behavior, and its very, very useful.

-r

On Feb 6, 11:32 am, Defranco <[EMAIL PROTECTED]> wrote:
> Hi Dardo,
>
> Very interesting this article.
>
> Thanks for the reply.
--~--~-~--~~~---~--~~
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: Question about sessions

2008-02-06 Thread Chris

What database are you using?  Mysql, oracle, etc.

We are currently having major issues with storing sessions in an
Oracle database.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Question about sessions

2008-02-06 Thread rafael bonifaz
Hi all,

I would like to know what are the differences of using php sessions vs using
cake sessions or database sessions. We are developing an application and we
have a weird behavior. If we use php session the application works find, but
if we use cake session the session get lost. No idea why.

BTW /var/www/html/app/tmp is writable by the web browser.


Greetings,

Rafael

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Saving related model data

2008-02-06 Thread lgarcia

I have this scenario:

* Products table:
  product_id
  manufacturer_id
  avail
  

* ProductDescriptions table:
  product_id
  lang_code
  short_description
  full_description

Primary key in products table is "product_id" while in the second
table is both "product_id" + "lang_code".

If i search for a product in productDesc.. table i found:

product_id: 340
lang_code: EN

And a second row with:

product_id: 340
lang_code: ES

Now my problem... i have a form with the product & productDesc
information but i can't get saving working... how can i save the
updated data ???

I tried:

$this->Product->save($this->data()) && $this->ProductDescription-
>save($this->data())

but i got an error "Duplicate entry 340-ES..."

Any hint???

THANKS




--~--~-~--~~~---~--~~
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: Case by case validation

2008-02-06 Thread Dardo Sordi Bogado

That should work, but increases coupling in the system.

On Feb 6, 2008 5:07 PM, b logica <[EMAIL PROTECTED]> wrote:
>
> On Feb 3, 2008 7:13 AM, cronet <[EMAIL PROTECTED]> wrote:
> >
> > Hello,
> >
> >
> > how realising case by case validation ?? (e.g. A form need to validate
> > different for a user logged in, or not logged in)
> >
> > First, I thought about creating two different Models with the
> > different validation cases.
> > But what about the funcitons I need for the models which I would pack
> > in the model itselfs. So I would need to create the same functions in
> > both models... Not really DRY...
> > In app_model these functions would be available in all models, which i
> > don't prefer...
> >
> > What would be a more elegant way to handle case by case validations ?
> >
>
> Create validation methods in your model and pass the name of those to
> your validation rules. In the method(s) you can check if the user is
> logged-in or not.
>
>
> >
>

--~--~-~--~~~---~--~~
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: User Management\Login\Auth Framework

2008-02-06 Thread Axel Ariel Arroyo Braconi

Jake i create an account and i send an email with datas access for
you, is active, just change the email, and password.

On 2/6/08, jakecake <[EMAIL PROTECTED]> wrote:
>
> > Jake , bakery is working i create an account recently, and i can write
> > a post. Whats your problem?
>
> My problem is that I never received the confirmation mail. If I try to
> register again, I get a weird message in the form so that this
> username is already registred (and I'm supposed to reset it). If I try
> to reset the password, I get 'You should receive an email with further
> instruction shortly' but not mail...
>
> Someone on the IRC channel told me the bakery is a bit broken, and
> that I have to wait (and see:)
>
>
>
> >
>


-- 
Axel

--~--~-~--~~~---~--~~
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: 1.2: Pagination and Manual Query?, Can this be done? If so , how?

2008-02-06 Thread DragonI

You're right Baz,

Chris - I owe you Mad Props :)


On Feb 6, 1:43 pm, Baz <[EMAIL PROTECTED]> wrote:
> Actually, I think you mean Chris is the man. Then (by even further
> extension) Nate would be the main, cuz Chris bugged him on IM for help with
> this.
>
> But, I know what you mean. I've found these group posts time and time again,
> but they never really helped. Telling me you can Override something is one
> thing. But how am I supposed to know what goes into it? I guess the answer
> is that I'm supposed to go digging through the code.
>
> But a better answer would be something like:
>
> Override paginate() to return a model similar to find('all') and
> paginateCount() to return something like find('count')...
>
> But with that said, I looked through the API and it was just daunting.
> Chris' solution seems rather slim to me.
>
> So these are the questions I have for someone more knowledgeable:
>
>1. It seems that the paginate() function could consist of only a
>find('all') and pageCount() by find('count')?
>2. If so, what handles all the paging stuff?
>3. Or is this one of those magic things again where just overriding
>paginate() and pageCount() magically make stuff work?
>
> --
> Baz L
> Web Development 2.0http://WebDevelopment2.com/
>
> On Feb 6, 2008 12:17 PM, DragonI <[EMAIL PROTECTED]> wrote:
>
>
>
> > Baz, you're the MAN.
>
> > This is something I can work with :)
>
> > BTW, in all fairness to patcoll, it was better than him giving me
> > "RTFM" ;) which I actually wish I could instead of digging thru code.
>
> > And patcoll there is absolutely no offense meant. You did try to help.
> > So kudos to you. I know that I was a little opened end with my
> > question and not stating that I had searched for stuff. But typically,
> > I do do my best to try and find / work things out 1st before imposing.
>
> > On Feb 6, 12:11 pm, Baz <[EMAIL PROTECTED]> wrote:
> > > I feel your pain man. Every time I search on the same topic I get
> > generic
> > > responses like "Override the paginate function"
>
> > > Here seems to be an example:
> >http://www.littlehart.net/atthekeyboard/2007/12/11/cakephp-pagination...
>
> > > Haven't tested though. From the looks of it, you can replace the
> > > $this->findByName() with $this->query() (since they should return the
> > same
> > > structure) and also stick a count in ur statement to populate
> > paginateCount.
>
> > > See if it works.
> > > --
> > > Baz L
> > > Web Development 2.0http://WebDevelopment2.com/
>
> > > On Feb 6, 2008 10:41 AM, DragonI <[EMAIL PROTECTED]> wrote:
>
> > > > Thanks patcoll BUT I've already searched and read all of the threads
> > > > that I could find. Maybe my terminology is wrong manual query vs
> > > > custom query.
>
> > > > 1st link - is NOT using $this->query, i.e. Simple query - mine is more
> > > > complex
>
> > > > SELECT Bookmark.id, Bookmark.name, Bookmark.url, Bookmark.modified,
> > > >User.id, User.username
> > > > FROM bookmarks as Bookmark, users as User
> > > > WHERE Bookmark.user_id = $user_id
> > > > LIMIT .
>
> > > > 2nd Link - was never answered - see Chad's posting
>
> > > > 3rd Link - read this but they all cover "Custom Query" using cake
> > > > $conditions.
>
> > > > On Feb 6, 11:09 am, patcoll <[EMAIL PROTECTED]> wrote:
> > > > > A search in this group helps:
>
> >http://groups.google.com/group/cake-php/browse_thread/thread/f990a459...
>
> >http://groups.google.com/group/cake-php/browse_thread/thread/d0cb3f77...
>
> > > > > For more tough issues:
>
> > > > >http://groups.google.com/group/cake-php/web/frequent-discussions
>
> > > > > On Feb 6, 10:28 am, DragonI <[EMAIL PROTECTED]> wrote:
>
> > > > > > I'm wondering if it's possible to use cake's pagination with a
> > manual
> > > > > > query ($this->query)?
>
> > > > > > I understand that I have to determine the offset and I have to get
> > the
> > > > > > total records myself. But I'm stumped because paginate is
> > expecting
> > > > > > the model name.
>
> > > > > > Thanks.
--~--~-~--~~~---~--~~
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: 1.2 Auth changing passwords on its own?

2008-02-06 Thread [EMAIL PROTECTED]

Never mind. This was all my fault.
beforeSave in the User model naturally needs to check for empty aswell
as isset. I tend to do this alot since blank = false but is still set.

/Martin

function beforeSave()
{
if ( isset($this->data['User']['new_pass']) && !empty($this-
>data['User']['new_pass']) )
{
$this->data['User']['password'] =
Security::hash(Configure::read('Security.salt') . $this->data['User']
['new_pass']);
}
return true;
}



On Feb 6, 8:06 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> This is a bit wierd.
> I have just a basic Auth setup (no ACL, just logins). At least three
> times in the past two days the hashed password has magically changed
> on te user I usually login with. Or more to the point... all users
> have the same password-hash. I am pretty sure I am not saving users
> fro any other controller I am working on.
>
> I disable auth and edit the user-accounts, resetting the passwords to
> "1234" and similar test-passwords. I can now login again. Later,
> without warning, I can't login again and the password-hashes are back
> to the same they were before.
>
> Is this a known general problem or do I need to start logging a lot of
> mysql stuff? (I have no idea exactly when the change happens at this
> point)
>
> chreers
> Martin
--~--~-~--~~~---~--~~
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: Problem with findAllThreaded... bug or not?

2008-02-06 Thread majna

This should work:
$categories = $this->Category->findAllThreaded($conditions,
array('Category.id','Category.parent_id','Category.name'),'Category.sort
ASC');
if not, use older cake release.



On 6 velj, 10:43, Bo-oz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm Using CakePHP 1.19. I have a menu table with the following fields:
>
> - id
> - parent_id
> - name
> - link
>
> For sorting purposes, I would like the menu to show ordered by Name
> ASC.
>
> When I use:
>
> $this->Menu->findAllThreaded('','','name ASC');
>
> The resulting array only contains siblings with a name that is higher
> in the alfabet then the name of the parent. For instance
>
> id: 1
> parent_id: null
> name: beta
>
> id:2
> parent_id: 1
> name: alfa
>
> id:3
> parent_id:1
> name:kappa
>
> Will result in parent 1 having only ONE sibling, id:3 kappa.
>
> A solitution to this behaviour is adding the parent_id to the Order By
> clause as the primary sort condition:
>
> $this->Menu->findAllThreaded('','',array('parent_id','name');
>
> I'm wondering if this is expectable behaviour... any thoughts?
--~--~-~--~~~---~--~~
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: Case by case validation

2008-02-06 Thread b logica

On Feb 3, 2008 7:13 AM, cronet <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
>
> how realising case by case validation ?? (e.g. A form need to validate
> different for a user logged in, or not logged in)
>
> First, I thought about creating two different Models with the
> different validation cases.
> But what about the funcitons I need for the models which I would pack
> in the model itselfs. So I would need to create the same functions in
> both models... Not really DRY...
> In app_model these functions would be available in all models, which i
> don't prefer...
>
> What would be a more elegant way to handle case by case validations ?
>

Create validation methods in your model and pass the name of those to
your validation rules. In the method(s) you can check if the user is
logged-in or not.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



1.2 Auth changing passwords on its own?

2008-02-06 Thread [EMAIL PROTECTED]

This is a bit wierd.
I have just a basic Auth setup (no ACL, just logins). At least three
times in the past two days the hashed password has magically changed
on te user I usually login with. Or more to the point... all users
have the same password-hash. I am pretty sure I am not saving users
fro any other controller I am working on.

I disable auth and edit the user-accounts, resetting the passwords to
"1234" and similar test-passwords. I can now login again. Later,
without warning, I can't login again and the password-hashes are back
to the same they were before.

Is this a known general problem or do I need to start logging a lot of
mysql stuff? (I have no idea exactly when the change happens at this
point)

chreers
Martin
--~--~-~--~~~---~--~~
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: 1.2: Pagination and Manual Query?, Can this be done? If so , how?

2008-02-06 Thread Baz
OH CRAP!!!

I think I just understood!

It IS MAGIC!!!

Sorry guys, I'm just a lil' bit excited. In the past I've been trying to
override paginate() in the CONTROLLER as opposed to implementing it in the
MODEL!

The paginate() in the controller, remains untouched. You simply created
paginate() and paginateCount() in the MODEL and give them the same
parameters as findAll() and findCount() respectively.

That's it. You can pass conditions, fields, order, etc to them via the
$scope parameter in the paginate() in the controller class.

Sorry if this is repeated information for most of you, but sometimes it just
takes saying the same thing in a different (Most duh, you idiot) way for
some people (Talking only bout myself here) to get it.
--
Baz L
Web Development 2.0
http://WebDevelopment2.com/

On Feb 6, 2008 12:43 PM, Baz <[EMAIL PROTECTED]> wrote:

> Actually, I think you mean Chris is the man. Then (by even further
> extension) Nate would be the main, cuz Chris bugged him on IM for help with
> this.
>
> But, I know what you mean. I've found these group posts time and time
> again, but they never really helped. Telling me you can Override something
> is one thing. But how am I supposed to know what goes into it? I guess the
> answer is that I'm supposed to go digging through the code.
>
> But a better answer would be something like:
>
> Override paginate() to return a model similar to find('all') and
> paginateCount() to return something like find('count')...
>
> But with that said, I looked through the API and it was just daunting.
> Chris' solution seems rather slim to me.
>
> So these are the questions I have for someone more knowledgeable:
>
>
>1. It seems that the paginate() function could consist of only a
>find('all') and pageCount() by find('count')?
>2. If so, what handles all the paging stuff?
>3. Or is this one of those magic things again where just overriding
>paginate() and pageCount() magically make stuff work?
>
> --
> Baz L
> Web Development 2.0
> http://WebDevelopment2.com/
>
> On Feb 6, 2008 12:17 PM, DragonI <[EMAIL PROTECTED]> wrote:
>
> >
> > Baz, you're the MAN.
> >
> > This is something I can work with :)
> >
> > BTW, in all fairness to patcoll, it was better than him giving me
> > "RTFM" ;) which I actually wish I could instead of digging thru code.
> >
> > And patcoll there is absolutely no offense meant. You did try to help.
> > So kudos to you. I know that I was a little opened end with my
> > question and not stating that I had searched for stuff. But typically,
> > I do do my best to try and find / work things out 1st before imposing.
> >
> >
> >
> > On Feb 6, 12:11 pm, Baz <[EMAIL PROTECTED]> wrote:
> > > I feel your pain man. Every time I search on the same topic I get
> > generic
> > > responses like "Override the paginate function"
> > >
> > > Here seems to be an example:
> > http://www.littlehart.net/atthekeyboard/2007/12/11/cakephp-pagination...
> > >
> > > Haven't tested though. From the looks of it, you can replace the
> > > $this->findByName() with $this->query() (since they should return the
> > same
> > > structure) and also stick a count in ur statement to populate
> > paginateCount.
> > >
> > > See if it works.
> > > --
> > > Baz L
> > > Web Development 2.0http://WebDevelopment2.com/
> > >
> > > On Feb 6, 2008 10:41 AM, DragonI <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > > > Thanks patcoll BUT I've already searched and read all of the threads
> > > > that I could find. Maybe my terminology is wrong manual query vs
> > > > custom query.
> > >
> > > > 1st link - is NOT using $this->query, i.e. Simple query - mine is
> > more
> > > > complex
> > >
> > > > SELECT Bookmark.id, Bookmark.name, Bookmark.url, Bookmark.modified,
> > > >User.id, User.username
> > > > FROM bookmarks as Bookmark, users as User
> > > > WHERE Bookmark.user_id = $user_id
> > > > LIMIT .
> > >
> > > > 2nd Link - was never answered - see Chad's posting
> > >
> > > > 3rd Link - read this but they all cover "Custom Query" using cake
> > > > $conditions.
> > >
> > > > On Feb 6, 11:09 am, patcoll <[EMAIL PROTECTED]> wrote:
> > > > > A search in this group helps:
> > >
> > > > >
> > http://groups.google.com/group/cake-php/browse_thread/thread/f990a459...
> > >
> > > > >
> > http://groups.google.com/group/cake-php/browse_thread/thread/d0cb3f77...
> > >
> > > > > For more tough issues:
> > >
> > > > >http://groups.google.com/group/cake-php/web/frequent-discussions
> > >
> > > > > On Feb 6, 10:28 am, DragonI <[EMAIL PROTECTED]> wrote:
> > >
> > > > > > I'm wondering if it's possible to use cake's pagination with a
> > manual
> > > > > > query ($this->query)?
> > >
> > > > > > I understand that I have to determine the offset and I have to
> > get the
> > > > > > total records myself. But I'm stumped because paginate is
> > expecting
> > > > > > the model name.
> > >
> > > > > > Thanks.
> > > >
> >
>

--~--~-~--~~~---~--~~
You recei

Re: PostgreSQL and UPDATE table aliases

2008-02-06 Thread b logica

On Feb 4, 2008 12:15 PM, bcyde <[EMAIL PROTECTED]> wrote:
>
> Just a quick follow up to this for anyone that may be having these
> issues.  The latest fixes can be downloaded from trac.cakephp.org 1.2
> nightly builds.  This fixed the update problems for me (but a warning
> that it just caused more problems in INSERT statements).  Since the
> current project I'm working on is fairly lightweight I was able to
> switch to MySQL.  Just a little heads up for people that aren't using
> MySQL with Cake and are planning to use the latest 1.2 beta in a
> production environment or upgrade their current development to the
> latest release.

I'm using Postgres also. What problems did you see with INSERT? And
what version were you see this with?

--~--~-~--~~~---~--~~
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: Multiple Schemas in PostgreSQL

2008-02-06 Thread b logica

On Feb 1, 2008 2:35 PM, Prozac <[EMAIL PROTECTED]> wrote:
>
> Hi, im new at this group and also kind of new using cakePHP, im having
> a problem with an app im working on with multiple schemas.
>
> Now, in this app there are tables relations between schemas, at first
> i thought  i could use a different connection for each schema, but
> that didn't work.
>
> I found in this group that someone appear to have worked this out in
> this thread 
> http://groups.google.com/group/cake-php/browse_thread/thread/4f3fcad44af52cb2
> but i don't quite get it, and come to think that its no the same
> (could be my poor english)

That was me. Sorry, that was all pretty complicated. I was also
discussing more than one problem, really.

Anyway, I never did figure out how to get Cake to use more than one
schema. From examining the source, it appears that a lot of changes
would be necessary before it could work. However, I can still make
queries across schemas, but I have to make the queries directly. But I
don't think that you'll be able to get Cake to honour your
associations if the tables are in different schemas. In my case, I
could do what I needed with a query in afterFind().

If you look at the file dbo_postgres.php you might see something that
I missed. Unfortunately, I don't have any time to try to fix this,
myself. It looks like phpnut was working on this earlier. But I have a
feeling that the problem lies more with how Cake works rather than
something that a change in dbo_postgres.php could fix :-(

--~--~-~--~~~---~--~~
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: 1.2: Pagination and Manual Query?, Can this be done? If so , how?

2008-02-06 Thread Baz
Actually, I think you mean Chris is the man. Then (by even further
extension) Nate would be the main, cuz Chris bugged him on IM for help with
this.

But, I know what you mean. I've found these group posts time and time again,
but they never really helped. Telling me you can Override something is one
thing. But how am I supposed to know what goes into it? I guess the answer
is that I'm supposed to go digging through the code.

But a better answer would be something like:

Override paginate() to return a model similar to find('all') and
paginateCount() to return something like find('count')...

But with that said, I looked through the API and it was just daunting.
Chris' solution seems rather slim to me.

So these are the questions I have for someone more knowledgeable:


   1. It seems that the paginate() function could consist of only a
   find('all') and pageCount() by find('count')?
   2. If so, what handles all the paging stuff?
   3. Or is this one of those magic things again where just overriding
   paginate() and pageCount() magically make stuff work?

--
Baz L
Web Development 2.0
http://WebDevelopment2.com/

On Feb 6, 2008 12:17 PM, DragonI <[EMAIL PROTECTED]> wrote:

>
> Baz, you're the MAN.
>
> This is something I can work with :)
>
> BTW, in all fairness to patcoll, it was better than him giving me
> "RTFM" ;) which I actually wish I could instead of digging thru code.
>
> And patcoll there is absolutely no offense meant. You did try to help.
> So kudos to you. I know that I was a little opened end with my
> question and not stating that I had searched for stuff. But typically,
> I do do my best to try and find / work things out 1st before imposing.
>
>
>
> On Feb 6, 12:11 pm, Baz <[EMAIL PROTECTED]> wrote:
> > I feel your pain man. Every time I search on the same topic I get
> generic
> > responses like "Override the paginate function"
> >
> > Here seems to be an example:
> http://www.littlehart.net/atthekeyboard/2007/12/11/cakephp-pagination...
> >
> > Haven't tested though. From the looks of it, you can replace the
> > $this->findByName() with $this->query() (since they should return the
> same
> > structure) and also stick a count in ur statement to populate
> paginateCount.
> >
> > See if it works.
> > --
> > Baz L
> > Web Development 2.0http://WebDevelopment2.com/
> >
> > On Feb 6, 2008 10:41 AM, DragonI <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Thanks patcoll BUT I've already searched and read all of the threads
> > > that I could find. Maybe my terminology is wrong manual query vs
> > > custom query.
> >
> > > 1st link - is NOT using $this->query, i.e. Simple query - mine is more
> > > complex
> >
> > > SELECT Bookmark.id, Bookmark.name, Bookmark.url, Bookmark.modified,
> > >User.id, User.username
> > > FROM bookmarks as Bookmark, users as User
> > > WHERE Bookmark.user_id = $user_id
> > > LIMIT .
> >
> > > 2nd Link - was never answered - see Chad's posting
> >
> > > 3rd Link - read this but they all cover "Custom Query" using cake
> > > $conditions.
> >
> > > On Feb 6, 11:09 am, patcoll <[EMAIL PROTECTED]> wrote:
> > > > A search in this group helps:
> >
> > > >
> http://groups.google.com/group/cake-php/browse_thread/thread/f990a459...
> >
> > > >
> http://groups.google.com/group/cake-php/browse_thread/thread/d0cb3f77...
> >
> > > > For more tough issues:
> >
> > > >http://groups.google.com/group/cake-php/web/frequent-discussions
> >
> > > > On Feb 6, 10:28 am, DragonI <[EMAIL PROTECTED]> wrote:
> >
> > > > > I'm wondering if it's possible to use cake's pagination with a
> manual
> > > > > query ($this->query)?
> >
> > > > > I understand that I have to determine the offset and I have to get
> the
> > > > > total records myself. But I'm stumped because paginate is
> expecting
> > > > > the model name.
> >
> > > > > Thanks.
> >
>

--~--~-~--~~~---~--~~
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: e-Mail Spam Protection

2008-02-06 Thread b logica

On Feb 6, 2008 5:25 AM, cronet <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
>
> In the template engine smarty, there exists an protection which
> encodes the address e.g. in hex chars. So the address isn't grabbable
> by spam bots via source...
>
> is there something like an e-Mail Spam protection or do I need to
> create a helper?
>

Hex translation probably won't help against bots anymore. It's a
trivial task to implement a bot that can translate hex. What I've been
doing is translating email addresses as they're written to output like
so:

[EMAIL PROTECTED] -> foo AT bar DOT net

Then, on the client side, I have some javascript that trawls through
each page for these spans and rewrites them as proper links. I doubt
there are any bots out there with a javascript engine, so this is
probably pretty safe. If javascript is disabled, the address is still
fairly understandable.

Here's the version that doesn't require any extra libraries (pretty
straightforward to convert this to work with, say, prototype, etc.):

/**
 * from Simon Willison
 *
 * http://simon.incutio.com/archive/2004/05/26/addLoadEvent
 **/
function addLoadEvent(func)
{
  var oldonload = window.onload;
  if (typeof window.onload != 'function')
  {
window.onload = func;
  }
  else
  {
window.onload = function()
{
  oldonload();
  func();
}
  }
}

addLoadEvent(function()
{
var emails = document.getElementsByClassName('span', 'Obfuscated');

if (!emails) return;

var title = '';
var search = [' AT ', ' DOT '];
var replace = ['@', '.'];
var replaced_text = '';

for (var i = 0; i < emails.length; i++)
{
/* get the text node
 */
var text = emails[i].childNodes[0];

if (text)
{
/* search & replace text
 */
replaced_text = text.nodeValue;

for (var j = 0; j < search.length; j++)
{
var reg_exp = new RegExp(search[j], 'g');
replaced_text = replaced_text.replace(reg_exp, 
replace[j]);
}

/* create anchor node
 */
var link = document.createElement('a');
link.setAttribute('title', title);
link.setAttribute('href', 'mailto:' + replaced_text);

/* create new text node and append to anchor
 */
var text_node = document.createTextNode(replaced_text);

link.appendChild(text_node);

/* swap in anchor for text
 */
emails[i].replaceChild(link, emails[i].childNodes[0]);
}
}
});

Whether you do the server-side stuff as a helper or not i can't say
because i haven't got there yet (still a Cake noob).

--~--~-~--~~~---~--~~
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: 1.2: Pagination and Manual Query?, Can this be done? If so , how?

2008-02-06 Thread DragonI

Baz, you're the MAN.

This is something I can work with :)

BTW, in all fairness to patcoll, it was better than him giving me
"RTFM" ;) which I actually wish I could instead of digging thru code.

And patcoll there is absolutely no offense meant. You did try to help.
So kudos to you. I know that I was a little opened end with my
question and not stating that I had searched for stuff. But typically,
I do do my best to try and find / work things out 1st before imposing.



On Feb 6, 12:11 pm, Baz <[EMAIL PROTECTED]> wrote:
> I feel your pain man. Every time I search on the same topic I get generic
> responses like "Override the paginate function"
>
> Here seems to be an 
> example:http://www.littlehart.net/atthekeyboard/2007/12/11/cakephp-pagination...
>
> Haven't tested though. From the looks of it, you can replace the
> $this->findByName() with $this->query() (since they should return the same
> structure) and also stick a count in ur statement to populate paginateCount.
>
> See if it works.
> --
> Baz L
> Web Development 2.0http://WebDevelopment2.com/
>
> On Feb 6, 2008 10:41 AM, DragonI <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks patcoll BUT I've already searched and read all of the threads
> > that I could find. Maybe my terminology is wrong manual query vs
> > custom query.
>
> > 1st link - is NOT using $this->query, i.e. Simple query - mine is more
> > complex
>
> > SELECT Bookmark.id, Bookmark.name, Bookmark.url, Bookmark.modified,
> >User.id, User.username
> > FROM bookmarks as Bookmark, users as User
> > WHERE Bookmark.user_id = $user_id
> > LIMIT .
>
> > 2nd Link - was never answered - see Chad's posting
>
> > 3rd Link - read this but they all cover "Custom Query" using cake
> > $conditions.
>
> > On Feb 6, 11:09 am, patcoll <[EMAIL PROTECTED]> wrote:
> > > A search in this group helps:
>
> > >http://groups.google.com/group/cake-php/browse_thread/thread/f990a459...
>
> > >http://groups.google.com/group/cake-php/browse_thread/thread/d0cb3f77...
>
> > > For more tough issues:
>
> > >http://groups.google.com/group/cake-php/web/frequent-discussions
>
> > > On Feb 6, 10:28 am, DragonI <[EMAIL PROTECTED]> wrote:
>
> > > > I'm wondering if it's possible to use cake's pagination with a manual
> > > > query ($this->query)?
>
> > > > I understand that I have to determine the offset and I have to get the
> > > > total records myself. But I'm stumped because paginate is expecting
> > > > the model name.
>
> > > > Thanks.
--~--~-~--~~~---~--~~
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: turn off certain associations for a model

2008-02-06 Thread Defranco

Hi Dardo,

Very interesting this article.

Thanks for the reply.
--~--~-~--~~~---~--~~
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: 1.2: Pagination and Manual Query?, Can this be done? If so , how?

2008-02-06 Thread Baz
I feel your pain man. Every time I search on the same topic I get generic
responses like "Override the paginate function"

Here seems to be an example:
http://www.littlehart.net/atthekeyboard/2007/12/11/cakephp-pagination-with-a-habtm-relationship/

Haven't tested though. From the looks of it, you can replace the
$this->findByName() with $this->query() (since they should return the same
structure) and also stick a count in ur statement to populate paginateCount.

See if it works.
--
Baz L
Web Development 2.0
http://WebDevelopment2.com/

On Feb 6, 2008 10:41 AM, DragonI <[EMAIL PROTECTED]> wrote:

>
> Thanks patcoll BUT I've already searched and read all of the threads
> that I could find. Maybe my terminology is wrong manual query vs
> custom query.
>
> 1st link - is NOT using $this->query, i.e. Simple query - mine is more
> complex
>
> SELECT Bookmark.id, Bookmark.name, Bookmark.url, Bookmark.modified,
>User.id, User.username
> FROM bookmarks as Bookmark, users as User
> WHERE Bookmark.user_id = $user_id
> LIMIT .
>
> 2nd Link - was never answered - see Chad's posting
>
> 3rd Link - read this but they all cover "Custom Query" using cake
> $conditions.
>
>
>
> On Feb 6, 11:09 am, patcoll <[EMAIL PROTECTED]> wrote:
> > A search in this group helps:
> >
> > http://groups.google.com/group/cake-php/browse_thread/thread/f990a459...
> >
> > http://groups.google.com/group/cake-php/browse_thread/thread/d0cb3f77...
> >
> > For more tough issues:
> >
> > http://groups.google.com/group/cake-php/web/frequent-discussions
> >
> > On Feb 6, 10:28 am, DragonI <[EMAIL PROTECTED]> wrote:
> >
> > > I'm wondering if it's possible to use cake's pagination with a manual
> > > query ($this->query)?
> >
> > > I understand that I have to determine the offset and I have to get the
> > > total records myself. But I'm stumped because paginate is expecting
> > > the model name.
> >
> > > Thanks.
> >
>

--~--~-~--~~~---~--~~
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: Ajax links working first time (Solved)

2008-02-06 Thread Fran Iglesias

Hi,

El 05/02/2008, a las 19:11, Fran Iglesias escribió:

> This works well... the first time.
>
> When I create or edit an event the index updates but the links (ajax
> links are created with AjaxHelper:link()) doesn't work. In fact, when
> I look at the generated HTML there is no javascript code to manage the
> Ajax request (the first time, there is).


I think I've solved the problem. I wrote a redux with a fake  
controller and a pair of actions to simulate the situation.

I used htmlentities to show the code generated by the AjaxHelper::link 
() method. If I did so, the ajax link generated in the ajax request  
worked ok. If no, the link simply doesn't respond. So I guessed that  
there was a problem with the encoding of the ajax request.

I need to build the ajax link explicitly setting the 'encoding'  
option to 'utf-8' (in the options array that you pass to the link()  
method).

Hope that helps others.

--
Fran Iglesias
[EMAIL PROTECTED]
--~--~-~--~~~---~--~~
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: CakePHP guide

2008-02-06 Thread John David Anderson (_psychic_)


On Feb 6, 2008, at 10:03 AM, Baz wrote:

> I can't help but feel that I'm not the only one who feels that way.  
> What would "qualify" one to be able to contribute to the Official  
> Cake documentation or the Bakery?

There is no qualification.

New people have the distinct advantage of being able to point out  
weaknesses. If nothing else, let us know what needs strength or better  
coverage. The Bakery probably isn't for noobs, but helping proof and  
suggest sections to the existing docs is extremely helpful to me.

-- John

--~--~-~--~~~---~--~~
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: 1.2.: Gerating list concatenating value path

2008-02-06 Thread grigri

Set::format($data, '%s, %s', array('{n}.User.last_name',
'{n}.User.first_name'));

On Feb 6, 4:51 pm, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote:
> Hi bakers,
>
> There is a way to concatenate a value path?
> Like this: "{n}.User.last_name, {n}.User.first_name"
>
> Thanks
> --
> Renan Gonçalves - Software Engineer
> Cell Phone: +55 (11) 8633-6018
> MSN: [EMAIL PROTECTED]
> Web Site: renangoncalves.com
> São Paulo - SP/Brazil
--~--~-~--~~~---~--~~
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: CakePHP guide

2008-02-06 Thread Baz
Personally, this is the problem I have with the lack of documentation:

CakePHP was somewhat intimidating for me to get started with. With that
said, I have done a few simple apps, an make-shift CMS that serves my
purpose, and just general fudging around with stuff and trying to get things
working.

However, I'm never sure whether I'm doing things the "right" way. To be
honest, all this MVC stuff was brand new to me by the time I started. This
is why I've been hesitant to submit articles to the bakery, for example.
Since a lot of my stuff, can be considered patchwork, I wouldn't want to
mislead people searching for "official" solutions on the bakery (and even
Official Docs). That's why I usually keep my ramblings on my own blog.

I can't help but feel that I'm not the only one who feels that way. What
would "qualify" one to be able to contribute to the Official Cake
documentation or the Bakery?

Just My 2 cents.

PS:
 - The API is a great resource as is, but it can be HEAVILY improved by just
placing a few (well a whole lot) of examples for some of the more difficult
functions. $form->input() any one? I tend to get lost in the MANY uses of
options arrays.
 - I've found some hidden treasures in: http://bin.cakephp.org/saved. The
pagination on that page doesn't work though. I didn't find a category to
report it under in trac.

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



1.2.: Gerating list concatenating value path

2008-02-06 Thread Renan Gonçalves
Hi bakers,

There is a way to concatenate a value path?
Like this: "{n}.User.last_name, {n}.User.first_name"


Thanks
-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 (11) 8633-6018
MSN: [EMAIL PROTECTED]
Web Site: renangoncalves.com
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
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: CakePHP guide

2008-02-06 Thread Dr. Tarique Sani

On Feb 6, 2008 9:55 PM, phpjoy <[EMAIL PROTECTED]> wrote:
> I think that only an idiot would be happy to contribute to anything
> after such a stupid comment.
>
> I like CakePHP as a product (otherwise I wouldn't be here), but nate,
> you should work on your human skills.

Huh!

Where did that come from?

T

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 1.2: Pagination and Manual Query?, Can this be done? If so , how?

2008-02-06 Thread DragonI

Thanks patcoll BUT I've already searched and read all of the threads
that I could find. Maybe my terminology is wrong manual query vs
custom query.

1st link - is NOT using $this->query, i.e. Simple query - mine is more
complex

SELECT Bookmark.id, Bookmark.name, Bookmark.url, Bookmark.modified,
User.id, User.username
FROM bookmarks as Bookmark, users as User
WHERE Bookmark.user_id = $user_id
LIMIT .

2nd Link - was never answered - see Chad's posting

3rd Link - read this but they all cover "Custom Query" using cake
$conditions.



On Feb 6, 11:09 am, patcoll <[EMAIL PROTECTED]> wrote:
> A search in this group helps:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/f990a459...
>
> http://groups.google.com/group/cake-php/browse_thread/thread/d0cb3f77...
>
> For more tough issues:
>
> http://groups.google.com/group/cake-php/web/frequent-discussions
>
> On Feb 6, 10:28 am, DragonI <[EMAIL PROTECTED]> wrote:
>
> > I'm wondering if it's possible to use cake's pagination with a manual
> > query ($this->query)?
>
> > I understand that I have to determine the offset and I have to get the
> > total records myself. But I'm stumped because paginate is expecting
> > the model name.
>
> > Thanks.
--~--~-~--~~~---~--~~
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: CakePHP creating strange SQL query

2008-02-06 Thread TracyB

It just happens on this one, and I'm wondering if it has to do with
the fact that i'm using a legacy database, so my User model is
actually using the table Registrar. I was just wondering if maybe it's
caused somehow by it being an access database and having the $useTable
set. Perhaps a bug in the adodb driver in that particular situation or
something.

I don't actually have any other models on the exact same database,
though i have another model running off a different access database
table, and that one doesn't cause any problems.

On Feb 6, 11:36 am, grigri <[EMAIL PROTECTED]> wrote:
> Oops, yes, you're right. I was seeing commas where there weren't any.
> Reading too fast, I suppose. Sorry.
>
> The aliasing is normally handled in the specific datasource class [for
> the database type]
>
> Does this happen for any other models/tables on the same database, or
> just this one?
>
> On Feb 6, 4:24 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > Well, i really don't think it needs to have the same field aliased 3
> > times to the same name. That is what is causing access to choke.
>
> > I'm fairly sure it would be better for 'SELECT "User"."AccName" AS
> > "User__AccName" AS
> > "User"__"AccName" AS "User__AccName",' to just use the AS once, rather
> > than 3 times.
>
> > Again, the repeated AS is causing the choke, I'm just trying to find
> > out where that repetition is coming from.
>
> > Tracy
>
> > On Feb 6, 11:20 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > > This isn't a bug, or even a problem.
>
> > > Cake unifies all database systems with a consistent API. When
> > > returning result sets, certain database systems (like mysql) identify
> > > the originating table for each field, whereas others don't.
>
> > > CakePHP needs that information to decide which array to place the
> > > result field in, for queries using joins.
>
> > > If the database does not support retrieving the table information,
> > > cake fakes it by imposing a certain format on the field aliases
> > > (Table__field) and extracts them later. You never see the aliases
> > > except in the SQL log.
>
> > > Bottom line: leave it be, it's supposed to be like this.
>
> > > On Feb 6, 4:06 pm, hellfish <[EMAIL PROTECTED]> wrote:
>
> > > > Right now I'm going forward using mysql, but my company only provides
> > > > sql server so it's going to be interesting in a few days.
>
> > > > I wasn't able to find any fixes to that problem.
>
> > > > On Feb 6, 3:15 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > > > this is under the adodb driver for access. I have another model using
> > > > > an access database, and that one doesn't seem to be doing this. did
> > > > > you find a fix, or did you just switch to a different database?
>
> > > > > On Feb 6, 10:14 am, hellfish <[EMAIL PROTECTED]> wrote:
>
> > > > > > I had a similar problem while using adodb driver and odbc_mssql. 
> > > > > > While
> > > > > > using mysql worked ok.
>
> > > > > > What driver are you using?
>
> > > > > > On Feb 6, 1:48 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > > > > > I'm trying to go through the Example: Simple User Authentication 
> > > > > > > in
> > > > > > > the CakePHP manual, to learn how to set up my own authentication 
> > > > > > > for a
> > > > > > > website. The database that I have to use for authentication is a
> > > > > > > legacy Access database, and I have connected to it successfully 
> > > > > > > with
> > > > > > > Cake already. For some reason, when I try to login, the query that
> > > > > > > gets generated is a little screwy.
>
> > > > > > > It generates: SELECT "User"."AccName" AS "User__AccName" AS
> > > > > > > "User"__"AccName" AS "User__AccName", "User"."AccPass" AS
> > > > > > > "User__AccPass" AS "User"__"AccPass" AS "User__AccPass",
> > > > > > > "User"."FirstName" AS "User__FirstName" AS "User"__"FirstName" AS
> > > > > > > "User__FirstName", "User"."Surname" AS "User__Surname" AS
> > > > > > > "User"__"Surname" AS "User__Surname", "User"."ContactID" AS
> > > > > > > "User__ContactID" FROM "registrar" AS "User" WHERE 
> > > > > > > "User"."acc_name" =
> > > > > > > 'dev' LIMIT 1
>
> > > > > > > I don't understand why it's repeating the "AS" so many times, I
> > > > > > > haven't seen that before in any of the generated queries.
>
> > > > > > > My model is fairly simple:
> > > > > > > class User extends AppModel
> > > > > > > {
> > > > > > > var $name = 'User';
> > > > > > > var $useTable = 'registrar';
> > > > > > > var $primaryKey = 'ContactID';
> > > > > > > var $useDbConfig = 'orderflow';
> > > > > > > var $hasMany = 'Order';
>
> > > > > > > }
>
> > > > > > > Is there something remarkably stupid that I'm doing that I'm just 
> > > > > > > not
> > > > > > > aware of?
>
> > > > > > > Thanks,
> > > > > > > Tracy
--~--~-~--~~~---~--~~
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 un

Re: CakePHP creating strange SQL query

2008-02-06 Thread grigri

Oops, yes, you're right. I was seeing commas where there weren't any.
Reading too fast, I suppose. Sorry.

The aliasing is normally handled in the specific datasource class [for
the database type]

Does this happen for any other models/tables on the same database, or
just this one?

On Feb 6, 4:24 pm, TracyB <[EMAIL PROTECTED]> wrote:
> Well, i really don't think it needs to have the same field aliased 3
> times to the same name. That is what is causing access to choke.
>
> I'm fairly sure it would be better for 'SELECT "User"."AccName" AS
> "User__AccName" AS
> "User"__"AccName" AS "User__AccName",' to just use the AS once, rather
> than 3 times.
>
> Again, the repeated AS is causing the choke, I'm just trying to find
> out where that repetition is coming from.
>
> Tracy
>
> On Feb 6, 11:20 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > This isn't a bug, or even a problem.
>
> > Cake unifies all database systems with a consistent API. When
> > returning result sets, certain database systems (like mysql) identify
> > the originating table for each field, whereas others don't.
>
> > CakePHP needs that information to decide which array to place the
> > result field in, for queries using joins.
>
> > If the database does not support retrieving the table information,
> > cake fakes it by imposing a certain format on the field aliases
> > (Table__field) and extracts them later. You never see the aliases
> > except in the SQL log.
>
> > Bottom line: leave it be, it's supposed to be like this.
>
> > On Feb 6, 4:06 pm, hellfish <[EMAIL PROTECTED]> wrote:
>
> > > Right now I'm going forward using mysql, but my company only provides
> > > sql server so it's going to be interesting in a few days.
>
> > > I wasn't able to find any fixes to that problem.
>
> > > On Feb 6, 3:15 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > > this is under the adodb driver for access. I have another model using
> > > > an access database, and that one doesn't seem to be doing this. did
> > > > you find a fix, or did you just switch to a different database?
>
> > > > On Feb 6, 10:14 am, hellfish <[EMAIL PROTECTED]> wrote:
>
> > > > > I had a similar problem while using adodb driver and odbc_mssql. While
> > > > > using mysql worked ok.
>
> > > > > What driver are you using?
>
> > > > > On Feb 6, 1:48 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > > > > I'm trying to go through the Example: Simple User Authentication in
> > > > > > the CakePHP manual, to learn how to set up my own authentication 
> > > > > > for a
> > > > > > website. The database that I have to use for authentication is a
> > > > > > legacy Access database, and I have connected to it successfully with
> > > > > > Cake already. For some reason, when I try to login, the query that
> > > > > > gets generated is a little screwy.
>
> > > > > > It generates: SELECT "User"."AccName" AS "User__AccName" AS
> > > > > > "User"__"AccName" AS "User__AccName", "User"."AccPass" AS
> > > > > > "User__AccPass" AS "User"__"AccPass" AS "User__AccPass",
> > > > > > "User"."FirstName" AS "User__FirstName" AS "User"__"FirstName" AS
> > > > > > "User__FirstName", "User"."Surname" AS "User__Surname" AS
> > > > > > "User"__"Surname" AS "User__Surname", "User"."ContactID" AS
> > > > > > "User__ContactID" FROM "registrar" AS "User" WHERE 
> > > > > > "User"."acc_name" =
> > > > > > 'dev' LIMIT 1
>
> > > > > > I don't understand why it's repeating the "AS" so many times, I
> > > > > > haven't seen that before in any of the generated queries.
>
> > > > > > My model is fairly simple:
> > > > > > class User extends AppModel
> > > > > > {
> > > > > > var $name = 'User';
> > > > > > var $useTable = 'registrar';
> > > > > > var $primaryKey = 'ContactID';
> > > > > > var $useDbConfig = 'orderflow';
> > > > > > var $hasMany = 'Order';
>
> > > > > > }
>
> > > > > > Is there something remarkably stupid that I'm doing that I'm just 
> > > > > > not
> > > > > > aware of?
>
> > > > > > Thanks,
> > > > > > Tracy
--~--~-~--~~~---~--~~
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: CakePHP guide

2008-02-06 Thread John David Anderson (_psychic_)


On Feb 6, 2008, at 9:25 AM, phpjoy wrote:

>
> That attitude is the exact difference between ExtJS which is more
> community-driven and Zend, which is cold and company-driven.
> ExtJS succeeds because the community-force behind it drives it
> forward, because people make tons of plugins. Because they don't need
> a "bakery", they have a simple forum with a WORKING SEARCH.

How exactly does a forum do what the Bakery does? What are you talking  
about?

> You should check how people are turning into staff/core contributers
> there and get a job if they're good enough. I didn't see anyone of the
> core-staff in there bitch about how stupid people are, how questions
> are being asked over and over again. Those messages made by users are
> either deleted or ignored.

Um, from what I can tell, Nate was *not* complaining about anything  
besides the lack of unfocused documentation efforts. Please put your  
straw man away and read his message again.

> I think that only an idiot would be happy to contribute to anything
> after such a stupid comment.
>
> I like CakePHP as a product (otherwise I wouldn't be here), but nate,
> you should work on your human skills.

Settle down - I think you've completely over-reacted. Nate's comment  
wasn't a flame, but yours was.

-- John




On Feb 4, 6:48 pm, nate <[EMAIL PROTECTED]> wrote:
>> The only comment or criticism I have is that it's a shame that such
>> efforts aren't put towards the official documentation.  John gets
>> little to no help from outside contributors, and the only way the
>> community has seen fit to contribute is with scattered, one-off
>> tutorials at various levels of currency, completeness and  
>> accuracy.  I
>> don't mean to denigrate your efforts here, but I really think that
>> efforts like these often serve to scatter and spread the pool of
>> useful information thinner, which just makes it harder to find, which
>> makes people more frustrated.
>>
>> On Feb 3, 1:01 pm, MonkeyGirl <[EMAIL PROTECTED]> wrote:
>>
>>> Hi!
>>
>>> Just to let you all know, I've finally written enough of the CakePHP
>>> guide that I'm working on to warrant putting it online at last. It's
>>> available here:
>>
>>> http://cakephp.bytenoise.co.uk/
>>
>>> It's only the first three chapters so far, but hopefully I should  
>>> have
>>> a lot more there over the next few weeks.
>>
>>> Any comments and constructive criticism are both welcomed.
>>
>>> Thanks,
>>> Zoe.
> >


--~--~-~--~~~---~--~~
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: CakePHP guide

2008-02-06 Thread phpjoy

That attitude is the exact difference between ExtJS which is more
community-driven and Zend, which is cold and company-driven.
ExtJS succeeds because the community-force behind it drives it
forward, because people make tons of plugins. Because they don't need
a "bakery", they have a simple forum with a WORKING SEARCH.
You should check how people are turning into staff/core contributers
there and get a job if they're good enough. I didn't see anyone of the
core-staff in there bitch about how stupid people are, how questions
are being asked over and over again. Those messages made by users are
either deleted or ignored.

I think that only an idiot would be happy to contribute to anything
after such a stupid comment.

I like CakePHP as a product (otherwise I wouldn't be here), but nate,
you should work on your human skills.

On Feb 4, 6:48 pm, nate <[EMAIL PROTECTED]> wrote:
> The only comment or criticism I have is that it's a shame that such
> efforts aren't put towards the official documentation.  John gets
> little to no help from outside contributors, and the only way the
> community has seen fit to contribute is with scattered, one-off
> tutorials at various levels of currency, completeness and accuracy.  I
> don't mean to denigrate your efforts here, but I really think that
> efforts like these often serve to scatter and spread the pool of
> useful information thinner, which just makes it harder to find, which
> makes people more frustrated.
>
> On Feb 3, 1:01 pm, MonkeyGirl <[EMAIL PROTECTED]> wrote:
>
> > Hi!
>
> > Just to let you all know, I've finally written enough of the CakePHP
> > guide that I'm working on to warrant putting it online at last. It's
> > available here:
>
> >http://cakephp.bytenoise.co.uk/
>
> > It's only the first three chapters so far, but hopefully I should have
> > a lot more there over the next few weeks.
>
> > Any comments and constructive criticism are both welcomed.
>
> > Thanks,
> > Zoe.
--~--~-~--~~~---~--~~
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: CakePHP creating strange SQL query

2008-02-06 Thread TracyB

Well, i really don't think it needs to have the same field aliased 3
times to the same name. That is what is causing access to choke.

I'm fairly sure it would be better for 'SELECT "User"."AccName" AS
"User__AccName" AS
"User"__"AccName" AS "User__AccName",' to just use the AS once, rather
than 3 times.

Again, the repeated AS is causing the choke, I'm just trying to find
out where that repetition is coming from.

Tracy

On Feb 6, 11:20 am, grigri <[EMAIL PROTECTED]> wrote:
> This isn't a bug, or even a problem.
>
> Cake unifies all database systems with a consistent API. When
> returning result sets, certain database systems (like mysql) identify
> the originating table for each field, whereas others don't.
>
> CakePHP needs that information to decide which array to place the
> result field in, for queries using joins.
>
> If the database does not support retrieving the table information,
> cake fakes it by imposing a certain format on the field aliases
> (Table__field) and extracts them later. You never see the aliases
> except in the SQL log.
>
> Bottom line: leave it be, it's supposed to be like this.
>
> On Feb 6, 4:06 pm, hellfish <[EMAIL PROTECTED]> wrote:
>
> > Right now I'm going forward using mysql, but my company only provides
> > sql server so it's going to be interesting in a few days.
>
> > I wasn't able to find any fixes to that problem.
>
> > On Feb 6, 3:15 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > this is under the adodb driver for access. I have another model using
> > > an access database, and that one doesn't seem to be doing this. did
> > > you find a fix, or did you just switch to a different database?
>
> > > On Feb 6, 10:14 am, hellfish <[EMAIL PROTECTED]> wrote:
>
> > > > I had a similar problem while using adodb driver and odbc_mssql. While
> > > > using mysql worked ok.
>
> > > > What driver are you using?
>
> > > > On Feb 6, 1:48 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > > > I'm trying to go through the Example: Simple User Authentication in
> > > > > the CakePHP manual, to learn how to set up my own authentication for a
> > > > > website. The database that I have to use for authentication is a
> > > > > legacy Access database, and I have connected to it successfully with
> > > > > Cake already. For some reason, when I try to login, the query that
> > > > > gets generated is a little screwy.
>
> > > > > It generates: SELECT "User"."AccName" AS "User__AccName" AS
> > > > > "User"__"AccName" AS "User__AccName", "User"."AccPass" AS
> > > > > "User__AccPass" AS "User"__"AccPass" AS "User__AccPass",
> > > > > "User"."FirstName" AS "User__FirstName" AS "User"__"FirstName" AS
> > > > > "User__FirstName", "User"."Surname" AS "User__Surname" AS
> > > > > "User"__"Surname" AS "User__Surname", "User"."ContactID" AS
> > > > > "User__ContactID" FROM "registrar" AS "User" WHERE "User"."acc_name" =
> > > > > 'dev' LIMIT 1
>
> > > > > I don't understand why it's repeating the "AS" so many times, I
> > > > > haven't seen that before in any of the generated queries.
>
> > > > > My model is fairly simple:
> > > > > class User extends AppModel
> > > > > {
> > > > > var $name = 'User';
> > > > > var $useTable = 'registrar';
> > > > > var $primaryKey = 'ContactID';
> > > > > var $useDbConfig = 'orderflow';
> > > > > var $hasMany = 'Order';
>
> > > > > }
>
> > > > > Is there something remarkably stupid that I'm doing that I'm just not
> > > > > aware of?
>
> > > > > Thanks,
> > > > > Tracy
--~--~-~--~~~---~--~~
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: CakePHP creating strange SQL query

2008-02-06 Thread grigri

This isn't a bug, or even a problem.

Cake unifies all database systems with a consistent API. When
returning result sets, certain database systems (like mysql) identify
the originating table for each field, whereas others don't.

CakePHP needs that information to decide which array to place the
result field in, for queries using joins.

If the database does not support retrieving the table information,
cake fakes it by imposing a certain format on the field aliases
(Table__field) and extracts them later. You never see the aliases
except in the SQL log.

Bottom line: leave it be, it's supposed to be like this.

On Feb 6, 4:06 pm, hellfish <[EMAIL PROTECTED]> wrote:
> Right now I'm going forward using mysql, but my company only provides
> sql server so it's going to be interesting in a few days.
>
> I wasn't able to find any fixes to that problem.
>
> On Feb 6, 3:15 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > this is under the adodb driver for access. I have another model using
> > an access database, and that one doesn't seem to be doing this. did
> > you find a fix, or did you just switch to a different database?
>
> > On Feb 6, 10:14 am, hellfish <[EMAIL PROTECTED]> wrote:
>
> > > I had a similar problem while using adodb driver and odbc_mssql. While
> > > using mysql worked ok.
>
> > > What driver are you using?
>
> > > On Feb 6, 1:48 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > > I'm trying to go through the Example: Simple User Authentication in
> > > > the CakePHP manual, to learn how to set up my own authentication for a
> > > > website. The database that I have to use for authentication is a
> > > > legacy Access database, and I have connected to it successfully with
> > > > Cake already. For some reason, when I try to login, the query that
> > > > gets generated is a little screwy.
>
> > > > It generates: SELECT "User"."AccName" AS "User__AccName" AS
> > > > "User"__"AccName" AS "User__AccName", "User"."AccPass" AS
> > > > "User__AccPass" AS "User"__"AccPass" AS "User__AccPass",
> > > > "User"."FirstName" AS "User__FirstName" AS "User"__"FirstName" AS
> > > > "User__FirstName", "User"."Surname" AS "User__Surname" AS
> > > > "User"__"Surname" AS "User__Surname", "User"."ContactID" AS
> > > > "User__ContactID" FROM "registrar" AS "User" WHERE "User"."acc_name" =
> > > > 'dev' LIMIT 1
>
> > > > I don't understand why it's repeating the "AS" so many times, I
> > > > haven't seen that before in any of the generated queries.
>
> > > > My model is fairly simple:
> > > > class User extends AppModel
> > > > {
> > > > var $name = 'User';
> > > > var $useTable = 'registrar';
> > > > var $primaryKey = 'ContactID';
> > > > var $useDbConfig = 'orderflow';
> > > > var $hasMany = 'Order';
>
> > > > }
>
> > > > Is there something remarkably stupid that I'm doing that I'm just not
> > > > aware of?
>
> > > > Thanks,
> > > > Tracy
--~--~-~--~~~---~--~~
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: 1.2: Pagination and Manual Query?, Can this be done? If so , how?

2008-02-06 Thread patcoll

A search in this group helps:

http://groups.google.com/group/cake-php/browse_thread/thread/f990a45967935665/d45ee41f79f69031

http://groups.google.com/group/cake-php/browse_thread/thread/d0cb3f7745a2a898/88f108d4a60687f7

For more tough issues:

http://groups.google.com/group/cake-php/web/frequent-discussions

On Feb 6, 10:28 am, DragonI <[EMAIL PROTECTED]> wrote:
> I'm wondering if it's possible to use cake's pagination with a manual
> query ($this->query)?
>
> I understand that I have to determine the offset and I have to get the
> total records myself. But I'm stumped because paginate is expecting
> the model name.
>
> Thanks.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



bake generator

2008-02-06 Thread zeugme

Hi the list !

Do you know if the bake generator is able to deduce table relationship 
when it generate the model ?
If it is possible, I suppose it need a DB strict name convention ... any 
info, doc, tuto, examples,

Also, how to customize baked view, model, controller ? Any tips, 
example, recommendation ?
Where could I find documented all the "special variable" available ? 
(I'm guessing I'll need an array of the field in a view for example)

Thanks !

--~--~-~--~~~---~--~~
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: CakePHP creating strange SQL query

2008-02-06 Thread hellfish


Right now I'm going forward using mysql, but my company only provides
sql server so it's going to be interesting in a few days.

I wasn't able to find any fixes to that problem.


On Feb 6, 3:15 pm, TracyB <[EMAIL PROTECTED]> wrote:
> this is under the adodb driver for access. I have another model using
> an access database, and that one doesn't seem to be doing this. did
> you find a fix, or did you just switch to a different database?
>
> On Feb 6, 10:14 am, hellfish <[EMAIL PROTECTED]> wrote:
>
> > I had a similar problem while using adodb driver and odbc_mssql. While
> > using mysql worked ok.
>
> > What driver are you using?
>
> > On Feb 6, 1:48 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > I'm trying to go through the Example: Simple User Authentication in
> > > the CakePHP manual, to learn how to set up my own authentication for a
> > > website. The database that I have to use for authentication is a
> > > legacy Access database, and I have connected to it successfully with
> > > Cake already. For some reason, when I try to login, the query that
> > > gets generated is a little screwy.
>
> > > It generates: SELECT "User"."AccName" AS "User__AccName" AS
> > > "User"__"AccName" AS "User__AccName", "User"."AccPass" AS
> > > "User__AccPass" AS "User"__"AccPass" AS "User__AccPass",
> > > "User"."FirstName" AS "User__FirstName" AS "User"__"FirstName" AS
> > > "User__FirstName", "User"."Surname" AS "User__Surname" AS
> > > "User"__"Surname" AS "User__Surname", "User"."ContactID" AS
> > > "User__ContactID" FROM "registrar" AS "User" WHERE "User"."acc_name" =
> > > 'dev' LIMIT 1
>
> > > I don't understand why it's repeating the "AS" so many times, I
> > > haven't seen that before in any of the generated queries.
>
> > > My model is fairly simple:
> > > class User extends AppModel
> > > {
> > > var $name = 'User';
> > > var $useTable = 'registrar';
> > > var $primaryKey = 'ContactID';
> > > var $useDbConfig = 'orderflow';
> > > var $hasMany = 'Order';
>
> > > }
>
> > > Is there something remarkably stupid that I'm doing that I'm just not
> > > aware of?
>
> > > Thanks,
> > > Tracy
--~--~-~--~~~---~--~~
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: User Management\Login\Auth Framework

2008-02-06 Thread jakecake

> Jake , bakery is working i create an account recently, and i can write
> a post. Whats your problem?

My problem is that I never received the confirmation mail. If I try to
register again, I get a weird message in the form so that this
username is already registred (and I'm supposed to reset it). If I try
to reset the password, I get 'You should receive an email with further
instruction shortly' but not mail...

Someone on the IRC channel told me the bakery is a bit broken, and
that I have to wait (and see:)



--~--~-~--~~~---~--~~
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: why does the form error appear above and below the input field?

2008-02-06 Thread Siebren Bakker
@Rgarg - The $html->tagErrorMsg and $html->inputTag are all deprecated in
CakePHP 1.2, all forms are now done through the $form helper, not the $html
helper. Your code would work fine in a Cake 1.1xx app, but not in a Cake
1.2xx app anymore.

On Feb 6, 2008 1:19 AM, Rgarg <[EMAIL PROTECTED]> wrote:

>
> you can display error anywhere.
> i am using following code for display errors at top of the form.
>
> Add New Product
>
> tagErrorMsg('Product/code', $pcode_error) ?>
> tagErrorMsg('Product/product_name', 'Name
> required.') ?>
> tagErrorMsg('Product/price', 'Price  required in
> numeric.') ?>
>
>
>  method="post" enctype="multipart/form-data">
> 
> Code:
>inputTag('Product/code', array('size' =>
> '40')) ?>
>
> Name:
>inputTag('Product/product_name', array('size'
> => '40')) ?>
>
> Price:
>inputTag('Product/price', array('size' =>
> '40')) ?>
> submitTag('add') ?>
>
> 
> 
>
> On Feb 6, 10:13 am, "Amit Badkas" <[EMAIL PROTECTED]> wrote:
> > On Feb 6, 2008 8:51 AM, johnnyice <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > So as most of you know the HtmlHelper::tagErrorMsg method has been
> > > deprecated and the new method to use is FormHelper::error.
> >
> > > I want the error message to appear ABOVE the input field, but it
> > > appears below by default.  I then put in the extra form->error() call
> > > and now I get the message above AND below the field.
> >
> > > How can I force the error message to appear ABOVE the input field?
> > > Anything to do with the before, after options you send as arguments to
> > > input()??
> >
> > - Yes. You have to set 'error' => false in input() method's second
> argument
> > array
> >
> > Code is below...
> >
> >
> >
> > > 
> > > View
> > > 
> > > echo $form->error('username');
> > > echo $form->input('username', array('size' => '15', 'label' =>
> > > 'Username'));
> >
> > - Above should be changed to $form->input('username), array('size' =>
> 15,
> > 'label' => 'Username', 'error' => false));
> >
> > --
> > Regards,
> > Amit
> >
> >
> http://amitrb.wordpress.com/http://coppermine-gallery.net/http://cheesecake-photoblog.org/http://www.sanisoft.com/blog/author/amitbadkas
> >
>


-- 
In the name of Life, Liberty, and the pursuit of my sanity.
Siebren Bakker(Aevum Decessus)
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s+: a19 C UL++ P L++
!E W++ N(-) o? K? w(+) O? M-- V?
PS+ PE Y- PGP- t+ 5? X- R tv--
b++ Di D+ G+ e h! r y-
--END GEEK CODE BLOCK--

--~--~-~--~~~---~--~~
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: Having problems with javascript.

2008-02-06 Thread Ithaka

Found another way to fix it.

There is a controller called pages.ctb, in this file i added
javascript as a helper.

Then i did $javascript->link(); and it worked.  And im guessing to
make sure that js still works, when i enter in other pages that i
should start javascript aswell.

I leave this final comment for people that are having a hard time
starting with cake, hopefully this helps people.

On Feb 6, 9:31 am, Ithaka <[EMAIL PROTECTED]> wrote:
> Fixed it!
>
> I just added it as normal html coding and it worked, i must have
> something wrong in cakephp codes somewhere, i will investigate
> further, but thanks everyone!
>
> On Feb 6, 9:19 am, Ithaka <[EMAIL PROTECTED]> wrote:
>
>
>
> > It still isn't working.
>
> > I put the javascript into app/webroot/js/
> > I put the javascript in project directory/webroot/js
> > I put the images in app/webroot/img
> > I put the images in project directory/webroot/img
>
> > And on the layout i have the html that finds the images but the
> > javascript doesn't seem to.
>
> > P.s. i made a typo with the  tags on my last post, it was
> > actually src.
>
> > On Feb 5, 5:25 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > > It should be pointing to /js/images.js , mod_rewrite will take care of
> > > the rest. Put your javascript in app/webroot/js/ .
>
> > > And
>
> > >