[symfony-users] Re: camel case error in class generation by propel. BUG?

2010-05-24 Thread Tom Ptacnik
If you use schema.yml it will be just like you write it... sfDtPage: actAs: Timestampable: columns: . Page: actAs: Timestampable: columns: . First will create class sfDtPage, the second Page. On 23 kvě, 18:36, Tofuwst will create a class sfDtPage, second Page.ar

Re: [symfony-users] How to check if a variable saved in sfContext is set or not?

2010-05-24 Thread Javier Garcia
Using sfContext::getInstance()->set('form_signin', $this->form); On 05/25/2010 08:08 AM, Gareth McCumskey wrote: How did you set the variable? Was it as a session variable in an action by using $this->getUser()->setAttribute()? Or as a value stored in a config file like the app.yml? On Tuesday

Re: [symfony-users] How to check if a variable saved in sfContext is set or not?

2010-05-24 Thread Gareth McCumskey
How did you set the variable? Was it as a session variable in an action by using $this->getUser()->setAttribute()? Or as a value stored in a config file like the app.yml? On Tuesday 25 May 2010 07:03:30 Javier Garcia wrote: > Hi, > > i have this code: > > if(sfContext::getInstance()->get('form

[symfony-users] How to check if a variable saved in sfContext is set or not?

2010-05-24 Thread Javier Garcia
Hi, i have this code: if(sfContext::getInstance()->get('form_signin')){ //... } but im getting this error: The "form_signin" object does not exist in the current context. Any right way to check if a variable saved in sfContext is set or not ? -- Javi Ubuntu 8.04 - Symfony 1.3 -

[symfony-users] Re: Fixtures with dynamic parameters ?

2010-05-24 Thread Adrien Mogenet
I agree, but in my specific case, I would like other users (and not developpers) to be able to add/edit this content easily. Yaml fixtures files would have be a nice choice ;-) But if it's not possible, I'm gonna look for another way ! -- Adrien On May 24, 4:45 pm, Pietrino Atzeni wrote: > Hi,

Re: [symfony-users] Re: edit id in admin

2010-05-24 Thread Eno
On Mon, 24 May 2010, Oleg Sverdlov wrote: > > primary key has unique value. The database server is supposed to raise an > error when someone tries to enter duplicate value. It's up to software to > process this type of errors. So, after you have thousands of rows in the table, will you users keep

Re: [symfony-users] Preventing users from seeing others information

2010-05-24 Thread Eno
On Mon, 24 May 2010, Samuel Morhaim wrote: > mysite.com/account/profile/5 > > What prevents me from switching the /5 for a /4 /3 .. etc.. to call the > profile for other Id's? How do you prevent this from happening? You should never use real database IDs, use slugs: http://www.symfony-project

[symfony-users] created_at in FormFilter

2010-05-24 Thread Germana Oliveira
Hi!! i have a table on MySQL with a created_at field : ... created_at     | datetime ... In my symfony project i just begin working with Filters (FormFilter). I have this: [CODE]    $this->setWidgets(array(        'created_at'  => new sfWidgetFormFilterDate(array(            'from_date'  => new

[symfony-users] Blast from the past

2010-05-24 Thread Dennis Gearon
I was cleaning out some old papers, from some earlier development projects. I found this: http://www.facebook.com/album.php?aid=62549&id=1355017447&saved#!/photo.php?pid=1276055&id=1355017447 It's from 2004, and it kind of looks like Symfony and all the other MVCs. ;-) Back then, I desperatel

[symfony-users] Propel Behavior: Adding static methods

2010-05-24 Thread rekarnar
Hi guys, I'm trying to write some methods into my peer class's using a propel behavior (http://www.propelorm.org/wiki/Documentation/1.5/ Behaviors#WritingaBehavior) But I seem to be having no luck, is there a plugin or any examples around that you could point me towards? Thanks! -- If you wan

Re: [symfony-users] Preventing users from seeing others information

2010-05-24 Thread Philipp Mohrenweiser
I would try having a check in the action like $profile = $this->getRoute()->getObject(); $this->getUser() == $profile->getUser(); other ideas ? cheers phil 2010/5/25 Samuel Morhaim : > If I have something such as > > mysite.com/account/profile/5 > > What prevents me from switching the /5 for a

[symfony-users] Re: Question about sfDoctrineGuardPlugin and signing

2010-05-24 Thread pghoratiu
I think you have to replace the security filter (apps/frontend/config/ factories.yml) with your own filter. Just copy the one from symfony/lib/filter/ sfBasicSecurityFilter.class.php and make the necessary changes to do redirects instead of internal forward operation. gabriel On May 24, 4:39 

[symfony-users] Re: strip_tags validator

2010-05-24 Thread pghoratiu
You could do it either at object->save() or better at object->set*() something like: public function setDescription($value) { parent::setDescription(strip_tags($value)); } gabriel On May 24, 11:56 pm, Tom Haskins-Vaughan wrote: > Hi all, > > I need to call strip_tags() on a form field b

[symfony-users] Preventing users from seeing others information

2010-05-24 Thread Samuel Morhaim
If I have something such as mysite.com/account/profile/5 What prevents me from switching the /5 for a /4 /3 .. etc.. to call the profile for other Id's? How do you prevent this from happening? thanks. -- If you want to report a vulnerability issue on symfony, please send it to security at

[symfony-users] sfForkedDoctrineApplyPlugin with sfFacebookConnectPlugin

2010-05-24 Thread Sela
i noticed both of those plugins use sf_guard_user_profile table with different columns. how can i use it then? i got already the database configured for sfForkedDoctrineApplyPlugin and want to install sfFacebookConnectPlugin. -- If you want to report a vulnerability issue on symfony, please send

[symfony-users] strip_tags validator

2010-05-24 Thread Tom Haskins-Vaughan
Hi all, I need to call strip_tags() on a form field before I put it in my database, only allowing and tags. I've done this by creating a custom validator (see below). It works fine, but is there a better way to do this? Thanks, Tom protected function doClean($value) { return strip_tags($val

[symfony-users] Re: Help with doctrine SQL

2010-05-24 Thread grahamj42
Simone, As soon as one uses a function in the SELECT clause, the result is no longer an object made persistent in the database, it's a new class (a subclass (not yet defined) of DoctrineObject). Because you are using SUM, there is no unique key for the result (except in the situation where only o

Re: [symfony-users] Re: Dumping and loading passwords (re-hashing)

2010-05-24 Thread ashton honnecke
Beautiful! Thank you! On Mon, May 24, 2010 at 1:25 AM, Tom Ptacnik wrote: > "I can't check in the changes" means, that you can't update the plugin > via svn? > > I fso, than you can do your changes in the model/doctrine/ > sfDoctrineGuardPlugin sfGuardUser.class.php don't you? .. then this > pro

Re: [symfony-users] Re: edit id in admin

2010-05-24 Thread Oleg Sverdlov
On Mon, May 24, 2010 at 7:30 PM, Richtermeister wrote: > > the tag to product argument makes no sense to me... What are you > attaching tags to if not the product's ID's? > to product IDs which are not auto-generated but indeed user-generated codes entered from a catalog. > In your version, yo

[symfony-users] Question about a piece of code in sfDoctrineGuardPlugin

2010-05-24 Thread Javier Garcia
Hi, there is this code below in sfDoctrineGuardPlugin. $a = sfConfig::get('app_sf_guard_plugin_success_signin_url'); var_dump($a); $signinUrl = sfConfig::get('app_sf_guard_plugin_success_signin_url', $user->getReferer($request->getReferer())); var_dump($signinUrl); var_dump($user->getRefe

[symfony-users] Re: edit id in admin

2010-05-24 Thread Richtermeister
Hey Oleg, the tag to product argument makes no sense to me... What are you attaching tags to if not the product's ID's? In your version, you want to edit product ids.. so what happens to the references in the product_to_tags table? You have to update them accordingly? If you just went with autoin

[symfony-users] Re: Help with doctrine SQL

2010-05-24 Thread Simone Fumagalli
On May 24, 6:20 pm, Philipp Mohrenweiser wrote: > Not a collection ? so you should probably use a limit 1 statement ... > but if you  want to get back multiple entrys the collection should be > the right thing !? As you can see I've SUM in my select so I want an object with the sum of the found

Re: [symfony-users] Help with doctrine SQL

2010-05-24 Thread Philipp Mohrenweiser
Not a collection ? so you should probably use a limit 1 statement ... but if you want to get back multiple entrys the collection should be the right thing !? 2010/5/24 Simone Fumagalli : > Hello. I'm trying to write this SQL statement in DQL ! > > The SQL looks like : > > SELECT SUM(col1), SUM(

[symfony-users] Help with doctrine SQL

2010-05-24 Thread Simone Fumagalli
Hello. I'm trying to write this SQL statement in DQL ! The SQL looks like : SELECT SUM(col1), SUM(col2), SUM(col3) FROM slave_table WHERE master_id = ? AND ( (year = ? and month < ? and priority = ?) OR (year = ? and month > ? and priority = ?) ) I also would to get back a SlaveTable object and

Re: [symfony-users] Pagination non-database list

2010-05-24 Thread Sergio Fabian Vier
On Sat, May 22, 2010 at 6:52 PM, Ricign wrote: > Hi, > What is the best way to do pagination for list of object. > The objects are't come from database. > try sfDataSourcePlugin [0], isn't released but trunk is good ;) [0] http://www.symfony-project.org/plugins/sfDataSourcePlugin > Thanks, > >

[symfony-users] Re: problem rendering embedded form when in edit

2010-05-24 Thread Tofuwarrior
Hi, UPDATE The same problem happens with edit/update not just new/create. Both objects save but FK becomes 1 whatever it was before. P Anyone? On May 24, 1:47 pm, Tofuwarrior wrote: > Hi Tom, > > Thanks for replying.   My problem has moved on. > > I can render the forms fine now but when

Re: [symfony-users] Fixtures with dynamic parameters ?

2010-05-24 Thread Pietrino Atzeni
Hi, I don't think it's easy, but... why would you do that? I think it's best to create a specific task to accomplish this, since data-load reloads everything in the db and it's really slow when it comes to load a lot of data. Hope this helps, Pietro Hi all, I would like to store a set of i

Re: [symfony-users] Re: edit id in admin

2010-05-24 Thread Oleg Sverdlov
On Mon, May 24, 2010 at 3:57 PM, Eno wrote: > > I do not agree. It may be simply of indicator of people relying too much > on > > belowed MySQL AUTO_INCREMENT feature. > > Beloved? AUTO_INCREMENT was designed to be used this way. If humans > assigned IDs, how do you guarantee uniqueness when ther

[symfony-users] Dynamic Forms

2010-05-24 Thread Asier
Hi there, I started with a form, which is made by hand because of it's complexity (it's a javascript modified form, with sortable parts, etc). The problem is that now I need to do the validation, and it's a total mess to do it from scratch in the action using the sfValidator* classes. So, I am th

[symfony-users] Mime_type validation issue while video upload

2010-05-24 Thread kumar arun
Hi, I am desgining and developing an e-Learning system for which i am using symfony 1.4 with doctrine ORM. I am using doctrine form to upload video with mime_type validation as $this->validatorSchema['file']->setOption('mime_types', array('video/ mpeg','video/mpg','video/mp4','video/flv')); $thi

[symfony-users] Question about sfDoctrineGuardPlugin and signing

2010-05-24 Thread Javier Garcia
Hi, by default, using sfDGP, when i try to execute an action of an application with security activated, the signin form appears but the URL doesn't change to "frontend_dev.php/login". So, what should i do to get changing the URL to "frontend_dev.php/login" ? -- Javi Ubuntu 8.04 - Symfony 1

Re: [symfony-users] Re: edit id in admin

2010-05-24 Thread Eno
On Mon, 24 May 2010, Oleg Sverdlov wrote: > I do not expect problems with partial restore/merge, since the tag name is > always operator-assigned and unique. In my experience, numeric ID often is a > problem when doing partial restore. That's why they need to be assigned by the database and manag

[symfony-users] Re: problem rendering embedded form when in edit

2010-05-24 Thread Tofuwarrior
Hi Tom, Thanks for replying. My problem has moved on. I can render the forms fine now but when I save in new mode the system saves the parent(storyteller) and the child (contact_details) objects but doesn't put the right FK reference in the parent so all of the parent objects I save have a chil

[symfony-users] Re: Choice between database table, enum type and array in php class ?

2010-05-24 Thread Gilles Bernard
Thanks Olivier for your answer. When you say that the different values can be stored in a config file, which file do you think of ? I know I can use app.yml to store some constants, but I don't see how I can save an array of values. And other question : you suggest to use maybe a database table to

[symfony-users] Fixtures with dynamic parameters ?

2010-05-24 Thread Adrien Mogenet
Hi all, I would like to store a set of items into a YML fixture file, a list of "Group" to apply for each new "User" that will be created. And thus I would like to write something like this : Group_1: label: My first group user: Group2: label: My second group user: And I w

Re: [symfony-users] Re: Ajax component depending on request uri

2010-05-24 Thread Philipp Mohrenweiser
Of course :D so atm i changed the standard action behaviour of the renderer used in sympal to fetch only the partial if theres a xmlhttprequest ... dunno if its too nice afterwards i process the parts i need with jquery .. is there another comfortable way? cheers phil 2010/5/24 Tom Ptacnik : >

Re: [symfony-users] Trying to retrieve a variable saved using sfContext::getInstance()

2010-05-24 Thread Gábor Fási
Calling redirect() means browser redirection, meaning a new context. Save the variable in the session, using $this->getUser()->setAttribute(), or use forward(), that forwards internally. On Mon, May 24, 2010 at 12:36, Javier Garcia wrote: > Hi, > > i have these methods in module1/actions/actions.

[symfony-users] Trying to retrieve a variable saved using sfContext::getInstance()

2010-05-24 Thread Javier Garcia
Hi, i have these methods in module1/actions/actions.class.php: public function executeMethod1(sfWebRequest $request){ $a = 10; sfContext::getInstance()->set('a', $a); return $this->redirect('module1/method2'); } public function executeMethod2(sfWebRequest $request){

[symfony-users] New symfony book - A Gentle Introduction to symfony 1.4

2010-05-24 Thread Gareth McCumskey
Hi all, Fabien just tweeted about this and I am very pleased to see it come to fruition. I remember starting a mailing list post about the Definitive Guide to symfony not being "ported" over for 1.4 and a discussion ensued whereby Fabien said he'd look into getting that done as it would a valua

Re: [symfony-users] Re: shopping cart?

2010-05-24 Thread Javier Garcia
http://groups.google.com/group/symfony-users/browse_thread/thread/e0be57c3d4074d85/f2b58a604f51ae99?lnk=gst&q=ecommerce#f2b58a604f51ae99 On 05/24/2010 02:09 AM, bretth wrote: Thanks for the reply Javi, can you point me to the thread? The only recent one I can find on Google Groups about shoppin

[symfony-users] Routing: use underscore as separator in url

2010-05-24 Thread Mickael HOAREAU
Hi, In the routing.yml, I would like to use an underscore as a separator for the parameter. rule_sample: url: /article/:info-:datePublished_:id.html param:{ module: cms, action: test } options: segment_separators: ['-', '/', '.', '_'] requirements: info: ^([A-Za-z0-9\-]+)

[symfony-users] Re: Ajax component depending on request uri

2010-05-24 Thread Tom Ptacnik
I can't imagine how to get it via ajax without an action :) On 21 kvě, 02:10, phiamo wrote: > Hi, > i think i have a common thing here but searching newsgroups and docs > didnt help. > > i have a component which depents on various request parameter (not > directly but classes used depend on that

[symfony-users] Re: Pagination non-database list

2010-05-24 Thread Tom Ptacnik
Where do they come from? On 22 kvě, 23:52, Ricign wrote: > Hi, > What is the best way to do pagination for list of object. > The objects are't come from database. > > Thanks, > > Rick > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-projec

[symfony-users] Re: How to retrieve the value of a field in configure() function

2010-05-24 Thread Tom Ptacnik
I think callback is the right way. http://blog.rajatpandit.com/2010/01/01/using-sfvalidatorcallback/ On 22 kvě, 17:48, Stéphane wrote: > Wouldn't it be good too to validate them as not required then use an > sfValidatorCallback using $this(form)->setPostValidator(new > sfValidatorCallback()) ?

[symfony-users] Re: embedForm problem in edit view

2010-05-24 Thread Tom Ptacnik
It's strange. I embed all my subforms in the configure method. // Embed paymentinfo form $this->embedForm('paymentinfo', new PaymentinfoForm($this->getObject()- >getMyPaymentinfo())); On 23 kvě, 13:01, Tofuwarrior wrote: > UPDATE: I've found that the problem seems to be because I have mbedded >

[symfony-users] Re: edit id in admin

2010-05-24 Thread Tom Ptacnik
So the problem is, that symfony always write the autoincrement id or it doesn't insert id at all? On 21 kvě, 19:51, Mihai Rusoaie wrote: > Hello! > > When I insert an new object in the database, I want the id to be > assigned automatically (autoincrement). > > In the edit form, however, I want t

[symfony-users] Re: Dumping and loading passwords (re-hashing)

2010-05-24 Thread Tom Ptacnik
"I can't check in the changes" means, that you can't update the plugin via svn? I fso, than you can do your changes in the model/doctrine/ sfDoctrineGuardPlugin sfGuardUser.class.php don't you? .. then this problem will be solved. On 21 kvě, 18:12, ashton wrote: > I have a question regarding du

[symfony-users] Re: primary key _forms

2010-05-24 Thread Tom Ptacnik
at default the id is sfWidgetFormInputHidden() ... change it to sfWidgetFormInputText or create some sfWidgetFormPlain (http:// code.google.com/p/uninformed/source/browse/trunk/lib/ sfWidgetFormPlain.class.php?spec=svn112&r=112) On 21 kvě, 17:03, safa boubekri wrote: > hello > in my forms i have

[symfony-users] Re: problem rendering embedded form when in edit

2010-05-24 Thread Tom Ptacnik
Show some code of how you embed the form. On 21 kvě, 16:26, Tofuwarrior wrote: > Hi, > > Anyone give me any pointers? I'm stumped and not really sure where to > look. Would really appreciate any help anyone could give, deadline is > looming :-( > > I have an embedded form  that works fine for th