[symfony-users] [Symfony2]Problem with custom listeners
Hi all, I've got a problem with custom listener after upgrading to PR6. Here my config : services: kernel.listener.page_listener: class: Bundle\PageBundle\Listener\PageListener tags: - { name: kernel.listener } And i have this error : InvalidArgumentException: Service kernel.listener.page_listener must define the event attribute on kernel.listener tags. in /Users/ yohan/Sites/symfony2/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/ DependencyInjection/Compiler/RegisterKernelListenersPass.php on line 31 But the documentation don't speak about an event attribute... Have you an idea ? Thanks in advance, Yohan. -- 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 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] [Symfony2]Autoloading problem
Hi all, I'm trying to use the Doctrine2 NestedSet extension but I have a problem with autoloading. I have put the doctrine2-nestedset directory into my vendors and my autoload.php looks like this : $loader-registerNamespaces(array( ... 'DoctrineExtensions' = $vendorDir.'/doctrine2-nestedset/ lib', )); here is my Entity : ?php namespace Bundle\MenuBundle\Entity; use DoctrineExtensions\NestedSet\MultipleRootNode; class MenuNode implements MultipleRootNode { But I have this error : Fatal error: Interface 'DoctrineExtensions \NestedSet\MultipleRootNode' not found in .../src/Bundle/MenuBundle/ Entity/MenuNode.php on line 8 Someone has an idea ? Thanks, Yohan. -- 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 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 1.2 and propel behaviors
No I don't... I don't understand the problem... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] Re: Symfony 1.2 and propel behaviors
Kris Wallsmith wrote: As of symfony 1.2 you have to explicitly enable plugins in your configuration class: $this-enablePlugins(array('sfPropelPlugin', 'sfPropelActAsPolymorphicBehaviorPlugin')); If the plugin that houses a behavior is not enabled, that behavior will not be registered. Kris On Oct 20, 1:44 pm, Melchior Anarchion [EMAIL PROTECTED] wrote: have you try to give an application name in parameter ? behaviors are loaded only in application, and task does not configure application if you don't give --application=myapp in param Yohan 'rouKs' G. a écrit : Hello, I've got a problem with the symfony 1.1 to 1.2 migration. The symfony propel:build-forms doesn't work with behaviors : Propel behavior behavior-name is not registered Is that a bug ? I precise that the build-model task works perfectly but the build-filter doesn't. I don't think that the problem comes from propel, I used propel 1.3 with sf1.1 Anyone solution ? Thanks for the reply but my plugins are enabled (I read the upgrade file) and the build-forms task takes no application... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] Symfony 1.2 and propel behaviors
Hello, I've got a problem with the symfony 1.1 to 1.2 migration. The symfony propel:build-forms doesn't work with behaviors : Propel behavior behavior-name is not registered Is that a bug ? I precise that the build-model task works perfectly but the build-filter doesn't. I don't think that the problem comes from propel, I used propel 1.3 with sf1.1 Anyone solution ? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] Problem with date validation (1.1)
I use the sfValidatorDate in my project and I need to validate a french date (d-m-Y). My problem is that the sfValidatorDate take a regex as date_format parameter... What kind of regex should I give to this validator ? Thanks, Yohan --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] tests and mixins
Hi, I've got a problem with functional testings and models with behaviors. When i run my tests on a module that use a model with behavior i've got : Exception: The class BaseNews has already a mixin for method setRating. Can you help me ? Thanks, Yohan. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] About caching...
Hi, I've got two questions for you... First : lifetime: 0 in cache disable caching but shouldn't this make the cache lifetime infinite ? Second : I need to change the action cache key and i use the sf_cache_namespace_callable parameter for this, but i need to rewrite all the generateCacheKey method code. Is there a better practice for this ? Thanks in advance, Yohan. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] Re: change cache-key for an action
Eno wrote: On Oct 7, 8:26 am, DYNAMIC+ [EMAIL PROTECTED] wrote: we need to change cache key to an action of a module - not the cache key of o a partial in symfony 1.0. Ah, OK. But symfony should automatically generate a unique cache key based on the URL - or do you need to set it explicitly to clear it later? you can generate your own cache key (for all actions...) with the sf_cache_namespace_callable parameter wich take a callback that make the key. Look at sfViewCacheManager::generateCacheKey() ;) Yohan. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] Problem with forwarding in filters
Hi, I've got a problem with forwarding from a filter in sf 1.1... I do $this-getContext()-getController()-forward($module, $action), but i've got header problem (the web debug toolbar is loaded 2 times...) and no rendering of my action... Do you know something I don't see the problem... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] Re: Problem with forwarding in filters
Alexander Deruwe wrote: On 01 Oct 2008, at 15:58, Alexander Deruwe wrote: On 01 Oct 2008, at 15:28, Yohan 'rouKs' G. wrote: I've got a problem with forwarding from a filter in sf 1.1... I do $this-getContext()-getController()-forward($module, $action), but i've got header problem (the web debug toolbar is loaded 2 times...) and no rendering of my action... According to the symfony book, you could write: $this-getController()-forward($module, $action); Does this work? Oops I didn't see the 'sf 1.1' on time there... I'm not sure if what I wrote above is correct in that context, sorry... Alexander The book says $this-getContext()-getController()-forward($module, $action)... but it doesn't work... :( --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~--- begin:vcard fn:Yohan 'rouKs' GIARELLI n:GIARELLI;Yohan email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard
[symfony-users] Autoloading problem with Propel 1.3
Hi, I'm migrating from propel 1.2 to 1.3 (symfony1.1) and i've got some problems with the autoloading... Fatal error: require() [function.require]: Failed opening required 'lib/model/om/BaseMenuNodePeer.php' (include_path='.:/usr/share/php:/ usr/share/pear:/usr/share/php5/symfony11/lib:/home/yohan/src/plugins/ sfPropelPlugin/lib/vendor/:/home/yohan/src/plugins/sfPropelPlugin/lib/ vendor/') in /home/yohan/src/lib/model/om/ BaseMenuNodeNestedSetPeer.php on line 3 The include_path doesn't contains lib/model ! Has someone a solution ? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Autoloading problem with Propel 1.3
Yohan 'rouKs' G. wrote: Hi, I'm migrating from propel 1.2 to 1.3 (symfony1.1) and i've got some problems with the autoloading... Fatal error: require() [function.require]: Failed opening required 'lib/model/om/BaseMenuNodePeer.php' (include_path='.:/usr/share/php:/ usr/share/pear:/usr/share/php5/symfony11/lib:/home/yohan/src/plugins/ sfPropelPlugin/lib/vendor/:/home/yohan/src/plugins/sfPropelPlugin/lib/ vendor/') in /home/yohan/src/lib/model/om/ BaseMenuNodeNestedSetPeer.php on line 3 The include_path doesn't contains lib/model ! Has someone a solution ? I found why this don't work but no solution :/ This is because the addIncludes = false in propel.ini doesn't work with nested sets. If i manually remove includes, it works. Someone have a solution or a patch ? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: 1.1 forms question
- I would like to have all validation errors reported as general errors and not besides the field in error. Basically, I would like each error to be added to a flash message. How can I do this using the new form and validation system? No need to use flashs, you can retrieve the list off all errors on your form object : code $form-getErrorSchema()-getErrors() /code - I need to place a form in a layout file and/or in a partial. How can I link the form in the view to a form in a controller so that its fields are repopulated with the user's values in case of a validation error? Yohan. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Problem with sfApplicationConfiguration in 1.1 tasks
Thanks it works now. It would be nice to write this in the Cookbook Yohan. Fabien Potencier wrote: This only works if your task takes an application as an argument. Fabien -- Fabien Potencier Sensio CEO - symfony lead developer sensiolabs.com | symfony-project.com | aide-de-camp.org Tél: +33 1 40 99 80 80 Yohan GIARELLI wrote: Hello all, I've got a problem with the 1.1 tasks and Propel. When I do code protected function execute($arguments = array(), $options = array()) { $databaseManager = new sfDatabaseManager($this-configuration); } /code to use the database layer i've got this message : code Catchable fatal error: Argument 1 passed to sfDatabaseManager::__construct() must be an instance of sfApplicationConfiguration, instance of ProjectConfiguration given, called in... /code I don't understand... ProjectConfiguration is a child of sfApplicationConfiguration and this code come from the cookbook... Thanks in advance --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Mails with symfony 1.1
Thanks for your answer. I'm disapointed that there's no symfony way to send mails in 1.1... Thomas Rabaix wrote: This point has been discussed different times now in the dev mailing list. And the conclusion of the core team : - no more sendMail function in a controller - no more mail feature built in - send your mail with your own solution, ex : swift mailer see : http://groups.google.com/group/symfony-devs/browse_thread/thread/b268c40c574d1402 Thomas On Tue, Jun 3, 2008 at 12:10 PM, Yohan GIARELLI [EMAIL PROTECTED] wrote: Hello ! I don't find how to send a mail with sf 1.1... How can i send mail in 1.1 without the sf1.0 compat plugin ? Thanks in advance, Yohan. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Uploading files in symfony 1.1
Hi all, I've got a problem with file upload in sf1.1. Validating alway miss with the message 'requested'. How can i upload files in 1.1 ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Uploading files in symfony 1.1
Don't work :( I've got this message : * Click browse and choose one of your photos to apear on your profile Dmitry Nesteruk wrote: yes, you can Example: - actions.class.php -- if ($this-form-isValid()) { $file = $this-form-getValue('photo') ; $path = /tmp/file.; $extension = strtolower($file-getExtension($file- getOriginalExtension())); $file-save($path.$extension); } PhotoForm.class.php -- class PhotoForm extends sfForm { public function configure() { $this-setWidgets(array( 'photo' = new sfWidgetFormInputFile(), )); $this-setValidators(array( 'photo' = new sfValidatorFile(array('required' = true, 'max_size' = '1024000', // bytes (1MB) 'mime_types' = array('image/jpeg') )), )); $this-validatorSchema['photo']-setMessage('max_size', 'File size limit is 1MB, please make your file smaller'); $this-validatorSchema['photo']-setMessage('mime_types', 'The file you submit is not a valid format. Please upload a JPG, GIF or PNG image file'); $this-validatorSchema['photo']-setMessage('required', 'Click browse and choose one of your photos to apear on your profile'); $this-widgetSchema-setNameFormat('photoform[%s]'); $this-errorSchema = new sfValidatorErrorSchema($this- validatorSchema); } } 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Hi all, I've got a problem with file upload in sf1.1. Validating alway miss with the message 'requested'. How can i upload files in 1.1 ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Uploading files in symfony 1.1
Yes of course :D I don't ask for a validator wich make his job... Others fields of my forms work perfectly but I can't send files :/ Dmitry Nesteruk wrote: Did you chose a file for upload? This field is required. 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Don't work :( I've got this message : * Click browse and choose one of your photos to apear on your profile Dmitry Nesteruk wrote: yes, you can Example: - actions.class.php -- if ($this-form-isValid()) { $file = $this-form-getValue('photo') ; $path = /tmp/file.; $extension = strtolower($file-getExtension($file- getOriginalExtension())); $file-save($path.$extension); } PhotoForm.class.php -- class PhotoForm extends sfForm { public function configure() { $this-setWidgets(array( 'photo' = new sfWidgetFormInputFile(), )); $this-setValidators(array( 'photo' = new sfValidatorFile(array('required' = true, 'max_size' = '1024000', // bytes (1MB) 'mime_types' = array('image/jpeg') )), )); $this-validatorSchema['photo']-setMessage('max_size', 'File size limit is 1MB, please make your file smaller'); $this-validatorSchema['photo']-setMessage('mime_types', 'The file you submit is not a valid format. Please upload a JPG, GIF or PNG image file'); $this-validatorSchema['photo']-setMessage('required', 'Click browse and choose one of your photos to apear on your profile'); $this-widgetSchema-setNameFormat('photoform[%s]'); $this-errorSchema = new sfValidatorErrorSchema($this- validatorSchema); } } 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Hi all, I've got a problem with file upload in sf1.1. Validating alway miss with the message 'requested'. How can i upload files in 1.1 ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Uploading files in symfony 1.1
I've got the same result after a symfony fix-perms and a chmod -R 777 * in my symfony directory Tom Haskins-Vaughan wrote: Are you permissions on the upload directory set correctly? Yohan 'rouKs' G. wrote: Yes of course :D I don't ask for a validator wich make his job... Others fields of my forms work perfectly but I can't send files :/ Dmitry Nesteruk wrote: Did you chose a file for upload? This field is required. 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Don't work :( I've got this message : * Click browse and choose one of your photos to apear on your profile Dmitry Nesteruk wrote: yes, you can Example: - actions.class.php -- if ($this-form-isValid()) { $file = $this-form-getValue('photo') ; $path = /tmp/file.; $extension = strtolower($file-getExtension($file- getOriginalExtension())); $file-save($path.$extension); } PhotoForm.class.php -- class PhotoForm extends sfForm { public function configure() { $this-setWidgets(array( 'photo' = new sfWidgetFormInputFile(), )); $this-setValidators(array( 'photo' = new sfValidatorFile(array('required' = true, 'max_size' = '1024000', // bytes (1MB) 'mime_types' = array('image/jpeg') )), )); $this-validatorSchema['photo']-setMessage('max_size', 'File size limit is 1MB, please make your file smaller'); $this-validatorSchema['photo']-setMessage('mime_types', 'The file you submit is not a valid format. Please upload a JPG, GIF or PNG image file'); $this-validatorSchema['photo']-setMessage('required', 'Click browse and choose one of your photos to apear on your profile'); $this-widgetSchema-setNameFormat('photoform[%s]'); $this-errorSchema = new sfValidatorErrorSchema($this- validatorSchema); } } 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Hi all, I've got a problem with file upload in sf1.1. Validating alway miss with the message 'requested'. How can i upload files in 1.1 ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Uploading files in symfony 1.1
Yes and the more strange is thar a var_dump($_FILES) give this : array(1) { [photoform]= array(5) { [name]= array(1) { [photo]= string(8) eepc.jpg } [type]= array(1) { [photo]= string(10) image/jpeg } [tmp_name]= array(1) { [photo]= string(14) /tmp/phpyPPtau } [error]= array(1) { [photo]= int(0) } [size]= array(1) { [photo]= int(599584) } } } so, the upload work, but symfony don't reconize the file... Alistair Stead wrote: Have you set the form to be multi-part? Regards Alistair 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: I've got the same result after a symfony fix-perms and a chmod -R 777 * in my symfony directory Tom Haskins-Vaughan wrote: Are you permissions on the upload directory set correctly? Yohan 'rouKs' G. wrote: Yes of course :D I don't ask for a validator wich make his job... Others fields of my forms work perfectly but I can't send files :/ Dmitry Nesteruk wrote: Did you chose a file for upload? This field is required. 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Don't work :( I've got this message : * Click browse and choose one of your photos to apear on your profile Dmitry Nesteruk wrote: yes, you can Example: - actions.class.php -- if ($this-form-isValid()) { $file = $this-form-getValue('photo') ; $path = /tmp/file.; $extension = strtolower($file-getExtension($file- getOriginalExtension())); $file-save($path.$extension); } PhotoForm.class.php -- class PhotoForm extends sfForm { public function configure() { $this-setWidgets(array( 'photo' = new sfWidgetFormInputFile(), )); $this-setValidators(array( 'photo' = new sfValidatorFile(array('required' = true, 'max_size' = '1024000', // bytes (1MB) 'mime_types' = array('image/jpeg') )), )); $this-validatorSchema['photo']-setMessage('max_size', 'File size limit is 1MB, please make your file smaller'); $this-validatorSchema['photo']-setMessage('mime_types', 'The file you submit is not a valid format. Please upload a JPG, GIF or PNG image file'); $this-validatorSchema['photo']-setMessage('required', 'Click browse and choose one of your photos to apear on your profile'); $this-widgetSchema-setNameFormat('photoform[%s]'); $this-errorSchema = new sfValidatorErrorSchema($this- validatorSchema); } } 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Hi all, I've got a problem with file upload in sf1.1. Validating alway miss with the message 'requested'. How can i upload files in 1.1 ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Uploading files in symfony 1.1
Thanks, it work perfectly now. It's not so easy to use the new form system without documentation. Fabien POTENCIER wrote: When binding the form, you have to pass the files specifically: $this-form-bind($request-getParameter('photoform'), $request-getFiles('photoform')); Fabien -- Fabien Potencier Sensio CEO - symfony lead developer sensiolabs.com | symfony-project.com | aide-de-camp.org Tél: +33 1 40 99 80 80 Yohan 'rouKs' G. wrote: Yes and the more strange is thar a var_dump($_FILES) give this : array(1) { [photoform]= array(5) { [name]= array(1) { [photo]= string(8) eepc.jpg } [type]= array(1) { [photo]= string(10) image/jpeg } [tmp_name]= array(1) { [photo]= string(14) /tmp/phpyPPtau } [error]= array(1) { [photo]= int(0) } [size]= array(1) { [photo]= int(599584) } } } so, the upload work, but symfony don't reconize the file... Alistair Stead wrote: Have you set the form to be multi-part? Regards Alistair 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: I've got the same result after a symfony fix-perms and a chmod -R 777 * in my symfony directory Tom Haskins-Vaughan wrote: Are you permissions on the upload directory set correctly? Yohan 'rouKs' G. wrote: Yes of course :D I don't ask for a validator wich make his job... Others fields of my forms work perfectly but I can't send files :/ Dmitry Nesteruk wrote: Did you chose a file for upload? This field is required. 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Don't work :( I've got this message : * Click browse and choose one of your photos to apear on your profile Dmitry Nesteruk wrote: yes, you can Example: - actions.class.php -- if ($this-form-isValid()) { $file = $this-form-getValue('photo') ; $path = /tmp/file.; $extension = strtolower($file-getExtension($file- getOriginalExtension())); $file-save($path.$extension); } PhotoForm.class.php -- class PhotoForm extends sfForm { public function configure() { $this-setWidgets(array( 'photo' = new sfWidgetFormInputFile(), )); $this-setValidators(array( 'photo' = new sfValidatorFile(array('required' = true, 'max_size' = '1024000', // bytes (1MB) 'mime_types' = array('image/jpeg') )), )); $this-validatorSchema['photo']-setMessage('max_size', 'File size limit is 1MB, please make your file smaller'); $this-validatorSchema['photo']-setMessage('mime_types', 'The file you submit is not a valid format. Please upload a JPG, GIF or PNG image file'); $this-validatorSchema['photo']-setMessage('required', 'Click browse and choose one of your photos to apear on your profile'); $this-widgetSchema-setNameFormat('photoform[%s]'); $this-errorSchema = new sfValidatorErrorSchema($this- validatorSchema); } } 2008/5/7 Yohan 'rouKs' G. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Hi all, I've got a problem with file upload in sf1.1. Validating alway miss with the message 'requested'. How can i upload files in 1.1 ? 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
[symfony-users] Problem with forms and files upload in sf1.1
Hi all, Validation of file in sf1.1 alway return 'required' I think there's a problem with POST arrays and the $_FILE array. Is there a solution ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: buy in Symfony V1.0.13?
The generator shouldn't owerwrite your action it's strange... I use sf1.0.13 and I never had this problem... As you say, the generated action should be only in cache On 5 mai, 20:13, Mohammad Ali Safari [EMAIL PROTECTED] wrote: Thanks for the prompt reply. I have a symfony V1.0.11 on linux and when I run symfony propel-init-admin it never removes/rewrites my own actions.class.php file. --MohammadOn Mon, May 5, 2008 at 12:10 PM, Christian Hammers [EMAIL PROTECTED] wrote: On 2008-05-05 Mohammad Ali Safari wrote: I am using Symfony V1.0.13 on windows (with WAMP) and whenever I use admin-generator (symfony propel-init-admin ..) it not only rewrites actions.class.php file in cache directory (which is normal) but also rewrites the action.class.php in module directory which basically removes all my own functions. I guess it's intentional for a generator to write its own action.class.php as it should be used to create a working application. And doing so only in the cache would make the application vanish if somebody does symfony cc. But you could file a wishlist-bug-report asking for check if the module already exists so that the user can move it to a safe place. bye, -christian- --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Problem with forms edition in symfony 1.1
Hi everyone, I have a problem with the propel-generated forms in symfony 1.1. I can create new records without any problems, but when i'm editing a record, it's make a new... I use the default generated forms so I don't understand ! Thanks in advance, Yohan GIARELLI. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Problem with forms edition in symfony 1.1
Thanks it works properly now ;) On 28 avr, 17:33, Fabien POTENCIER [EMAIL PROTECTED] project.com wrote: Yohan 'rouKs' G. wrote: code public function executeEdit(sfWebRequest $request) { $this-news = NewsPeer::retrieveByPK($this- getRequestParameter('id')); $this-id = $this-getRequestParameter('id'); This should be: $this-id = $request-getParameter('news[id]'); as all parameters are in the news array. Fabien $this-form = new NewsForm(NewsPeer::retrieveByPK($this-id)); if ($request-isMethod('post')) { $this-form-bind($request-getParameter('news')); if($this-form-isValid()) { $this-form-updateObject() $this-form-save(); $this-getUser()-setFlash('notice', 'Ok'); } } } /code Here's my code, it is not complex so i don't understand who's the problem :/ NewsForm is a propel-generated class wich wasn't been modified --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Problem when building model
I have the following problem when I make a symfony propel-build- model : Fatal error: Declaration of UnixFileSystem::getBooleanAttributes() must be compatible with that of FileSystem::getBooleanAttributes() in / usr /share/php/symfony11/1.1/lib/plugins/sfPropelPlugin/lib/vendor/phing/ system/io/UnixFileSystem.php on line 266 I got it with the 1.0.12 and 1.1 versions and I don't understand. (My schema.yml has no problem, the generated-schema.xml is successfuly generated) 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---