[symfony-users] A module with i18n, Nested Set and an ImageCollection. Is this ok?

2010-04-12 Thread Gustavo Adrian
Hi everyone. I want to create a module for Categories. Every category has 1 or more images. The i18n fields are: title and description. Basically, I have in CategoriesForm.class.php (I won't put the exact script, but the essencial things just to show you my point. It would be too long if I put the

[symfony-users] Re: A module with i18n, Nested Set and an ImageCollection. Is this ok?

2010-04-12 Thread Gustavo Adrian
I have another quick question about what I've posted. In the model of de record, let's say the model "Image" following my last post.. I need to override the "save" function to add the logic to generate thumbnails and to delete files if needed. Let's say that my function is the one that posted befor

[symfony-users] [SYMFONY 1.4] using embedRelation the item is saved twice. How could I avoid this?

2010-07-20 Thread Gustavo Adrian
After a little research on Google for this topic I've found certain posts that talk about situations like this (but not the same) so I thought on posting this. I have a typical relation between two models, Item and Attachment, making a One-to-Many relationship. On my Attachment model I tried to en

Re: [symfony-users] Re: Symfony on Shared Hosting

2010-07-20 Thread Gustavo Adrian
"mydomain.com" is not a folder. You should have something like "$this->setWebDir( $this->getRootDir() . DIRECTORY_SEPARATOR . 'myPublicFolder' );" And I would check with the "check_configuration.php" script. The directory structure should be something like this (I use what I did on Linux shared ho

Re: [symfony-users] Re: Symfony2 or CakePHP ?

2010-07-20 Thread Gustavo Adrian
In my opinion, if you need the app almost ready for september.. use a lightweight framework like Codeigniter or ,as you said, with CakePHP (if you've worked with them). You can do a lot of things fast enough with the admin generator of Symfony and the development of the frontend with its template e

Re: [symfony-users] Re: include_js/css VS partials

2010-07-20 Thread Gustavo Adrian
Are you using "include_javascripts();" and "include_stylesheets()" functions on the head tag of the layout? On Tue, Jul 20, 2010 at 7:15 AM, comb wrote: > Symfony 1.4 + Doctrine 1.2 > > Any ideas? :-) > > On 20 Jul., 11:58, Tom Ptacnik wrote: > > Which version of Symfony do you use? > > > > On

Re: [symfony-users] Re: using embedRelation the item is saved twice. How could I avoid this?

2010-07-21 Thread Gustavo Adrian
ms too, not a > beautiful solution, but it works. > > On 20 juil, 15:05, Gustavo Adrian wrote: > > After a little research on Google for this topic I've found certain > > posts that talk about situations like this (but not the same) so I > > thought on posting this.

Re: [symfony-users] no_script_name and problems with URI

2010-07-21 Thread Gustavo Adrian
If I'm wrong, please, correct me, but didn't the routing framework take the action "index" by default, so you can avoid tu put it on the URL? BTW, Why do you think is not clean to put the rules on the routing.yml? On Wed, Jul 21, 2010 at 6:51 AM, snoop wrote: > Hi all, > > I changed the no_scri

Re: [symfony-users] How to style embedded forms

2010-07-22 Thread Gustavo Adrian
I managed to do whay you mention by changing some templates of the module autogenerated for the backend. In _form_fieldset.php you have the loop that iterates over the fields. You could then check the name of the field and, if it's the name of the embedded form, you could then surround it by a "div

Re: [symfony-users] Re: caching problem in firefox

2010-07-22 Thread Gustavo Adrian
Hi, Did you try to disable local caching on the action with headers "Cache-control" and "Pragma" to see what happens? $this->getResponse()->setHttpHeader("Cache-Control", "no-cache"); $this->getResponse()->setHttpHeader("Pragma", "no-cache"); $this->getResponse()->setHttpHeader("Expires", 0); O

[symfony-users] vjCommentPlugin and sfDoctrineGuardUser 5.0.0

2010-07-23 Thread Gustavo Adrian
I've recently upgraded sfDoctrineGuardUser from 4.0.1 to 5.0.0 but when doing the rebuild of the db, models, forms... etc, it throws this error: SQLSTATE[HY000]: General error: 1005 Can't create table 'estudio_development.#sql-29d0_228a' (errno: 150). Failing Query: "ALTER TABLE comment ADD CONSTR

Re: [symfony-users] CCBill or Epoch Plugins

2010-07-23 Thread Gustavo Adrian
I've just seen prestaPaypalPlugin ( http://www.symfony-project.org/plugins/prestaPaypalPlugin) but I didn't try it. I'd like to know about this topic too. Any comment about it will be much appreciated. On Wed, Jul 21, 2010 at 5:53 PM, f1gm3nt wrote: > Has anyone used any type of payment plugins

Re: [symfony-users] vjCommentPlugin and sfDoctrineGuardUser 5.0.0

2010-07-23 Thread Gustavo Adrian
e too. Any thoughts? Thanks! 2010/7/23 Michał Piotrowski > Hi, > > 2010/7/23 Gustavo Adrian : > > I've recently upgraded sfDoctrineGuardUser from 4.0.1 to 5.0.0 but when > > doing the rebuild of the db, models, forms... etc, it throws this error: > > > > SQLSTAT

Re: [symfony-users] vjCommentPlugin and sfDoctrineGuardUser 5.0.0

2010-07-23 Thread Gustavo Adrian
Don't matter. I forgot to enable the plugin again in projectConfiguration.class.php Thanks! On Fri, Jul 23, 2010 at 5:44 PM, Gustavo Adrian wrote: > First of all, thanks for the quick response! > > I've just installed from trunk of the svn repository the plugin as you

[symfony-users] sfPhpUnit2Plugin functional tests. Someway to reduce memory usage?

2010-07-23 Thread Gustavo Adrian
Hi, I'm using this excellent plugin to do my unit and functional tests. Unfortunately, each of my backend tests use a huge quantity of memory (some reach the 500mb). My dev server is on a VM and it has 1024 of memory. If I want to run every test with one command you can imagine what happens. I mad

Re: [symfony-users] vjCommentPlugin and sfDoctrineGuardUser 5.0.0

2010-07-24 Thread Gustavo Adrian
Look at the answer of Michal. You have to use the SVN trunk version On Sat, Jul 24, 2010 at 5:57 AM, Sela Yair wrote: > anyone has tried to upgrade from 4.0.x to 5.0.0 of sfGuardDoctrine ? as i > get an erro > > On 23 July 2010 21:47, Gustavo Adrian wrote: > >> Don't

Re: [symfony-users] Re: latest verion of sfForkedDoctrineApplyPlugin is broken

2010-07-26 Thread Gustavo Adrian
Check the path of that class to see if it exists. If that's so, try to remove the cache manually (not with ./symfony cc) On Mon, Jul 26, 2010 at 11:23 AM, Tristan wrote: > When i rebuild my model, it outputs the same error at a different > line. > > php symfony cc as many time as i could :d > > -

Re: [symfony-users] Re: latest verion of sfForkedDoctrineApplyPlugin is broken

2010-07-26 Thread Gustavo Adrian
Also, double check that the plugin is enabled on ProjectConfiguration.class.php On Mon, Jul 26, 2010 at 11:33 AM, Gustavo Adrian < comfortablynum...@gmail.com> wrote: > Check the path of that class to see if it exists. If that's so, try to > remove the cache manually (not

[symfony-users] [SYMFONY 1.4] Better way of setting default i18n messages for validators?

2010-07-26 Thread Gustavo Adrian
Hi, I've found a way to do this in the BaseForm class. I just set the default message of each validator on the "setup" method, like: // I use the __() function because I enabled the I18N helper by default sfValidatorBase::setDefaultMessage( 'required', __( 'Required field' ) ); sfValidatorIntege

Re: [symfony-users] Re: Better way of setting default i18n messages for validators?

2010-07-28 Thread Gustavo Adrian
ms of sfDoctrineGuard. Do you know why does this happen? Thanks. On Wed, Jul 28, 2010 at 4:42 AM, Tom Ptacnik wrote: > I think that just sfValidatorBase::setDefaultMessage( 'required', > 'Required field' ); is enough and the __() helper will be used > automaticly. >

Re: [symfony-users] Re: sfDoctrineGuardPlugin doesn't redirect to the referrer page

2010-07-28 Thread Gustavo Adrian
Did you set the signin redirect url in file app.yml? all: sf_guard_plugin: success_signin_url: @my_route?param=value # the plugin use the referer as default success_signout_url: module/action # the plugin use the referer as default On Wed, Jul 28, 2010 at 5:10 PM, Jav

Re: [symfony-users] Adding CSS classes to body tag

2010-07-28 Thread Gustavo Adrian
What about including a slot and then, depending on the template, use the class accordingly? > And then in the template: ** and in other template: ** Another way could be, just like you mention, with a filter. Perhaps taking the response and replacing the body tag with a body tag with the

Re: [symfony-users] Avoid blank embed form to be saved

2010-07-28 Thread Gustavo Adrian
Maybe I'm wrong but.. isn't $comment set already on this line by 'getValue'? (saveEmbeddedForms of ExpenseForm) *$comment** **=** **$this**->**getValue**(**'**comment**'**);*So the line: *unset**(**$forms**[**'**comment**'**]);* doesn't execute never? On Wed, Jul 28, 2010 at 11:22 PM, J_Wes

Re: [symfony-users] Avoid blank embed form to be saved

2010-07-28 Thread Gustavo Adrian
Sorry, the last line I was talking about is: *if** (**!**isset**(**$comment**)) { **unset**(**$forms**[**'**comment**'**]); } The if condition would be always false* On Wed, Jul 28, 2010 at 11:40 PM, Gustavo Adrian < comfortablynum...@gmail.com> wrote: > Maybe I&

Re: [symfony-users] Re: Avoid blank embed form to be saved

2010-07-29 Thread Gustavo Adrian
ted function doClean($values) > { >// no comment, remove the empty values >if (!$values['comment']['body']) >{ > unset($values['comment']); > } > >return $values; > } > } > > Or perhaps I'm having a logic

Re: [symfony-users] Set value of a database field depending of another field

2010-07-29 Thread Gustavo Adrian
No, but you can do it on the model, on the preSave method (on your model inheriting Doctrine_Record class) On Thu, Jul 29, 2010 at 10:50 AM, Jérémie wrote: > Hi all, > > Let me explain: > > I have a field "isPublished" in my table, and another "publicationDate". > When "isPublished" is updated f

[symfony-users] [SYMFONY 1.4] How to deploy on a subdirectory?

2010-07-30 Thread Gustavo Adrian
Hi all, This is a topic I've been avoiding for a long time but now I need to deploy my app on a subdirectory and there's no other option. IMPORTANTE: It's on a SHARED HOSTING. The app dir structure now is something like this: / /demos /myAppSymfonyFiles /app /cache /config /dat

Re: [symfony-users] Re: Emails and multiple Applications

2010-08-02 Thread Gustavo Adrian
If it's just a text email, you could encapsulate the message in a message object so you don't have to use the template. But, as I said, this would be just for a text email, With HTML it would be a little cumbersome. On Mon, Aug 2, 2010 at 12:11 PM, Stephen Melrose wrote: > I thought of that, but

[symfony-users] Re: [SYMFONY 1.4] How to deploy on a subdirectory?

2010-08-02 Thread Gustavo Adrian
Anyone? On Fri, Jul 30, 2010 at 1:13 PM, Gustavo Adrian wrote: > Hi all, > > This is a topic I've been avoiding for a long time but now I need to deploy > my app on a subdirectory and there's no other option. IMPORTANTE: It's on a > SHARED HOSTING. > > Th

Re: [symfony-users] Re: [SYMFONY 1.4] How to deploy on a subdirectory?

2010-08-02 Thread Gustavo Adrian
ess your sf app usually frontend.php / > frontend_dev.php / index.php / admin.php / admin_dev.php ...etc. > 2010/8/2 Gustavo Adrian > >> Anyone? >> >> >> On Fri, Jul 30, 2010 at 1:13 PM, Gustavo Adrian < >> comfortablynum...@gmail.com> wrote: >&g

Re: [symfony-users] Problem With Jobeet: Day 5

2010-08-02 Thread Gustavo Adrian
The problem here is that using a custom method without further configuration there's no way the routing system can find the article based on the "title_slug" parameter, because the field actually doesn't exist on the database. The best way to do it is using the "Sluggable" behaviour of Doctrine. It

Re: [symfony-users] Re: Real purpose of admin generator

2010-08-02 Thread Gustavo Adrian
I think it depends on your requirements. If you need a backend with simple CRUD modules.. then you could use the generator to create them in just a few minutes. Maybe then customize the templates and there you go. You have a fully CRUD module ready to go in notime. You could of course extend the ge

Re: [symfony-users] Re: [SYMFONY 1.4] How to deploy on a subdirectory?

2010-08-02 Thread Gustavo Adrian
t; > > On Mon, 2010-08-02 at 19:00 -0300, Gustavo Adrian wrote: > > First of all, thanks for your reply! > > > > The problem of creating a symlink comes from the fact that I have a > shared hosting. Is there a way of doing this on a shared hosting without ssh > acces

Re: [symfony-users] Re: Trying to redirect a user to a login page with ajax: 401 unauthorized

2010-08-02 Thread Gustavo Adrian
Or you could just check for the code of the response in your jQuery script that handles the AJAX form. If it's 401, then you redirect the user to the login page. On Sun, Aug 1, 2010 at 10:31 AM, Tristan wrote: > mmhhh i'm not sure in understand everything here ='( > > -- > If you want to repo

Re: [symfony-users] Re: [SYMFONY 1.4] How to deploy on a subdirectory?

2010-08-03 Thread Gustavo Adrian
* Thanks! <http://pastebin.com/cFQHfKwJ> On Tue, Aug 3, 2010 at 11:39 AM, Anibal Sólon wrote: > You can paste (http://pastebin.com/) the .htaccess and > projectConfiguration.class.php file? Dont think that is the .htaccess > > > On Tue, 2010-08-03 at 00:24 -0300, Gustavo Ad

Re: [symfony-users] Re: Semgentation fault +Infinite loop... huh ?

2010-08-03 Thread Gustavo Adrian
Try to separate the logic of sending mails from the model. You should put it on the pertinent action. Something like: public function executeSetIsActivatedAndSendMail( $request ) { $this->myObject = $this->getRoute()->getObject(); $value= $request->getParameter( 'myValue' )

Re: [symfony-users] Re: [SYMFONY 1.4] How to deploy on a subdirectory?

2010-08-03 Thread Gustavo Adrian
set with the full path (check > the stylesheet_path helper function) > > if you try to change the .htacces, you shuld change the RewriteBase > and probably a simple Alias shuld work out. > > Alias /css /demo/myDemoApp/css > > but you my not be able

Re: [symfony-users] Re: [SYMFONY 1.4] How to deploy on a subdirectory?

2010-08-03 Thread Gustavo Adrian
if it begins with > "/" is absolute (to the server) > > 2010/8/3 Gustavo Adrian : > > Thanks for your reply Luciano! > > > > Sadly, it doesn't work in either way. The problem seems to be the > relative > > path I used on every asset: for example, i

Re: [symfony-users] multiples INSERT

2010-08-03 Thread Gustavo Adrian
Could you paste your model schema and your form class? On Tue, Aug 3, 2010 at 5:05 PM, B.O.G wrote: > Hi!! > > I have a ComboBox like this, witch is a embeddedForm into a MainForm= > 'Comunicacion': > > multiple="multiple" id="comunicacion_destinatario_user_profile_id"> > > Maria< > /opt

Re: [symfony-users] a good IDE for Symfony

2010-08-03 Thread Gustavo Adrian
I'm using Eclipse and I have the same issues. Are you using a development server on a virtual machine? or is a physical pc connected via lan? I'm having speed issues because the VM. Anyway, the other IDE that it seems to be nice is PHPEdit, which also includes extensions for Symfony, phpUnit, etc.

Re: [symfony-users] a good IDE for Symfony

2010-08-03 Thread Gustavo Adrian
n.reyes.escri...@gmail.com> wrote: > Thanks and knows about open source IDE with the same characteristics > > > > *De:* symfony-users@googlegroups.com [mailto: > symfony-us...@googlegroups.com] *En nombre de *Gustavo Adrian > *Enviado el:* martes, 03 de agosto de 2010 18:31 >

[symfony-users] [SYMFONY 1.4] Session timeout problem

2010-08-04 Thread Gustavo Adrian
Hi, I'm using sfDoctrineGuardPlugin. My backend session always ends after 5 or 10 minutes if its idle. I've tried to change on factories.yml: *user:* *class: myUser* *param:* * timeout: 86400* And.. * storage:* *param:* * session_cookie_lifetime: 86400* But n

Re: [symfony-users] slot component - sidebar form

2010-08-05 Thread Gustavo Adrian
You can't access from the outside to anything except an action. You have to check the validity of the form on the action and, optionally, pass the result to the component. Cheers. On Thu, Aug 5, 2010 at 3:58 AM, Christian Fazzini < christian.fazz...@gmail.com> wrote: > I've got a sidebar on my

Re: [symfony-users] generating project error

2010-08-05 Thread Gustavo Adrian
Could you show us the exact command you are using for generating a project? include the real arguments too. On Thu, Aug 5, 2010 at 2:57 AM, yzhastik wrote: > I am trying to generate new project (as in jobeet tutorial), but > symfony says me that project already created in directory with symfony

Re: [symfony-users] Re: Session timeout problem

2010-08-05 Thread Gustavo Adrian
may be other things to consider as > well. > >gabriel > > > On Aug 5, 4:31 am, Gustavo Adrian wrote: > > Hi, > > > > I'm using sfDoctrineGuardPlugin. My backend session always ends after 5 > or > > 10 minutes if its idle. I've tried t

[symfony-users] [SYMFONY 1.4] Dealing with application / business transactions and concurrency issues. Ideas?

2010-08-05 Thread Gustavo Adrian
Hi, I guess this is topic was touched a lot of times but It would be great to see your thoughts and experiences about this. I started to develop an application that really needs to take care about concurrency issues. So I was thinking about creating a Doctrine behaviour for this that puts a coupl

Re: [symfony-users] Re: a good IDE for Symfony

2010-08-06 Thread Gustavo Adrian
I tried PHPEdit. It's amazing and FAST. Code suggestions out of the box after parsing your project files. Excellent. On Fri, Aug 6, 2010 at 8:01 AM, Tom Ptacnik wrote: > I'm using Eclipse too, and I'm happy with it. > > On 4 srp, 11:36, Gareth McCumskey wrote: > > For me the biggest aspects of

Re: [symfony-users] Symfony Installation in Godaddy hosting

2010-08-06 Thread Gustavo Adrian
Check in the hosting panel. There has to be an option to choose between PHP version 4 and 5. On Fri, Aug 6, 2010 at 2:08 AM, Md Mostafizur Rahman milon wrote: > dear Symfony user > > i am new in Symfony framework. i have a hosting account in Godaddy > Linux Hosting in PHP 5 . but when i was log

Re: [symfony-users] load L18N helper in form class : how to ?

2010-08-07 Thread Gustavo Adrian
use ProjectConfiguration::getActive() instead of sfProjectConfiguration. Although if you're going to use the i18n helper on many forms (like me), you could put that statement on yourAppnameConfiguration.class.php on the 'config' dir of the app: // apps/backend/config/backendConfiguration.class.ph

Re: [symfony-users] using admin generator on frontend; restricting to records for the current user

2010-08-08 Thread Gustavo Adrian
Maybe adding the username to a subdomain, like "username.myDomain.com" and create a new routing class that takes that username into account to filter items by user? On the "More with Symfony" book is a great example of this approach: http://www.symfony-project.org/more-with-symfony/1_4/en/02-Adva

Re: [symfony-users] admin gen 1:m in one form

2010-08-08 Thread Gustavo Adrian
I saw a few plugins that seems to do what you're looking for, but I haven't tried any of them yet. This is one of them: http://www.symfony-project.org/plugins/ahDoctrineEasyEmbeddedRelationsPlugin Cheers. On Mon, Aug 9, 2010 at 12:30 AM, Christian Fazzini < christian.fazz...@gmail.com> wrote:

Re: [symfony-users] Re: using admin generator on frontend; restricting to records for the current user

2010-08-09 Thread Gustavo Adrian
suggestion Gustavo, but this seems like way too much > complication for what seems like a pretty simple job; involving DNS > into this potentially adds another whole area for complications and > issues. > > can anyone shed some light? > > cheers > > On Aug 9, 2:36 pm, Gu

Re: [symfony-users] The requested URL was not found on this server. ERROR

2010-08-09 Thread Gustavo Adrian
Try to change this line: #RewriteBase / To: RewriteBase / Cheers. On Mon, Aug 9, 2010 at 5:41 PM, Alexandre Salomé wrote: > Can be rewrite module that is not enabled in your project. > > To check it is the missing module, remove the tag. > > It it shows "500 - Internal Error", look at yo

Re: [symfony-users] Re: using admin generator on frontend; restricting to records for the current user

2010-08-09 Thread Gustavo Adrian
; you > still have to filter out the listing of records to just the ones that > have image.user_id = ?. In your idea, where would that be done? > > thanks for the help! > > On Aug 9, 10:39 pm, Gustavo Adrian > wrote: > > It depends on the options of your hosting I guess

Re: [symfony-users] Re: admin gen 1:m in one form

2010-08-10 Thread Gustavo Adrian
expects the object to already exist! > > > > Hence the code: $this->form = new UserBookmarksForm($user = > > Doctrine::getTable('User')->findOneByName('niko')); > > > > I just figured this out and spent a whole day, thinking this was

Re: [symfony-users] Im playing with Tutorial, how can i debug blank (white) page ?

2010-08-10 Thread Gustavo Adrian
What OS are you developing on? Check permissions on the cache and log dirs. On Tue, Aug 10, 2010 at 5:11 PM, Alexandre Salomé < alexandre.sal...@gmail.com> wrote: > The debug best code is : > > die('ok'); > > Move it toward until it disappear. Some good start points are : > >- First line of i

Re: [symfony-users] appending to flashes/multiple flashes

2010-08-11 Thread Gustavo Adrian
The setting of the notice takes place on the action, not on the form. And it's generated in every module you create with the admin generator. So, as Alexander said, you'd need to modify the skeleton of the generated actions to add your functionality. On the other hand, an easier way would be to ju

[symfony-users] [SYMFONY 1.4] Install plugins programmatically?

2010-08-11 Thread Gustavo Adrian
Hi! Quick question: Is there a way to install and enable a plugin from PHP? Thanks! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-12 Thread Gustavo Adrian
s and run them from >> elsewhere in your code. >> >> I think the issue would be how you enable them in your >> ProjectConfiguration. >> >> On Aug 11, 8:49 pm, Gustavo Adrian >> wrote: >> > Hi! >> > >> > Quick question: Is there a way to install an

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Gustavo Adrian
)) { >$xml = simplexml_load_file('enablePlugins.xml'); >$enabledPluginsXml = $xml->xpath(...); > $this->enablePlugins($enabledPluginsXml); > } > } > > > On 12 aug, 22:12, Gustavo Adrian wrote: > > Hi, first of all, thank you both guys for your

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Gustavo Adrian
('sf_enabled_modules', > array_unique(array_merge(sfConfig::get('sf_enabled_modules'), > array('my_first_module_name_to_enable', 'my_second_module', 'etc'; > > Kind regards, > Johannes > > > On 13 Aug., 14:57, Gustavo Adrian wrote: >

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Gustavo Adrian
ng your solution somewhere? A snippet would be nice – along > with a quick explanation on how to do it. :) > > That'd be great (but is in no way mandatory, just a suggestion to give > something back to the community)! > > > Cheers, Daniel > > On 13.08.2010, at 17:14

Re: [symfony-users] Re: Install plugins programmatically?

2010-08-13 Thread Gustavo Adrian
hould be > enough > > > On Aug 13, 5:04 pm, Johannes > wrote: > > No explicit method as far as I know, but this works: > > > > sfConfig::set('sf_enabled_modules', > > array_unique(array_merge(sfConfig::get('sf_enabled_modules'), > &g

Re: [symfony-users] Form choice from database based on hidden form element

2010-08-13 Thread Gustavo Adrian
Could you post the code from your form? On Fri, Aug 13, 2010 at 7:36 PM, Jonotron wrote: > I have a form that uses a sfWidgetFormDoctrineChoice widget and I pass > a query to it that selects my "category" records based on another > hidden field. My query has a ->where('a.id = ?', $this->getObjec

[symfony-users] [SYMFONY 1.4] sfDoctrineGuardPlugin: get a 401 response code on non GET unauthorized request?

2010-08-14 Thread Gustavo Adrian
Hi, I use sfDoctrineGuardPlugin for securing my apps. In my backend I use AJAX heavily. With a GET request, if the user session is gone, I get a 401 (unauthorized) response, so using Javascript I redirect the user to the login page correctly. But when a POST request occurs, it gives me a 200 (OK)

Re: [symfony-users] Re: sfDoctrineGuardPlugin: get a 401 response code on non GET unauthorized request?

2010-08-15 Thread Gustavo Adrian
Thanks for your answer! I thought on using the way you suggest. I could use a custom action and then inherit from it on my module actions. In the preExecute do some check like the one you suggest and just set the response code to 401 (in my case I just need that). But I was thinking on just change

Re: [symfony-users] Re: sfDoctrineGuardPlugin: get a 401 response code on non GET unauthorized request?

2010-08-15 Thread Gustavo Adrian
sesfGuardAuthActions { public function preExecute() { parent::preExecute(); $this->getResponse()->setStatusCode( 401 ); } } And that's it. Cheers. On Sun, Aug 15, 2010 at 6:52 PM, Gustavo Adrian wrote: > Thanks for your answ

Re: [symfony-users] PHP related,Symfony unrelated

2010-08-17 Thread Gustavo Adrian
You can add the order type as another parameter to the link (ASC or DESC) too. Then, at the moment of link generation, you check for the column that is being used for ordering. In that link you then just change the order type to the opposite of the actual one (so, if the user is looking at a user l

Re: [symfony-users] Re: How i can implement this with sfGuard plugin

2010-08-17 Thread Gustavo Adrian
In your fixtures check if you are indeed assigning a valid sfGuardUser to the user_id field of "rank_domain" objects On Tue, Aug 17, 2010 at 2:12 AM, RusAlex wrote: > Can you explain please: > I've tried to add relation to schema.yml > > RankDomain: > columns: >name: { type: string(255), no

Re: [symfony-users] Country City problem

2010-08-18 Thread Gustavo Adrian
This could help: http://www.symfony-project.org/plugins/sfDependentSelectPlugin On Wed, Aug 18, 2010 at 7:18 AM, Andro Fumero wrote: > Good day, > > Does any one tried to make a drop down Countries, and when its clicked, it > will display the list of cities based on the selected Country. > I

Re: [symfony-users] Re: trying to make a relation with sfGuardUser and got error

2010-08-18 Thread Gustavo Adrian
Could you paste your RankDomain fixtures? the problem may be there On Wed, Aug 18, 2010 at 3:12 AM, RusAlex wrote: > IT's a standart fixtures: > sfGuardUser: > User_admin: >first_name: John >last_name: Doe >email_address: john@gmail.com >username: admin >

Re: [symfony-users] How to remove the TH elements in embedded forms in admin generator

2010-08-18 Thread Gustavo Adrian
Overriding the view for that special case? or creating your own collection form, assigning a friendly name instead of the numeric ones. Or you could simply use jQuery or css, as you said. On Wed, Aug 18, 2010 at 1:47 PM, Christian Fazzini < christian.fazz...@gmail.com> wrote: > At the following s

Re: [symfony-users] How to set a field with the id of the doctrine object in the saving process

2010-08-19 Thread Gustavo Adrian
If you have unique = true and notnull = true then you have to assign a unique filename before you save the object, or you would have an exception. The better way would be to just assign a random name, as Georg says. If you really need the ID on the name, then first assign a random name and, after t

Re: [symfony-users] How to set a field with the id of the doctrine object in the saving process

2010-08-19 Thread Gustavo Adrian
I forgot to mention: The exception would be thrown if you attempt to insert (or update) a second object with an empty filename (having a nullable field you could insert as many objects as you want with NULL assigned to that field) On Thu, Aug 19, 2010 at 7:08 PM, Gustavo Adrian wrote: > If

Re: [symfony-users] doSave on a standalone sfForm

2010-08-19 Thread Gustavo Adrian
I would create a custom form class that extends from sfForm (sfFormCRM for example) and put there all the saving logic of the form. Then it would be a nice idea to have a BaseFormCRM that inherits from your sfFormCRM to have a place to put common application logic between your CRM forms without tou

Re: [symfony-users] Introduction

2010-08-20 Thread Gustavo Adrian
Hi Jochen, Gareth has answered all your questions, so I just wanted to say: welcome to the Symfony community! As Gareth said, "A gentle introduction to Symfony" is a good start. And if you didn't use Doctrine or Propel before (I don't know which one you are using now with Symfony) try to start re

Re: [symfony-users] Re: creation tables MySql avec doctrine (Jobeet)

2010-08-20 Thread Gustavo Adrian
Hi, Please, ask your questions in english so everyone of us can help. About your problem, are you having problems only on the CLI? if that's so, maybe you didn't modify the php.ini for the CLI. I don't know which OS you're using, so try to run phpinfo() on the CLI to check where is the php.ini th

Re: [symfony-users] Send Mails

2010-08-23 Thread Gustavo Adrian
Did you try using the Swift Mailer that comes with Symfony? try sending with SMTP using the SMTP server of your gmail account (if you don't have your own email account, of course). Here says how: http://www.symfony-project.org/gentle-introduction/1_4/en/11-Emails

Re: [symfony-users] Please advice code structure for Google Maps auto-correct of address

2010-08-23 Thread Gustavo Adrian
You should create a widget and embed the JS needed there. Here is a nice tutorial about this: http://www.symfony-project.org/more-with-symfony/1_4/en/05-Custom-Widgets-and-Validators On Mon, Aug 23, 2010 at 8:49 PM, Jochen Daum wrote: > Hi, > > for my application here I need to "auto-correct" a

Re: [symfony-users] Re: Send Mails

2010-08-24 Thread Gustavo Adrian
Use the port 465 instead of the 25 for gmail On Tue, Aug 24, 2010 at 9:48 AM, vero wrote: > It's impossible. I don't know how send an email at all. > I have tried everything but no email arrive to inbox. > I will have to decided what to do in that part of my project. > > Thanks to all for trying

[symfony-users] [Symfony 1.4] doSave never called on update?

2010-08-24 Thread Gustavo Adrian
Hi everyone, I have something like this for my schema: WebGenericElement: actAs: I18n: fields: [title] columns: title: type: string(255) notnull: true Product: inheritance: extends:WebGenericElement type: column_aggre

Re: [symfony-users] Re: Trying to replace the default 'Required' message

2010-08-24 Thread Gustavo Adrian
Maybe because first it's the sfValidatorEmail that throws the required error? Although, if you want to change the required field message to every validator, you could do this: sfValidatorBase::setDefaultMessage( 'required', 'My required message' ); On Tue, Aug 24, 2010 at 1:53 PM, Javier Garcia

Re: [symfony-users] Re: Trying to replace the default 'Required' message

2010-08-24 Thread Gustavo Adrian
Or course, that line could be on the BaseForm or even in the application configuration class so every form could use that default message. The same applies to the 'invalid' message. On Tue, Aug 24, 2010 at 2:26 PM, Gustavo Adrian wrote: > Maybe because first it's the sfV

Re: [symfony-users] sfWidgetFormDoctrineChoice problem

2010-08-25 Thread Gustavo Adrian
The dropdown must show every available choice, regardless an option is already selected or not (What would you do if you need to update an item and you want to change that value?). If you need to show only the option selected, you could change the table method used by the widget to change the list

Re: [symfony-users] Re: Doctrine Pager max per page problem

2010-08-27 Thread Gustavo Adrian
Could you show us your action's code? On Fri, Aug 27, 2010 at 12:11 PM, ziclo wrote: > More explanation about this issue : > > If the number of objects returned is > 10 then objects are displayed. > If number of objects returned < 10 then nothing is displayed. > I think there is a problem with t

Re: [symfony-users] memory error and question about data loading (newbie)

2010-08-27 Thread Gustavo Adrian
You need to extend your memory_limit for PHP. Check your php.ini (for CLI) and put 128MB as memory_limit (or something like that). On Fri, Aug 27, 2010 at 1:26 PM, mjhvc wrote: > first: about memory error: > my command: > ./symfony doctrine:data-dump > symfony output: > >> doctrine dumping dat

[symfony-users] CSRF Token on AJAX batch form fails, why?

2010-08-30 Thread Gustavo Adrian
Hi, I'm creating my own admin generator with heavy use of AJAX. Every CRUD action works fine, except with the batch actions. I've tried to use the same code that is used on the original admin generator but it keeps throwing "CSRF attack detected". I have a form that wraps a table, with each row ha

Re: [symfony-users] Re: IE8 and isXmlHttpRequest

2010-09-01 Thread Gustavo Adrian
I use Symfony with jQuery in my last app where I've made every functionality available via AJAX and it works perfectly on IE8. Can you give us more information abour your app so we can help you more? version of Symfony, jQuery and the code you're using to receive the AJAX request? On Wed, Sep 1,

Re: [symfony-users] Re: IE8 and isXmlHttpRequest

2010-09-02 Thread Gustavo Adrian
t; My call in my HTML template: > > setTimeout("ajax('div_javascript_ajax', '/en/world');", 1); > > > > The JS function: > > function ajax(sId, sUrl){ > > $('#' + sId).load(sUrl); > > > > } > > &g

Re: [symfony-users] Re: Session won't last

2010-09-03 Thread Gustavo Adrian
Check the value of the "*session*.gc_maxlifetime" config on your php.ini. On Fri, Sep 3, 2010 at 10:34 AM, pghoratiu wrote: > Check the sessions settings in php.ini as well. > > What operating system do you use? For instance on Ubuntu there is a > cron job that deletes the session files and this

Re: [symfony-users] IDE

2010-09-03 Thread Gustavo Adrian
I tried PHPEdit and I must say is the best I used so far. It's FAST and it has a lot of features. It's not free, but is the best I tried. On Thu, Sep 2, 2010 at 9:45 PM, |-|@|\/|||) wrote: > I need IDE for symfony. please introduce IDE for symfony. > > -- > If you want to report a vulnerability

[symfony-users] [Symfony 1.4] Code example showing the use of sfValidatorFromDescription?

2010-09-06 Thread Gustavo Adrian
Hi everyone, Could you tell me where can I get a code example of the validator "sfValidatorFromDescription" on the Symfony Framework, or show me a little example of its use? I'm reading the API description of this class but I'd like to know how can I use it (and see if it's in fact what I'm lookin

[symfony-users] [Symfony 1.x] Basic question: Problems getting instances of Doctrine Table in production server

2010-09-08 Thread Gustavo Adrian
Hi, This is not a Symfony / Doctrine specific question but well.. I'm sure you can help me with this. I have to instantiate a doctrine table dynamically: *$table = 'MyDoctrineTable'; $instance= $table::getInstance();* In my dev server (PHP v5.3.2) it works fine. In my production se

Re: [symfony-users] Re: mobile site strategy

2010-09-08 Thread Gustavo Adrian
You could create a custom layout for mobile sites. Then, in the action: $this->setLayout( 'myMobileLayout' ); You could create a custom "base" action that extends from sfActions, where you check for the "sf_format" value for the request in the "preExecute" method. Then, based on that value, set t

Re: [symfony-users] Re: mobile site strategy

2010-09-08 Thread Gustavo Adrian
lemens_u) > > On Sep 8, 1:48 pm, Gustavo Adrian wrote: > > You could create a custom layout for mobile sites. Then, in the action: > > > > $this->setLayout( 'myMobileLayout' ); > > > > You could create a custom "base" action that extends f

Re: [symfony-users] sfguardauth // How to display a layout depending on user's group

2010-09-12 Thread Gustavo Adrian
Create a base action with a "preExecute" method. Check in that method for the user's group and change the layout accordingly. Then extend your actions from this base action. This would be a way of doing it. Another way would be maybe with a filter, but I like to have a baseAction and your requireme

Re: [symfony-users] individual User layouts?

2010-09-17 Thread Gustavo Adrian
Create a baseAction with a preExecute method where you check which user is logged in, and change the layout accordingly. Then, extend your own actions from this baseAction: // myApp/lib/actions/baseAction.class.php class baseAction extends sfActions { public function preExecute() {

Re: [symfony-users] some questions about sf

2010-09-22 Thread Gustavo Adrian
Hi, I tried a few IDE's like Eclipse, netbeans and PHPEdit. Eclipse was good but a little slow for me. PHPEdit is the best in my opinion, but it's not free. About your second question, I'm running a couple of projects on shared hosting and it runs nice. You should run the check_configuration.php

Re: [symfony-users] problem with sfWidgetFormChoice

2010-09-23 Thread Gustavo Adrian
Could you show us your DB schema? how do you want to save your multiple extensions on the DB? if you want to save the extensions in only one field then you could override the "doSave" method on your form, take the array of extensions and make a string with pipe separated values ( like: JPG|GIF|PNG

Re: [symfony-users] Re: problem with sfWidgetFormChoice

2010-09-23 Thread Gustavo Adrian
Hi, I thinkg you should override the "doUpdateObject" method on the form and change the value of the extension field there. Remember to put a pipe or comma to separate the values on the string.Try this (not tested) on the doUpdateObject method of your form: public function doUpdateObject( $values

  1   2   3   >