Re: HABTM - SQL Error 1062 w/ 1.2 RC3

2008-10-03 Thread Keith
Nevermind...lol too late to be coding... For some reason the user_id column in the departments_users table had been set as a primary key. I'm not exactly sure why, but who knows maybe I totally bailed and set a primary key flag somewhere along the line. Everything is working though. On 4 Oct, 0

HABTM - SQL Error 1062 w/ 1.2 RC3

2008-10-03 Thread Keith
I have a situation where I have a user model & a department model. MODEL - User.php var $hasAndBelongsToMany = array( 'Department' => array('className' => 'Department', 'joinTable' => 'departments_users',

Re: Effect.Fade and Effect.Appear

2008-10-03 Thread Arak Tai'Roth
I did read those, and realize that Effect.Appear only works on a style declared within the div tag, I have done that. However beyond that I don't see anything on those pages that relate to this problem. Unless Effect.Fade doesn't work on styles that are set in that matter. I figured it was a Java

[ANN][OT] News about the CakePHP Portuguese Google Groups

2008-10-03 Thread Gustavo Carreno
Hey guys, I feel I still need to apologise for my utter stupidity on losing my other Google Mail account. Not only because I was stupid but, now, my stupidity has harmed the Portuguese CakePHP community. In the past hours I was alerted that the cake-php-pt GG was deleted. I immediately began to

Another HABTM issue : row with same Id getting over-written

2008-10-03 Thread Brenton B
Ok, so here's the scenario ... A user can have multiple webpages in their account, and when they set them up, they must choose the type (ex: blog, gallery, etc). So User HABTM webpage_type ... where users_webpage_types has additional fields for URL, title, etc. The thing I'm running into is upon

sorting a model based on child count ?? (full email)

2008-10-03 Thread Matthew Camuto
Apologies in advance. GMAIL auto-sent my last emal before finishing! hi there thsi group is great firstly and i have been doing pretty well with cake. however i was trying something that is either absurdly simple or not possible. i want to get my model out (via db) but i want to sort it bas

sorting a model based on child count?!?

2008-10-03 Thread Matthew Camuto
hi there thsi group is great firstly and i have been doing pretty well with cake. however i was trying something that is either absurdly simple or not possible. i want to get my model out (via db) but i want to sort it based on the count of a set of children (has many). The simplist example is Ar

Re: Another HABTM issue : row with same Id getting over-written

2008-10-03 Thread Brenton B
Well, assuming the Docs are correct (and I understand it properly), that should only apply to updates ("If true (default value) cake will first delete existing relationship records in the foreign keys table before inserting new ones, when updating a record. So existing associations need to be pass

Re: URL routing

2008-10-03 Thread Mathew Nik Foscarini
Hi, There are two way to handle this. Add these lines above your other users routing rules. If you put it below your other rules, then the router will think "login" is a username. This is not an advisable approach since you can no longer have users with the names "login" or "logout", and ever

Re: Another HABTM issue : row with same Id getting over-written

2008-10-03 Thread teknoid
Goes to show I should read more carefully :) I guess the title of the post made me jump the gun... You say "an user has 2 of the same webpage_type" Does it mean that in your join table you have something like: ? user_id | web_page_type_id - 7 |

Re: CakePHP does not work with mod_rewrite and php-cgi

2008-10-03 Thread powtac
Exact error message? What is not found? On 3 Okt., 23:05, dtrax84 <[EMAIL PROTECTED]> wrote: > Hi, > Tried running cakephp on my server with php-cgi with mod_rewrite > enabled and got the error 404 message. Any ideas? --~--~-~--~~~---~--~~ You received this message

How to use the shell output in controller?

2008-10-03 Thread powtac
Silly question I know, but is there a other way beside "exec()" and "ob_start()" to call the functionality of a cake shell from inside a controller? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To

Re: Another HABTM issue : row with same Id getting over-written

2008-10-03 Thread teknoid
Do you know what 'unique'=>true does? Btw, there really isn't any need to define default values for your associations if you follow the conventions. On Oct 3, 6:10 pm, Brenton B <[EMAIL PROTECTED]> wrote: > Ok, so here's the scenario ... > > A user can have multiple webpages in their account, and

CakePHP does not work with mod_rewrite and php-cgi

2008-10-03 Thread dtrax84
Hi, Tried running cakephp on my server with php-cgi with mod_rewrite enabled and got the error 404 message. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send emai

Mod_Rewrite and PHP-CGI

2008-10-03 Thread dtrax84
Hi, I am having problems running cakephp on my server (Server API: CGI) using mod_rewrite. Does anyone has the same issue? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send

Layout switching breaks $scripts_for_layout

2008-10-03 Thread matt
Hi, I am getting a weird issue when i change the default layout being displayed. Normally the following code works as expected ($scrips_for_layout is populated): (app/views/layout/default.ctp) meta('icon'); $html->css('cake.generic', null, array(), false); echo $scripts_for_layout; ?> Excep

Re: URL routing

2008-10-03 Thread [EMAIL PROTECTED]
Great, that helped a lot. A follow up issue I am having is what is the correct way to handle such things as login / logout functions in the user controller so that when I go to http://example.com/users/logout, it doesn't query the database and it performs the logout functions. Thanks again for y

Re: URL routing

2008-10-03 Thread [EMAIL PROTECTED]
Great, that helped a lot. A follow up issue I am having is what is the correct way to handle such things as login / logout functions in the user controller so that when I go to http://example.com/users/logout, it doesn't query the database and it performs the logout functions. Thanks again for y

Re: Multiple Display Field

2008-10-03 Thread Keith
I don't understand why this issue still lingers on and on in cakePHP. Why not just have the following syntax: (If you only have 1 field) var $displayField = 'last_name'; (If you have multiple fields) var $displayField = array( 'fields' = array( 'last_name', 'first_name'

Re: Notice (8): Undefined index: abc [APP\views\......\index.ctp

2008-10-03 Thread qwanta
If it's a one to many relationship (author has many books, each book has one author): In Book Model you stick this: var $belongsTo = array ('Author'); In Author Model: var $hasMany = array ('Book'); http://book.cakephp.org/view/78/Associations-Linking-Models-Together I'd recommend going throug

Re: Notice (8): Undefined index: abc [APP\views\......\index.ctp

2008-10-03 Thread qwanta
Note also you have to have your tables defined according to the CakePHP syntax. Each one should have an "id" key column. Then the Book table should have an author_id field to link the author. On Oct 3, 2:54 pm, qwanta <[EMAIL PROTECTED]> wrote: > If it's a one to many relationship (author has man

Re: Notice (8): Undefined index: abc [APP\views\......\index.ctp

2008-10-03 Thread Abdus Salaam
thanx for ur time. - ya u r rite that htmlhelper is easy way to genrate tables cell and headers.. but i m trying to learn some code myself.. :p - i m trying to made relationship b/w books and authors tables...i think its relation is not make properly. -how to make foreign key?..i think thats the pr

Re: Notice (8): Undefined index: abc [APP\views\......\index.ctp

2008-10-03 Thread qwanta
What you probably want to do is take a look at what you have in the $books array at the end of your controller. A quick and dirty way is to put a var_dump($books); as last statement in your controller function. The contents will then show up at the top of your view. Check if the ['Author']['name']

Re: Auth component and ajax forms

2008-10-03 Thread CG
Did you check this var at the auth component? /** * The name of an optional view element to render when an Ajax request is made * with an invalid or expired session * * @var string * @access public */ var $ajaxLogin = null; Never tried it, but i guess is something meant to do what

Re: Add user_id from session to db when adding a product

2008-10-03 Thread Mathew
>  if(isset($this->data['Product']['user_id'] = $user_id)) { >  if(isset($this->data['Product']['user_id'] = $this->Auth->user('id');) { if(($this->Auth->user('id') != null) && isset($this->data['Product'] ['user_id'])) { $this->data['Product']['user_id'] = $this->Auth->user('id'); } --~--~-

Re: Release: CakePHP RC3 - The RC of Triumph!

2008-10-03 Thread Mathew
Thanks so much for all the hard work guys! Special thanks to Mark Story, because bugs I reported were fixed the next day by him. He's so fast! Thanks for all the hard work Mark! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

Re: How to recode MySQL Boolean field to yes/no in a view

2008-10-03 Thread mikeg
if you are using scaffolding, try change column setting to TINYINT(1), then in scaffolding you will have Yes / No :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email

Re: Changelog notes for 1.1.20 missing?

2008-10-03 Thread Daniel Hofstetter
Hi, > Is there changelog notes for 1.1.20? > like:https://trac.cakephp.org/wiki/changelog/1.1.x.x I'm not aware of a changelog for 1.1, but as there were only a handful of changes the following view might help: https://trac.cakephp.org/log/branches/1.1.x.x -- Daniel Hofstetter http://cakebaker

AD7six: Multijoin relation

2008-10-03 Thread [EMAIL PROTECTED]
The association should be picture->gallery->location when i perform a search picture->find() then i need as result to route the image data[Location] data[Gallery] data[Picture] in sql i would write: FROM dp_pictures LEFT JOIN galleries ON gallery_id = galleries.id LEFT JOIN locations ON

Re: Add user_id from session to db when adding a product

2008-10-03 Thread Gabriel Kolbe
Hi I would prefer to get the value from the session. When I do if(isset($this->data['Product']['user_id'] = $user_id)) { if(isset($this->data['Product']['user_id'] = $this->Auth->user('id');) { I get this error Parse error: syntax error, unexpected '=', expecting ',' or ')' in C:\xampp\htdocs\

Re: Simple Question

2008-10-03 Thread ORCC
When you post a form, the selected value of a select list is in the data array as any other form field. > Hello all, how do I get the selected value from a select drop down > box. Basically I want to redirect based on the returned value however > I can not figure out how to get the selected va

Re: Promlems with Fixtures using $import in RC3

2008-10-03 Thread mark_story
There were a number of problems with fixture importing in RC2, which were corrected. Perhaps one of these corrections broke your tests?. For examples on fixture use check the fixture test. You can also try specifying which connection you want to use so connection => default -Mark On Oct 3, 5:07

Re: Does calling model methods from elements break MVC pattern?

2008-10-03 Thread ORCC
> > ..the comment "PERFORM BUSINESS LOGIC" should immediately > let you think that something is not 100% MVC ..you are > performing LOGIC inside a MODEL, and not just model data > handling. So, where I have to do the business logic? For example, I have a Product Object, and the product has some

Re: Help setting custom validation counting rule

2008-10-03 Thread Mathew
$count = $this->find('count',array('conditions'=> $data,'recursive'=>-1)); should be $count = $this->find('count',array('conditions'=>array('state'=> $data),'recursive'=>-1)); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Add user_id from session to db when adding a product

2008-10-03 Thread Mathew
Assuming you want the currently logged in administrator. $this->data['Product']['user_id'] = $this->Auth->user('id'); Otherwise, you'll need a belongsTo association in your Product model, and allow scaffolding to show a user drop down list. --~--~-~--~~~---~--~~

Re: 2 column layout for $form->input() ?

2008-10-03 Thread SiggiSmara
Maybe this is a little late but perhaps it will save some other soul some trial and error. I'm using 1.2 branch so this may not work for 1.1. To change the default class name for the div that surrounds the input when using form helper use the options array like so: echo $form- >input('tst_input',a

Re: Add user_id from session to db when adding a product

2008-10-03 Thread ORCC
Just assign the values to the data array $this->data['Product']['user_id'] = $user_id Or put user_id as a hidden field in the form. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this gr

Add user_id from session to db when adding a product

2008-10-03 Thread gabriel
Hi, I am busy reworking a bakesale script based on cake, my OOP php is not that good. Maybe someone can point me here in the right direction. I want to change a script the add a product and in sert in the db the user_id in the product table - which should come from the User.id function admin_add(

Re: Please help to create new multilanguage site in cake php

2008-10-03 Thread Donkeybob
What errors are you getting? What is the problems that you are seeing? On Oct 3, 6:30 am, uddi <[EMAIL PROTECTED]> wrote: > I have read the multilanguage support in cakePHP article (http:// > bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent- > internationalization-tutorial). But

Re: Help setting custom validation counting rule

2008-10-03 Thread 3lancer.eu
Hi again, And what is the problem here, what query is generated? Regards, Piotr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsu

Random Image Relation

2008-10-03 Thread Markus Muschol
I want a random picture for each gallery Is it possible to realise with a relation like this ? Class Gallery extends AppModel { var $hasOne= array( 'RandomImage' => array('className' => 'Picture',

Re: How do i upload images using cakephp

2008-10-03 Thread Gabriel Kolbe
Hi I don't know how too but.. you can steal some ideas how to handles images at http://www.bakesalehq.com/ since it is a ecommerce site/template that uses images On Fri, Oct 3, 2008 at 12:43 PM, AceStudio <[EMAIL PROTECTED]> wrote: > > I am developing a social community and would like members pro

Re: Release: CakePHP RC3 - The RC of Triumph!

2008-10-03 Thread tracyfloyd
Fantastic! You guys rule! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED]

Re: Simple Question

2008-10-03 Thread grigri
View: $options = array( '/things/view/%id' => 'View this thing', '/things/index' => 'Go back to the index' ); echo $form->input('WhatToDo.next', array('options' => $options, 'label' => 'What do you want to do next?')); Controller: // ... if ($this->Thing->save($this->data)) { $this->Sessi

Re: Foreign Keys definition in Schemas

2008-10-03 Thread mark_story
Yes you can define additional indexes in the indexes key. However, you will not be able to force innodb foreign key with references, as this feature is not supported in all databases it was not implemented in the schema system. On Oct 2, 8:00 pm, luissquall <[EMAIL PROTECTED]> wrote: > I cannot

Re: concern regarding pagination

2008-10-03 Thread 3lancer.eu
Hi, > can anyone help me with this problem??? Yes. Two ideas. 1st, worse - use redirections, so in case your url is /searches/index? search=linkin redirect it to /searches/index/linkin/. Redirections always give us some overhead, also this way the search results won't be seo. 2nd, better - you

Simple Question

2008-10-03 Thread MDB
Hello all, how do I get the selected value from a select drop down box. Basically I want to redirect based on the returned value however I can not figure out how to get the selected value? --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: Passing arguments to "add" action

2008-10-03 Thread maciek
$this->passedArgs['patientId'] or $this->passedArgs('patientId) On Oct 2, 11:54 am, "jitka (poLK)" <[EMAIL PROTECTED]> wrote: > debug($this->passedArgs); > > My point is - I do not think it is necessary to use named argument for > your need. --~--~-~--~~~---~--~~

problem in cakephp

2008-10-03 Thread Mits
when i click on any link and immediately i click on other the cakephp application redirects the application on login page. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send

Please help to create new multilanguage site in cake php

2008-10-03 Thread uddi
I have read the multilanguage support in cakePHP article (http:// bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent- internationalization-tutorial). But i am not able to run this example. Please help if anyone have any other reference Url or guidence material from where i can ge

How do i upload images using cakephp

2008-10-03 Thread AceStudio
I am developing a social community and would like members profile to show their pictures or avatar. Cake documentation doesn't deal with this at all. Please i'd appreciate if someone treated this --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Does calling model methods from elements break MVC pattern?

2008-10-03 Thread Kappa
hi everybody, I'm not a MVC guru,but in my opinion, the fact that a view can import something and invoke actions not performed by a controller, but from a model, breaks somehow the MVC pattern. Maybe if you need some action to manipulate data of a model before display them, you should use the afte

Notice (8): Undefined index: abc [APP\views\......\index.ctp

2008-10-03 Thread S/*\L/*\L/*\M
hi all, i m very new in cakePHP, pls help me some one about this error, which is headeach for me. => i m getting error of [Undefined index] in abc view file.i m pasting code here if some 1 got it then pls help me. thanx =>this controller file code for index... function index() { $this->Book->rec

Re: Does calling model methods from elements break MVC pattern?

2008-10-03 Thread Kappa
hi everybody, I'm not a MVC guru,but in my opinion, the fact that a view can import something and invoke actions not performed by a controller, but from a model, breaks somehow the MVC pattern. Maybe if you need some action to manipulate data of a model before display them, you should use the afte

Re: Is there a way to get a slice of many tables?

2008-10-03 Thread Mingan
Or you can specify only the fields you're interested in via 'fields' array. in Model::find() On 3 Říj, 00:22, Steveston <[EMAIL PROTECTED]> wrote: > For example: a typical university project, I have users, user_courses > (for instructors), user_enrolls (for students), courses, events (each > cour

concern regarding pagination

2008-10-03 Thread harry
hello fiends, i have a problem using pagination pls help me out. the link shown on the url is different from that of the links shown on the page nos. what i mean to say is the links that i'm gettin whin i point the mouse on the page is /searches/index/linkin/page:2 but when i search foe an entit

Re: URL routing

2008-10-03 Thread Mathew
Router::connect('/users/:username', array('controller'=>'users','action'=>'index'),array('pass'=>array('username'))); This routes /users/bobcostas to the function index( $username ) method of the controller, with the username passed as a parameter. Router::connect('/users/:username/:action', arr

Re: Documentation - Cakes bad side

2008-10-03 Thread ORCC
The only complain that I found in the API documentation, is that there are not clear explanations about the parameters that a method expects (usually as an array) or class attributes are not explained too. Altought there is the source code; in many cases the source code itself is the best document

Re: Release: CakePHP RC3 - The RC of Triumph!

2008-10-03 Thread Rajat Agarwal
Congratulation!! Core Team On Fri, Oct 3, 2008 at 6:15 PM, tracyfloyd <[EMAIL PROTECTED]> wrote: > > Fantastic! You guys rule! > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this

Re: hello cake lovers

2008-10-03 Thread Novice Programmer
I am also getting the same problem. I want to paginate the search results in a fashion that the search url can be bookmarked. but i am not able to do so. The problem being that when the query is a get string, the submission to the searches controller looks like http://x.com/searches/index?q=mystri

Changelog notes for 1.1.20 missing?

2008-10-03 Thread majna
Is there changelog notes for 1.1.20? like: https://trac.cakephp.org/wiki/changelog/1.1.x.x --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.c

Re: Routing Images

2008-10-03 Thread majna
You don't need routing (Router) becouse webroot's files like images are accessed by web server directly, not through cake. you can create url to images in your views: For dataset: 1172271600 mylocation mygallery 0001 $img_url = 'event/'.date(Y_m_d).'mylocation_mygallery_0001.jpg'; echo $html->ima

Re: Documentation - Cakes bad side

2008-10-03 Thread cronet
I think the book is on the right way. Think a half year back! Nearly nothing was documented. Now, evertime I search a feature I look at the proper sections of the book. If you need help about Formhelper, look at the Built-In Helpers chapter. It is structured very well, and you find many things wi

Re: Index / Url Error?

2008-10-03 Thread MDB
I am new to this, I just took over this site which was written in cakephp and I have never seen or used it before. On Oct 2, 8:54 pm, "3lancer.eu" <[EMAIL PROTECTED]> wrote: > Hi, > > Well, I don't know why do you expect that to work. Please read the > chapter on routes:http://book.cakephp.org/vi

Routing Images

2008-10-03 Thread [EMAIL PROTECTED]
Hey CakeGroup, I want to route my Images in a specific schema. Can i use the Route::connect function for this ? And where should i put the logic for this? In the Controller, Model oder View? The schema: /img/events/:date(Y_m_d)/:location_:gallery_:number_thumb.jpg For example the dataset is thi

Re: Update problem in AclBehavior

2008-10-03 Thread lightglitch
Thx, for the info. On Oct 2, 7:30 pm, mark_story <[EMAIL PROTECTED]> wrote: > I don' think this is going to be changed before 1.2 is released but it > is pretty easy to do in your models. > > http://mark-story.com/Posts/view/auth-and-acl-automatically-updating-... > > tutorial for doing it with u

Promlems with Fixtures using $import in RC3

2008-10-03 Thread cdamian
I am having problems with fixtures which use $import = "SomeModel". I am getting the usual "Database table some_models for model SomeModel was not found." Sometimes it helps to change it to $import = array('table' => 'some_models'); but this doesn't solve it all the time. Especially if there are

Re: Effect.Fade and Effect.Appear

2008-10-03 Thread Dinko
This is rather a Javascript problem, not Cake. Have a look at http://github.com/madrobby/scriptaculous/wikis/effect-appear http://github.com/madrobby/scriptaculous/wikis/effect-fade which should help you. --~--~-~--~~~---~--~~ You received this message because y

Re: Any freelance jobs?

2008-10-03 Thread evert0n
thank you brendon On Oct 1, 1:54 am, BrendonKoz <[EMAIL PROTECTED]> wrote: > http://cakephp.org/jobshttp://withcake.com/ > > On Sep 28, 4:33 am, evert0n <[EMAIL PROTECTED]> wrote: > > > Hi, guys anyone need a hand for cakephp projects? > > > I'm avaliable for any opportunities asfreelance. --~--~

Re: How to recode MySQL Boolean field to yes/no in a view

2008-10-03 Thread David C. Zentgraf
Over-engineer much? ;-) echo $model['boolField'] ? 'Yes' : 'No'; On 3 Oct 2008, at 17:08, Kanten wrote: > > Hi, > > I have a MySQL table with lots of boolean fields (BOOL) and when > viewing these in my view I would like to output "Yes" or "No" instead > of "1" or "0". > > I have experimented a

hello cake lovers

2008-10-03 Thread harry
till now what i've made is a searches controller. this controller is ment to search either a user or an entity in the database. the first line of my index action is function index($searchby = 'entity') this funct works fine if i have to search for an entity, but when i search for a user it shows m

How to recode MySQL Boolean field to yes/no in a view

2008-10-03 Thread Kanten
Hi, I have a MySQL table with lots of boolean fields (BOOL) and when viewing these in my view I would like to output "Yes" or "No" instead of "1" or "0". I have experimented a bit with doing stuff like this in my controller: foreach (array_keys($data['BrugadaProfile']) as $key):