[symfony-users] sfGuardSecurityUser::getProfile( ) problem
Hi, Readme: The getProfile( ) method gets the associated user profile object or creates a new one if none already exists. Does anyone succeed on it? It seems no associate logic in source. Thanks. - xj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: sfGuardSecurityUser::getProfile( ) problem
Hi Xin, Are you using the sfDoctrineGuardPlugin? If yes, you just need to call $user-Profile (or whatever alias you chose in your schema). Bernhard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Custom route for Object
I have a problem with routing This is my (very simplified) model: Topten: columns: id: autoincrement, primary, etc name: string cat_id: integer relations: Category: local: cat_id foreign: id Category: columns: id: autoincrement, primary, etc name: string relations: Toptens: local: id foreign: cat_id class: Topten foreignAlias: Toptens I have autogenerated an admin for the Topten class. Now I want to add a cat to every template as to constrain the navigation to this cat. For example, I have the categories: film dvd. I am overriding the necessary templates and actions but am stuck at adding the routing. This is my current routing for the category 'film' (which has the id 1): editfilmetopten: url: /editfilmetopten/:id class:sfDoctrineRouteCollection options: { model: Topten, type: object } param:{ module: topten, action: edit, cat: 1 } requirements: id: \d+ When I edit an entry I get this error: Action editfilmetopten/show does not exist. But the route should point to the action edit anyway. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Jobeet day 10 forms / general terminology
What technically is a 'token' and what is 'tokenized?' How is this different from a primary key or unique identifier, and why would the one from the database not suffice? Also, while learning this and more about the MVC pattern, one of the things that's taking me longer to wrap my brain around is what snippets of code go where. For example, why does the $types array go into the 'JobeetJobPeer.php' file? Why not the JobeetJob.php file since it's related to a specific object? Or even more logical (for me), why not keep this variable at the top of the JobeetJobForm.class.php - it seems that because we're defining other elements of the form here, that this would be more easily managed and accessible from this file. Thanks! RM --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Remove embedded forms / update object runtime
Hi patter, What I'd do is unset the embedded form as if ot was any other field. if($postedValues[..insert your input name...]=='') unset($subForm['embededFormName']) Do this from anywhere before you bind the data. You could also override the bind method in your form, unset the form there, and call the parent method. Julien On Feb 11, 11:06 am, patter p.vukadi...@gmail.com wrote: Hello, I have a 1:n relation: User have two phone numbers (well my real use case is a bit complicated :-) ). In my UserForm::configure() I have something like this: $p1 = $this-object['phones'][0] = new Phone(); $p2 = $this-object['phones'][1] = new Phone(); $subForm = new sfForm(); $subForm-embedForm(0, new PhoneForm($p1 ); $subForm-embedForm(1, new PhoneForm($p2)); $this-embedForm('phones', $subForm); This works perfect. I can add a new User with 2 phones. The problem is that if the user doesn't provide information for second phone I should not insert a blank record (in fact I can't because of not null fields). I have read a lot of articles but I'm not able to find solution yet. I think that I have to use UpdateObject() method to remove unwanted relation, but if this is the better solution ? I use Doctrine :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: sfGuardSecurityUser::getProfile( ) problem
Hi Bernhard, Both are the same. I want to get the id of the new created Profile, can I? Thanks. - xj On Sun, Feb 15, 2009 at 9:43 PM, Bernhard Schussek bschus...@gmail.comwrote: Hi Xin, Are you using the sfDoctrineGuardPlugin? If yes, you just need to call $user-Profile (or whatever alias you chose in your schema). Bernhard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Managing symfony with no shell support
I think one of symfony Plugins do it for you.search it On Feb 14, 2:33 pm, Harinath Mallepally harinathre...@gmail.com wrote: Hi, I am wondering, if it is possible to manage the symfony commands using web based UI, like create project, app etc. Please do let me know if it is possible or if we can tweak and create such a facility. Thanks harinath --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Adding libraries to lib/vendor slows down symfony command line tasks dramatically
Hi mark i think its because of autoloading mechanism that each framework use. Zend framework has plenty of libraries and because of each framework use its separate autoloading mechanism it takes plenty of time. On Feb 15, 1:15 am, kazaam mstra...@gmail.com wrote: Hi, I'm relatively new to Symfony so this may be a newbie misunderstanding of how the framework works - please bear with me. I'm building a site using Symfony 1.2.4 on Ubuntu 8.10. My Lenovo T61 has Dual Core CPU and 4 GB Ram. Starting two days ago, I noticed that running the symfony command line tasks were taking a lot longer on my project than they did a few days ago. After some troubleshooting I realized that the culprit was adding libraries to the lib/vendor folder. I had sym- linked the ezComponents and Zend libraries into my project's lib/ vendor folder because I needed to use several components from each framework. They are not being loaded automatically in ProjectConfiguration.class.php though, so I'm not sure why they are affecting the execution time of commands. Before adding them to lib/vendor, the symfony cache:clear command took under 0.5 seconds to run: $ time symfony cache:clear real 0m0.426s user 0m0.360s sys 0m0.044s If I add Zend to lib/vendor, it jumps to 4.5 seconds: $ time symfony cache:clear real 0m4.430s user 0m4.328s sys 0m0.096s When I add ezcomponents, it goes to 26 seconds: $ time symfony cache:clear real 0m26.687s user 0m26.218s sys 0m0.460s If I remove the symlinks, the command runs in 0.5 seconds again. It's not just cache:clear - all other tasks take much longer than they used to also. Should adding libraries to the lib/vendor folder affect the performance of these commands this dramatically? Is there a different, recommended way to use 3rd party libraries that will not affect the performance of command line tasks? Thank you Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: sfDoctrineManagerPlugin
some of sf plugins has not good guidelines. the best way to learn them is exploring their contents. On Feb 15, 3:47 am, Mateus Nogueira mat...@imageweb.com.br wrote: Hello everyone. I 'd like to know how to use this new plugin, sfDoctrineManagerPlugin. I already try to search in the web and there isn't any tutorial or artlcle witch teache how to use. Any help will be very usefull. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Symfony in shared servers
:-(. again I need to look for another hosting service. On Sat, 2009-02-14 at 11:33 -0500, Pablo Godel wrote: There is no PDO extension loaded in your server. There should be a whole section about PDO. Pablo On Sat, Feb 14, 2009 at 11:31 AM, Harinath harinathre...@gmail.com wrote: Thanks, That is correct, i was talking about shared hosting. I understand the security issue. But I am not able to resolve class PDO not found error, while phpinfo http://sosoft.org/ocms/web/phpinfo.php shows pdo support. Thanks Harinath On Feb 14, 6:40 pm, Tom Boutell t...@punkave.com wrote: Define shared server. If you're taling about shared hosting, please read this first: http://trac.symfony-project.org/wiki/SharedHostingNotSecure Then this: http://trac.symfony-project.org/wiki/InstallingSymfonyOnSharedHostNoSsh Note that for Symfony 1.2 your host must offer PHP 5.2.4 or newer. -- Tom Boutell www.punkave.comwww.boutell.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Running symfony 1.2 in Shared Server - PDO issue
When phpinfo says that something was compiled shared, but there is no section later in phpinfo about the details, that means that it has not been enabled in the php.ini file for the server. A shared module won't be loaded unless the admin actually configures PHP to load it. Now here's the thing: PDO is a standard PHP 5.x feature and it is 2009 and there are literally thousands of competing hosting providers. It's a cutthroat business. Tell your host to enable PDO. If you do not get a satisfactory response, change hosts! I am puzzled when people put up with bad hosting. There is no reason to even consider doing so (yes, unless the host is your client's father in law etc, if you are stuck with such a political situation you have my sympathy). -- Tom Boutell www.punkave.com www.boutell.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Running symfony 1.2 in Shared Server - PDO issue
Hello, According to your phpinfo() it's has been compiled with pdo, but probably not enabled, see: http://ua2.php.net/manual/en/pdo.installation.php If you have access to ini files, you can try to enable it yourself, or request support from your provider in other case. Thanks. p.s. There should be whole PDO section explaining it's ability, similar to others libs, like zlib, bz2, calendar, etc. On Sat, 2009-02-14 at 08:22 -0800, Harinath wrote: I have similar problem. I am using a shared hosting service. Here is the php configuration information. it seems I have everything ready there. http://sosoft.org/ocms/web/phpinfo.php But http://sosoft.org/ocms/web/frontend_dev.php shows the error about class PDO not found Fatal error: Class 'PDO' not found in /home/sosoft/public_html/ocms/ lib/symfony/plugins/sfPropelPlugin/lib/vendor/propel/util/ PropelPDO.php on line 42 Please suggest me something can be done at application level. Thanks Harinath On Feb 1, 6:46 am, Frank He hexuf...@gmail.com wrote: unfortunately, what I did is not working there. See the phpinfo() herehttp://love.mediatube4.com/phpinfo.php Also the php.ini ishttp://love.mediatube4.com/php.ini when you usehttp://love.mediatube4.com/frontend_dev.phpyou will see the error there. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Running symfony 1.2 in Shared Server - PDO issue
If you are on shared hosting, there is no way you get access to the php.ini file, that's why you depend on your provider to set this stuff for you. As Tom said, in this day and age, it is absurd that a host does not provide PDO. Pablo On Sun, Feb 15, 2009 at 3:40 AM, Yevgeniy A. Viktorov w...@osmonitoring.com wrote: Hello, According to your phpinfo() it's has been compiled with pdo, but probably not enabled, see: http://ua2.php.net/manual/en/pdo.installation.php If you have access to ini files, you can try to enable it yourself, or request support from your provider in other case. Thanks. p.s. There should be whole PDO section explaining it's ability, similar to others libs, like zlib, bz2, calendar, etc. On Sat, 2009-02-14 at 08:22 -0800, Harinath wrote: I have similar problem. I am using a shared hosting service. Here is the php configuration information. it seems I have everything ready there. http://sosoft.org/ocms/web/phpinfo.php But http://sosoft.org/ocms/web/frontend_dev.php shows the error about class PDO not found Fatal error: Class 'PDO' not found in /home/sosoft/public_html/ocms/ lib/symfony/plugins/sfPropelPlugin/lib/vendor/propel/util/ PropelPDO.php on line 42 Please suggest me something can be done at application level. Thanks Harinath On Feb 1, 6:46 am, Frank He hexuf...@gmail.com wrote: unfortunately, what I did is not working there. See the phpinfo() herehttp://love.mediatube4.com/phpinfo.php Also the php.ini ishttp://love.mediatube4.com/php.ini when you usehttp://love.mediatube4.com/frontend_dev.phpyou will see the error there. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Running symfony 1.2 in Shared Server - PDO issue
On Sun, 2009-02-15 at 12:01 -0500, Pablo Godel wrote: If you are on shared hosting, there is no way you get access to the php.ini file, that's why you depend on your provider to set this stuff for you. Can't agree with you :) Usually It was not possible on shared with mod_php. But when Server API is CGI you can meet it very often or sometime at least. I rmbr two cases from own experience: 1. it was possible to place custom php.ini or php5.ini into your /cgi-bin directory; 2. it was possible to place php.ini or php5.ini into web root directory. Usually it's easiest way to contact to hosting provider for exact answer. Anyway I believe it's should work as php has been built with, still to figure out the way to enable such functionality ;) Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Managing symfony with no shell support
Here is some ideas: http://groups.google.com/group/symfony-users/browse_thread/thread/14ca8f739b9cf738/9428f18bf358e432 On Sat, 2009-02-14 at 17:03 +0530, Harinath Mallepally wrote: Hi, I am wondering, if it is possible to manage the symfony commands using web based UI, like create project, app etc. Please do let me know if it is possible or if we can tweak and create such a facility. Thanks harinath --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Problem in figuring out a Doctrine Query for Symfony?
Hi SeeVik, I've done only small change (MAX(p2.posted) instead of MAX(posted)) and your DQL works fine for me: $q = Doctrine_Query::create() - from( 'Topic t' ) - innerJoin( 't.Posts p' ) - where( 'p.posted = (SELECT MAX(p2.posted) from post p2 where p2.topic_id = p.topic_id)' ); var_dump($q-getSql()); string(231) SELECT t.id AS t__id, p.id AS p__id, p.topic_id AS p__topic_id, p.posted AS p__posted FROM topic t INNER JOIN post p ON t.id = p.topic_id WHERE p.posted = (SELECT MAX(p2.posted) AS p2__0 FROM post p2 WHERE p2.topic_id = p.topic_id) I have symfony 1.2.5-DEV from SVN, rev 15495. cheers, Tomek On Feb 14, 11:30 pm, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello Tomek. Yes I will try that query. In the mean time I have figured out something similar. The SQL query... SELECT * FROM topic t INNER JOIN post p ON ( t.id = p.topic_id ) WHERE p.posted = ( SELECT MAX(posted) FROM post WHERE topic_id = p.topic_id ); I have a problem figuring out the DQL for it though. I tried this one... $q = Doctrine_Query::create() - from( 'Topic t' ) - innerJoin( 't.Posts p' ) - where( 'p.posted = (SELECT MAX(posted) from post p2 where p2.topic_id = p.topic_id)' ); But what this does is. it genrates a sql query looking like this SELECT * FROM topic t INNER JOIN post p ON ( t.id = p.topic_id ) WHERE p.posted = ( SELECT MAX(posted FROM post WHERE topic_id = p.topic_id )); Notice that paranthesis after MAX has been placed at the end. That gives an SQL syntax error. Is this a problem in Doctrine? On Feb 15, 12:34 am, Tomek nexor1...@gmail.com wrote: Hi Vikram, One way to do it would be with the subquery. I'm assuming your schema is: Topic: columns: Post: columns: topic_id: integer posted: timestamp relations: Topic: foreignAlias: Posts In SQL the query you are looking for looks like that: SELECT * FROM topic t INNER JOIN post p ON (t.id=p.topic_id) WHERE p.id=(SELECT id FROM post WHERE topic_id=p.topic_id ORDER BY posted DESC LIMIT 1 ); In DQL: $q = Doctrine_Query::create()-from('Topic t')-innerJoin('t.Posts p') -where('p.id = (SELECT p2.id from post p2 where p2.topic_id=p.topic_id order by p2.posted desc limit 1)'); I hope that helps, Tomek On Feb 13, 11:06 am, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello all I am using Symfony with Doctrine plugin. I am making a simple bulletin board in my application. I want to find out the last post in every topic and display the time in front of topic. In Symfony, in the controller for the screen, I do this... $list_topics = Doctrine::getTable( Topics )-getLastPost(); In the model layer, in PostsTable.class.php, I have this public function getLastPost() { $q = $this-createQuery( 'a' ) - innerJoin( 'a.Topics t' ) - groupBy( 'a.topic_id' ) - having( 'a.posts_id = ?', ' Query to find out the posts having maximum time for a particular topic ' ); return $q-execute(); } Can somebody help me out with this? Thanks and Regards Vikram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Running symfony 1.2 in Shared Server - PDO issue
Running with PHP as CGI is not a valid option in my opinion. Pablo On Sun, Feb 15, 2009 at 1:29 PM, Yevgeniy A. Viktorov w...@osmonitoring.com wrote: On Sun, 2009-02-15 at 12:01 -0500, Pablo Godel wrote: If you are on shared hosting, there is no way you get access to the php.ini file, that's why you depend on your provider to set this stuff for you. Can't agree with you :) Usually It was not possible on shared with mod_php. But when Server API is CGI you can meet it very often or sometime at least. I rmbr two cases from own experience: 1. it was possible to place custom php.ini or php5.ini into your /cgi-bin directory; 2. it was possible to place php.ini or php5.ini into web root directory. Usually it's easiest way to contact to hosting provider for exact answer. Anyway I believe it's should work as php has been built with, still to figure out the way to enable such functionality ;) Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Running symfony 1.2 in Shared Server - PDO issue
On Sun, 2009-02-15 at 15:20 -0500, Pablo Godel wrote: Running with PHP as CGI is not a valid option in my opinion. Harinath's hosting have it as CGI. http://sosoft.org/ocms/web/phpinfo.php And that's only reason why I posted about possible ability to manage php.ini on user side. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] N - M relationships and symfony forms (Propel)
Hello, Does symfony handle N - M relationships in any way? For example: Category: tableName: pp_category columns: id: name: { type: varchar(255), required: true } Article: tableName: pp_article columns: id: title: { type: varchar(255), required: true } ArticleCategoryRelation: tableName: pp_article_category_relation columns: id: article_id: { type: integer, required: true } category_id: { type: integer, required: true } foreignKeys: - foreignTable: pp_article onDelete: cascade references: - { local: article_id, foreign: id } - foreignTable: pp_category onDelete: cascade references: - { local: category_id, foreign: id } I inspected the generated forms for this example and they don't seem to include any many-to-many funcionality. For example, there's no widget to select categories an article belongs to. The same applies to filter forms. Am I missing something, or is this functionality simply not implemented in symfony? Regards, Rytis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] using i18n outside template
When i want a custom message for like a form error: array( 'min_length' = __('Your username cannot contain less then 6 characters.'), 'max_length' = __('Your username cannot contain more than 32 characters.') ) The __() ofcourse doesn't work... How can i insert an english but make it translatable? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] sfPaypalDirectPlugin
Anyone has used this plugin recently? I'm just wondering if it is still working -- Blue Horn Ltd - System Development http://bluehorn.co.nz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Multiple File Uploads
Hi, I am generating a form that has 5 file uploads and a few fields. When submitted (and valid), it should take the files, resize them and save them in a folder. This was working fine with one file, but I cannot get it to work with 5 ... even $_FILES is empty. class MultipleImageForm extends sfForm { public function configure() { $this-setWidgets(array( 'caption' = new sfWidgetFormTextarea(), )); $this-widgetSchema['caption']-setLabel('Caption'); $this-setValidators(array( 'caption' = new sfValidatorString(array('max_length' = 2147483647, 'required' = false)), )); $files = new sfForm(); for ($i=0; $i5; $i++) { $files-widgetSchema['file_' . $i] = new sfWidgetFormInputFile (array('label' = 'Bild ' . ($i + 1)), array('name' = 'upfile_' . $i)); } $this-embedForm('files', $files); $this-widgetSchema-setNameFormat('images[%s]'); } } In my action, all I do is echo out the $_FILES and the $request- getFiles($this-form-getName()) but both are null. I would like to put the resize functionality into the MultipleImageForm's bind method but again, $taintedFiles is empty. Any recommendations? juro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Multiple File Uploads
As far as i know, you should use: file[] in your html. This creates an array in $_FILES. On Feb 15, 10:55 pm, juro fo...@juro.at wrote: Hi, I am generating a form that has 5 file uploads and a few fields. When submitted (and valid), it should take the files, resize them and save them in a folder. This was working fine with one file, but I cannot get it to work with 5 ... even $_FILES is empty. class MultipleImageForm extends sfForm { public function configure() { $this-setWidgets(array( 'caption' = new sfWidgetFormTextarea(), )); $this-widgetSchema['caption']-setLabel('Caption'); $this-setValidators(array( 'caption' = new sfValidatorString(array('max_length' = 2147483647, 'required' = false)), )); $files = new sfForm(); for ($i=0; $i5; $i++) { $files-widgetSchema['file_' . $i] = new sfWidgetFormInputFile (array('label' = 'Bild ' . ($i + 1)), array('name' = 'upfile_' . $i)); } $this-embedForm('files', $files); $this-widgetSchema-setNameFormat('images[%s]'); } } In my action, all I do is echo out the $_FILES and the $request-getFiles($this-form-getName()) but both are null. I would like to put the resize functionality into the MultipleImageForm's bind method but again, $taintedFiles is empty. Any recommendations? juro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] CSRF tokens and attacks
Hi, I started looking at the new code in symfony 1.2 and I have a question. If I understand the way CSRF token works, it is generated as a hidden field in a form and if I use the link_to helpers, it is appended as a parameter in my links. Am I right? Now, what prevents a hacker from writing a javascript to retrieve a page from a logged in user on my site, retrieve the CSRF token and make another javascript request using the token on my forms?? Thanks in advance for any replies Cheers -Hassen Ben Tanfous --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: CSRF tokens and attacks
Now, what prevents a hacker from writing a javascript to retrieve a page from a logged in user on my site, retrieve the CSRF token and make another javascript request using the token on my forms?? Tell me how you would do this. By doing that you'll discover the difficulties yourself. Regards, Rytis On Mon, Feb 16, 2009 at 12:46 AM, Hassen Ben Tanfous hassenbentanf...@gmail.com wrote: Hi, I started looking at the new code in symfony 1.2 and I have a question. If I understand the way CSRF token works, it is generated as a hidden field in a form and if I use the link_to helpers, it is appended as a parameter in my links. Am I right? Now, what prevents a hacker from writing a javascript to retrieve a page from a logged in user on my site, retrieve the CSRF token and make another javascript request using the token on my forms?? Thanks in advance for any replies Cheers -Hassen Ben Tanfous --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Using hyphens instead of forward slashes in routing?
I am wondering whether it is possible to use hyphens instead of or in combination with forward slashes in symfony's routing. My question is for both symfony 1.0 and 1.2 (I want to implement the feature in some older web sites I'm managing as well as possibly use it for one of my more recent projects). For example, something like this: www.site.com/category-3/article-10 with routing: route_for_category_article: url: /offers/category-:category_id/article-:article_id param: { module: show, action: article } (this here doesn't work of course) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Problem in figuring out a Doctrine Query for Symfony?
Hi Tomek, thanks a lot. This works fine. :) Actually this is what I had done which was going wrong. $q = Doctrine_Query::create() - from( 'Topic t' ) - innerJoin( 't.Posts p WITH p.posted = (SELECT MAX(p2.posted) from post p2 where p2.topic_id = p.topic_id)' ); This generated the query like... SELECT * FROM topic t INNER JOIN post p ON ( t.id = p.topic_id AND p.posted = ( SELECT MAX(posted FROM post WHERE topic_id = p.topic_id )); With parenthesis being placed at the end. This was what I had in mind. Anyway, the query that you suggested works fine as well. Thanks again. :) Thanks and Regards Vikram On Feb 16, 4:32 am, Tomek nexor1...@gmail.com wrote: Hi SeeVik, I've done only small change (MAX(p2.posted) instead of MAX(posted)) and your DQL works fine for me: $q = Doctrine_Query::create() - from( 'Topic t' ) - innerJoin( 't.Posts p' ) - where( 'p.posted = (SELECT MAX(p2.posted) from post p2 where p2.topic_id = p.topic_id)' ); var_dump($q-getSql()); string(231) SELECT t.id AS t__id, p.id AS p__id, p.topic_id AS p__topic_id, p.posted AS p__posted FROM topic t INNER JOIN post p ON t.id = p.topic_id WHERE p.posted = (SELECT MAX(p2.posted) AS p2__0 FROM post p2 WHERE p2.topic_id = p.topic_id) I have symfony 1.2.5-DEV from SVN, rev 15495. cheers, Tomek On Feb 14, 11:30 pm, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello Tomek. Yes I will try that query. In the mean time I have figured out something similar. The SQL query... SELECT * FROM topic t INNER JOIN post p ON ( t.id = p.topic_id ) WHERE p.posted = ( SELECT MAX(posted) FROM post WHERE topic_id = p.topic_id ); I have a problem figuring out the DQL for it though. I tried this one... $q = Doctrine_Query::create() - from( 'Topic t' ) - innerJoin( 't.Posts p' ) - where( 'p.posted = (SELECT MAX(posted) from post p2 where p2.topic_id = p.topic_id)' ); But what this does is. it genrates a sql query looking like this SELECT * FROM topic t INNER JOIN post p ON ( t.id = p.topic_id ) WHERE p.posted = ( SELECT MAX(posted FROM post WHERE topic_id = p.topic_id )); Notice that paranthesis after MAX has been placed at the end. That gives an SQL syntax error. Is this a problem in Doctrine? On Feb 15, 12:34 am, Tomek nexor1...@gmail.com wrote: Hi Vikram, One way to do it would be with the subquery. I'm assuming your schema is: Topic: columns: Post: columns: topic_id: integer posted: timestamp relations: Topic: foreignAlias: Posts In SQL the query you are looking for looks like that: SELECT * FROM topic t INNER JOIN post p ON (t.id=p.topic_id) WHERE p.id=(SELECT id FROM post WHERE topic_id=p.topic_id ORDER BY posted DESC LIMIT 1 ); In DQL: $q = Doctrine_Query::create()-from('Topic t')-innerJoin('t.Posts p') -where('p.id = (SELECT p2.id from post p2 where p2.topic_id=p.topic_id order by p2.posted desc limit 1)'); I hope that helps, Tomek On Feb 13, 11:06 am, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello all I am using Symfony with Doctrine plugin. I am making a simple bulletin board in my application. I want to find out the last post in every topic and display the time in front of topic. In Symfony, in the controller for the screen, I do this... $list_topics = Doctrine::getTable( Topics )-getLastPost(); In the model layer, in PostsTable.class.php, I have this public function getLastPost() { $q = $this-createQuery( 'a' ) - innerJoin( 'a.Topics t' ) - groupBy( 'a.topic_id' ) - having( 'a.posts_id = ?', ' Query to find out the posts having maximum time for a particular topic ' ); return $q-execute(); } Can somebody help me out with this? Thanks and Regards Vikram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Why Doctrine Admin Generator use sfWidgetFormDoctrineSelect on foreign key fields?
I did so! :) I hope to have done everything correctly. http://trac.symfony-project.org/ticket/5896 On 14 Feb, 22:33, Jonathan Wage jonw...@gmail.com wrote: Can you create a ticket for the issue you are having? Thanks, Jon On Sat, Feb 14, 2009 at 12:42 PM, Daniele danieled...@gmail.com wrote: Hi Julien, I am not talking about N..N relations, but 1..N. As I said above, Propel uses sfWidgetFormPropelChoice on 1..N relations, but Doctrine not. sfWidgetFormORMSelect class do not support expanded option! This is exactly the problem that I have met. On 13 Feb, 19:13, jukea jkea...@gmail.com wrote: Yes, that's what I was talking about. This fix applies to N to N relations. 1 .. N relations still have a select drop down menu, and I can't see how this is not appropriate .. ? Would you prefer radio buttons ? then you could use the 'expanded'=true option Julien On Feb 13, 12:55 pm, Daniele danieled...@gmail.com wrote: I am not very expert on Trac or SVN, but I do not find anything about this. I found this that is only similar but not is the same: http://trac.symfony-project.org/ticket/5784 On Feb 12, 11:17 pm, jukea jkea...@gmail.com wrote: Hi, I think this has been corrected. Look for it in trac, or try 1.2.5dev (trunk) Julien On Feb 12, 4:35 pm, Daniele danieled...@gmail.com wrote: Hi, someone can help me to understand why my Doctrine admin generator (sf 1.2.4) creates a sfWidgetFormDoctrineSelect instead of sfWidgetFormDoctrineChoice on foreign key fields for make the BaseXXXForm classes? Instead the validators work as expected, and sfValidatorDoctrineChoice is used on foreign key fields. I am moving from Propel to Doctrine and I have noticed this strangeness, indeed Propel admin generator uses sfWidgetFormPropelChoice. Am I doing something wrong or is a normal behaviour? thanks, Daniele -- Jonathan H. Wage Open Source Software Developer Evangelisthttp://www.jwage.comhttp://www.doctrine-project.orghttp://www.symfony-project.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Why Doctrine Admin Generator use sfWidgetFormDoctrineSelect on foreign key fields?
just a comment... : I think you should assign the ticket to jwage, since he manages sfDoctrinePlugin Julien On Feb 15, 7:34 pm, Daniele danieled...@gmail.com wrote: I did so! :) I hope to have done everything correctly.http://trac.symfony-project.org/ticket/5896 On 14 Feb, 22:33, Jonathan Wage jonw...@gmail.com wrote: Can you create a ticket for the issue you are having? Thanks, Jon On Sat, Feb 14, 2009 at 12:42 PM, Daniele danieled...@gmail.com wrote: Hi Julien, I am not talking about N..N relations, but 1..N. As I said above, Propel uses sfWidgetFormPropelChoice on 1..N relations, but Doctrine not. sfWidgetFormORMSelect class do not support expanded option! This is exactly the problem that I have met. On 13 Feb, 19:13, jukea jkea...@gmail.com wrote: Yes, that's what I was talking about. This fix applies to N to N relations. 1 .. N relations still have a select drop down menu, and I can't see how this is not appropriate .. ? Would you prefer radio buttons ? then you could use the 'expanded'=true option Julien On Feb 13, 12:55 pm, Daniele danieled...@gmail.com wrote: I am not very expert on Trac or SVN, but I do not find anything about this. I found this that is only similar but not is the same: http://trac.symfony-project.org/ticket/5784 On Feb 12, 11:17 pm, jukea jkea...@gmail.com wrote: Hi, I think this has been corrected. Look for it in trac, or try 1.2.5dev (trunk) Julien On Feb 12, 4:35 pm, Daniele danieled...@gmail.com wrote: Hi, someone can help me to understand why my Doctrine admin generator (sf 1.2.4) creates a sfWidgetFormDoctrineSelect instead of sfWidgetFormDoctrineChoice on foreign key fields for make the BaseXXXForm classes? Instead the validators work as expected, and sfValidatorDoctrineChoice is used on foreign key fields. I am moving from Propel to Doctrine and I have noticed this strangeness, indeed Propel admin generator uses sfWidgetFormPropelChoice. Am I doing something wrong or is a normal behaviour? thanks, Daniele -- Jonathan H. Wage Open Source Software Developer Evangelisthttp://www.jwage.comhttp://www.doctrine-project.orghttp://www.symfony... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] can anyone help to tell me how to change session time?
Without using php.ini session time out, how can we change this value through symfony? How can we set the session timeout value longer? Are there any restriction for this configuration? I think no matter how long we set it, it will alwasy be shorter than that required in php.ini, is that right? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: sfGuardSecurityUser::getProfile( ) problem
Another question, is there any way to make 2 same plugins work in one app? - xj On Sun, Feb 15, 2009 at 10:46 PM, Xin Jia xinjia...@gmail.com wrote: Hi Bernhard, Both are the same. I want to get the id of the new created Profile, can I? Thanks. - xj On Sun, Feb 15, 2009 at 9:43 PM, Bernhard Schussek bschus...@gmail.comwrote: Hi Xin, Are you using the sfDoctrineGuardPlugin? If yes, you just need to call $user-Profile (or whatever alias you chose in your schema). Bernhard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] debug error: Fatal error: Allowed memory size of 134217728 bytes exhausted
I am getting an intermittent error. I'm having trouble debugging it, because it is intermittent. Sometimes it manifests as a fatal error due to the maximum amount of memory being overrun. Other times it manifests as forms not filling in with the values they should have, even when editing an old entry. And this is with code that, for the most part, is unmodified auto-generated Propel crud templates and actions.class.php. Symfony: 1.1.4 PHP: 5.2 The server is an old Sun workstation now running Ubuntu Linux. To take one particular case, I generated a module with this command: symfony propel:generate-crud frontend writeup Writeup I generated 27 modules in this way (I've been hired to rebuild an old site as a Symfony site.) If I go to the list view: frontend_dev.php/writeup/index then all is good. But if I try to visit any one particular item with a url such as this: frontend_dev.php/writeup/edit/id/8 The form is empty. I don't know why. If I try to debug by putting this in editSuccess.php: ?php print_r($form) ? Then I get a Fatal error from a memory over use error. I face the same problem with the alumni module: In my actions class, I have this: public function executeEdit($request) { $this-form = new AlumniForm(AlumniPeer::retrieveByPk($request- getParameter('id'))); } In editSuccess, I have this: ?php $alumni = $form-getObject() ? h1?php echo $alumni-isNew() ? 'New' : 'Edit' ? Alumni/h1 form action=?php echo url_for('alumni/update'.(!$alumni-isNew() ? '?id='.$alumni-getId() : '')) ? method=post ?php $form- isMultipart() and print 'enctype=multipart/form-data ' ? table tfoot tr td colspan=2 nbsp;a href=?php echo url_for('alumni/index') ? Cancel/a ?php if (!$alumni-isNew()): ? nbsp;?php echo link_to('Delete', 'alumni/delete?id='. $alumni-getId(), array('post' = true, 'confirm' = 'Are you sure?')) ? ?php endif; ? input type=submit value=Save / /td /tr /tfoot tbody ?php echo $form-renderGlobalErrors() ? tr th?php echo $form['name']-renderLabel() ?/th td ?php echo $form['name']-renderError() ? ?php echo $form['name'] ? /td /tr tr th?php echo $form['description']-renderLabel() ?/th td ?php echo $form['description']-renderError() ? ?php echo $form['description'] ? /td /tr tr th?php echo $form['new_location_id']-renderLabel() ?/th td ?php echo $form['new_location_id']-renderError() ? ?php echo $form['new_location_id'] ? ?php echo $form['id'] ? /td /tr /tbody /table /form Again, this is default, auto-generated code. It either doesn't work or I get a Fatal error. I added primary keys late in this process. This particular database was built by another programmer, years ago. That programmer did not give the database table a primary key. I added that. I just had the thought that maybe the primary key hadn't been captured in the auto- generated schema, but apparently it was: alumni: _attributes: { idMethod: native } id: { type: INTEGER, required: true, autoIncrement: true, primaryKey: true } Name: { type: VARCHAR, size: '75' } Description: { type: VARCHAR, size: '255' } TimePeriod: { type: VARCHAR, size: '25' } HighSchool: { type: VARCHAR, size: '100' } HighSchoolDesc: { type: LONGVARCHAR } College1: { type: VARCHAR, size: '100' } College1Desc: { type: LONGVARCHAR } College2: { type: VARCHAR, size: '100' } College2Desc: { type: LONGVARCHAR } Image: { type: VARCHAR, size: '50' } HasBio: { type: CHAR, size: '1', required: true, default: F } IsAlumniProject: { type: CHAR, size: '1', required: true, default: F } IsCommunityService: { type: CHAR, size: '1', required: true, default: F } IsHigh5Buddy: { type: CHAR, size: '1', required: true, default: F } IsRecCoach: { type: CHAR, size: '1', required: true, default: F } IsContributor: { type: CHAR, size: '1', required: true, default: F } IsSponsor: { type: CHAR, size: '1', required: true, default: F } new_player_id: { type: INTEGER, required: true, default: '' } new_location_id: { type: INTEGER, required: true, default: '' } As an experiment, I added this to the top of the editSuccess.php template: ?php $something = $form['name']; echo here is something: ; print_r($something); ? Then I suddenly started getting this error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 50196481 bytes) in /home/lawrence/public_html/bocahoops/ apps/frontend/templates/layout.php on line 243 When I open up layout.php and look at line 243, I see it is simply this: ?php echo $sf_content ? Can anyone explain to me why that line would cause the software to try to allocate 50 megs of RAM? So, for the individual edit forms, this is the kind of SQL being
[symfony-users] Re: Production server routing issues
I thought I would just add for this problem we are experiencing, here are the httpd.conf and the .htaccess entries. If someone can help out with the right values for these and perhaps point out where I might going wrong that would be a great help :) httpd.conf: VirtualHost *:80 ServerAdmin supp...@synaq.com DocumentRoot/usr/local/projectdirectory/web DirectoryIndex index.php ServerName www.domain.co.za ErrorLoglogs/domain-error_log CustomLog logs/domain-access_log common /VirtualHost (Of course I have replace the actual domain values with placeholders, sorry corporate secrets ;) ) .htaccess: Options +FollowSymLinks +ExecCGI IfModule mod_rewrite.c RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work #RewriteBase / # we skip all files with .something RewriteCond %{REQUEST_URI} \..+$ RewriteCond %{REQUEST_URI} !\.html$ RewriteRule .* - [L] # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web controller RewriteRule ^(.*)$ index.php [QSA,L] /IfModule I have tried the .htaccess with RewriteBase uncommented but it seems to make no difference. Thanks again guys. All help will be appreciated. And if we get this working we will eventually have a demo version of this application running that I will happilly post onto the list for people to go view another great symfony app running in an enterprise environment :D Regards Gareth McCumskey On 2/14/09, Gareth McCumskey gmccums...@gmail.com wrote: It is not only the AJAX actions themselves. If an action tries to use a redirect directly it also throws a 404 error. Also adding on index.php to the url such as http://www.domain.com/index.php/module/action all is fine, the ajax on that page does not load though because of the remote_function call probably using some redirect. And I have called the ajax actions directly as well and they then work fine. Gareth On Sat, Feb 14, 2009 at 11:36 AM, Bernhard Schussek bschus...@gmail.comwrote: Hi Gareth, Did you try accessing the AJAX actions directly? Bernhard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: debug error: Fatal error: Allowed memory size of 134217728 bytes exhausted
Actually, I find now that there is one database table, the alumni module, where the problem is consistent. It will not fill in forms with their values. If I go to an URL like this: frontend_dev.php/newcoach/edit/id/194 I get a form with no values filled in. This is what I have in actions.class.php: public function executeEdit($request) { $this-form = new AlumniForm(AlumniPeer::retrieveByPk($request- getParameter('id'))); } The template is the auto-generated editSuccess.php The debug tool bar shows me these queries: prepareStatement(): SELECT alumni.ID, alumni.NAME, alumni.DESCRIPTION, alumni.TIMEPERIOD, alumni.HIGHSCHOOL, alumni.HIGHSCHOOLDESC, alumni.COLLEGE1, alumni.COLLEGE1DESC, alumni.COLLEGE2, alumni.COLLEGE2DESC, alumni.IMAGE, alumni.HASBIO, alumni.ISALUMNIPROJECT, alumni.ISCOMMUNITYSERVICE, alumni.ISHIGH5BUDDY, alumni.ISRECCOACH, alumni.ISCONTRIBUTOR, alumni.ISSPONSOR, alumni.NEW_PLAYER_ID, alumni.NEW_LOCATION_ID FROM alumni WHERE alumni.ID=? executeQuery(): [1.54 ms] SELECT alumni.ID, alumni.NAME, alumni.DESCRIPTION, alumni.TIMEPERIOD, alumni.HIGHSCHOOL, alumni.HIGHSCHOOLDESC, alumni.COLLEGE1, alumni.COLLEGE1DESC, alumni.COLLEGE2, alumni.COLLEGE2DESC, alumni.IMAGE, alumni.HASBIO, alumni.ISALUMNIPROJECT, alumni.ISCOMMUNITYSERVICE, alumni.ISHIGH5BUDDY, alumni.ISRECCOACH, alumni.ISCONTRIBUTOR, alumni.ISSPONSOR, alumni.NEW_PLAYER_ID, alumni.NEW_LOCATION_ID FROM alumni WHERE alumni.ID=225 When I run this second query in phpMyAdmin, it correctly gets the values for this entry. On Feb 16, 1:31 am, Lawrence Krubner lkrub...@geocities.com wrote: I am getting an intermittent error. I'm having trouble debugging it, because it is intermittent. Sometimes it manifests as a fatal error due to the maximum amount of memory being overrun. Other times it manifests as forms not filling in with the values they should have, even when editing an old entry. And this is with code that, for the most part, is unmodified auto-generated Propel crud templates and actions.class.php. Symfony: 1.1.4 PHP: 5.2 The server is an old Sun workstation now running Ubuntu Linux. To take one particular case, I generated a module with this command: symfony propel:generate-crud frontend writeup Writeup I generated 27 modules in this way (I've been hired to rebuild an old site as a Symfony site.) If I go to the list view: frontend_dev.php/writeup/index then all is good. But if I try to visit any one particular item with a url such as this: frontend_dev.php/writeup/edit/id/8 The form is empty. I don't know why. If I try to debug by putting this in editSuccess.php: ?php print_r($form) ? Then I get a Fatal error from a memory over use error. I face the same problem with the alumni module: In my actions class, I have this: public function executeEdit($request) { $this-form = new AlumniForm(AlumniPeer::retrieveByPk($request-getParameter('id'))); } In editSuccess, I have this: ?php $alumni = $form-getObject() ? h1?php echo $alumni-isNew() ? 'New' : 'Edit' ? Alumni/h1 form action=?php echo url_for('alumni/update'.(!$alumni-isNew() ? '?id='.$alumni-getId() : '')) ? method=post ?php $form-isMultipart() and print 'enctype=multipart/form-data ' ? table tfoot tr td colspan=2 nbsp;a href=?php echo url_for('alumni/index') ?Cancel/a ?php if (!$alumni-isNew()): ? nbsp;?php echo link_to('Delete', 'alumni/delete?id='. $alumni-getId(), array('post' = true, 'confirm' = 'Are you sure?')) ? ?php endif; ? input type=submit value=Save / /td /tr /tfoot tbody ?php echo $form-renderGlobalErrors() ? tr th?php echo $form['name']-renderLabel() ?/th td ?php echo $form['name']-renderError() ? ?php echo $form['name'] ? /td /tr tr th?php echo $form['description']-renderLabel() ?/th td ?php echo $form['description']-renderError() ? ?php echo $form['description'] ? /td /tr tr th?php echo $form['new_location_id']-renderLabel() ?/th td ?php echo $form['new_location_id']-renderError() ? ?php echo $form['new_location_id'] ? ?php echo $form['id'] ? /td /tr /tbody /table /form Again, this is default, auto-generated code. It either doesn't work or I get a Fatal error. I added primary keys late in this process. This particular database was built by another programmer, years ago. That programmer did not give the database table a primary key. I added that. I just had the thought that maybe the primary key hadn't been captured in the auto- generated schema, but apparently it was: alumni: _attributes: { idMethod: native } id: { type: INTEGER, required: true, autoIncrement: true, primaryKey: true } Name: { type: VARCHAR, size: '75' }
[symfony-users] Re: Production server routing issues
This is the error I get int he div that is supposed to load the ajax div. I also get a similar error message when I use a redirect to try and reload the entire page. Not Found The requested URL /users/list was not found on this server. On 2/16/09, Gareth McCumskey gmccums...@gmail.com wrote: I thought I would just add for this problem we are experiencing, here are the httpd.conf and the .htaccess entries. If someone can help out with the right values for these and perhaps point out where I might going wrong that would be a great help :) httpd.conf: VirtualHost *:80 ServerAdmin supp...@synaq.com DocumentRoot/usr/local/projectdirectory/web DirectoryIndex index.php ServerName www.domain.co.za ErrorLoglogs/domain-error_log CustomLog logs/domain-access_log common /VirtualHost (Of course I have replace the actual domain values with placeholders, sorry corporate secrets ;) ) .htaccess: Options +FollowSymLinks +ExecCGI IfModule mod_rewrite.c RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work #RewriteBase / # we skip all files with .something RewriteCond %{REQUEST_URI} \..+$ RewriteCond %{REQUEST_URI} !\.html$ RewriteRule .* - [L] # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web controller RewriteRule ^(.*)$ index.php [QSA,L] /IfModule I have tried the .htaccess with RewriteBase uncommented but it seems to make no difference. Thanks again guys. All help will be appreciated. And if we get this working we will eventually have a demo version of this application running that I will happilly post onto the list for people to go view another great symfony app running in an enterprise environment :D Regards Gareth McCumskey On 2/14/09, Gareth McCumskey gmccums...@gmail.com wrote: It is not only the AJAX actions themselves. If an action tries to use a redirect directly it also throws a 404 error. Also adding on index.php to the url such as http://www.domain.com/index.php/module/action all is fine, the ajax on that page does not load though because of the remote_function call probably using some redirect. And I have called the ajax actions directly as well and they then work fine. Gareth On Sat, Feb 14, 2009 at 11:36 AM, Bernhard Schussek bschus...@gmail.comwrote: Hi Gareth, Did you try accessing the AJAX actions directly? Bernhard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Production server routing issues
This seems to be some kind of server setting or something I have missed. More info: - If I enter the URL www.domain.com/module/action into my browser I get not found errors. - If I enter www.domain.com/index.php/module/action then the page loads but the dynamically loaded ajax div that is supposed to load as part of it does not as it tries to load another action in that space, probably using the url www.domain.com/module/action with no index.php. - We used to have our login form action use a redirect after successful login and I tehn altered it to use a forward instead and it now loads the default module/action but still with that ajax div showing page not found as per my previous mail. Somewhere along the way something is not setting the routing to use index.php as a part of the url and I cannot figure out where. Please help anyone :( On 2/16/09, Gareth McCumskey gmccums...@gmail.com wrote: This is the error I get int he div that is supposed to load the ajax div. I also get a similar error message when I use a redirect to try and reload the entire page. Not Found The requested URL /users/list was not found on this server. On 2/16/09, Gareth McCumskey gmccums...@gmail.com wrote: I thought I would just add for this problem we are experiencing, here are the httpd.conf and the .htaccess entries. If someone can help out with the right values for these and perhaps point out where I might going wrong that would be a great help :) httpd.conf: VirtualHost *:80 ServerAdmin supp...@synaq.com DocumentRoot/usr/local/projectdirectory/web DirectoryIndex index.php ServerName www.domain.co.za ErrorLoglogs/domain-error_log CustomLog logs/domain-access_log common /VirtualHost (Of course I have replace the actual domain values with placeholders, sorry corporate secrets ;) ) .htaccess: Options +FollowSymLinks +ExecCGI IfModule mod_rewrite.c RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work #RewriteBase / # we skip all files with .something RewriteCond %{REQUEST_URI} \..+$ RewriteCond %{REQUEST_URI} !\.html$ RewriteRule .* - [L] # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web controller RewriteRule ^(.*)$ index.php [QSA,L] /IfModule I have tried the .htaccess with RewriteBase uncommented but it seems to make no difference. Thanks again guys. All help will be appreciated. And if we get this working we will eventually have a demo version of this application running that I will happilly post onto the list for people to go view another great symfony app running in an enterprise environment :D Regards Gareth McCumskey On 2/14/09, Gareth McCumskey gmccums...@gmail.com wrote: It is not only the AJAX actions themselves. If an action tries to use a redirect directly it also throws a 404 error. Also adding on index.php to the url such as http://www.domain.com/index.php/module/action all is fine, the ajax on that page does not load though because of the remote_function call probably using some redirect. And I have called the ajax actions directly as well and they then work fine. Gareth On Sat, Feb 14, 2009 at 11:36 AM, Bernhard Schussek bschus...@gmail.com wrote: Hi Gareth, Did you try accessing the AJAX actions directly? Bernhard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---