[symfony-users] Question about a form and unset
Hi, i have installed sfDoctrineGuardExtraPlugin. When i execute sfGuardRegister/register i found a form with username, email, password, and confirmation password. Now i want to remove the field 'username' from the form. For that i have written this class sfGuardFormRegister extends BasesfGuardFormRegister { public function configure() { unset( $this['username'] ); } } But when i execute sfGuardRegister/register the form doesn't appear anything.. No problem when i write this: class sfGuardFormRegister extends BasesfGuardFormRegister { public function configure() { $this-setWidgets(array( 'email_address' = new sfWidgetFormInput(), 'password' = new sfWidgetFormInputPassword(), 'password_confirmation' = new sfWidgetFormInputPassword(), )); } } But why unset way doesn't work ? Javi -- 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
Re: [symfony-users] swift mailer - delivery_strategy: none
Additionally set transport class to Swift_NullTransport to avoid this: dev: mailer: param: delivery_strategy: none transport: class: Swift_NullTransport Cheers, Lea On Mar 12, 2010, at 3:22 , Kevin wrote: When the delivery strategy is set to none should swift mailer still be trying to connect to the smtp server? In my dev environment i don't want it to. I thought setting delivery_strategy to none prevented this. Is this expected? Thanks, Kevin -- 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 -- 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.3.3 doctrine inheritance custom primary key and formfilters
No one? On Mar 10, 10:52 pm, lxtechie lxtec...@gmail.com wrote: Hi If been trying to use doctrine's inheritance feature . I add my own primary key in the child table (in this case my_id) but if I try and use a filter in the backend I get the following error : SQLSTATE[HY093]: Invalid parameter number: parameter was not defined my schema.yml file: SysRoot: columns: reason: type: string(255) Article: inheritance: type: concrete extends: SysRoot columns: my_id: type: integer(8) primary: true autoincrement: true author_id: integer title: type: string(255) notnull: true I think the formfiltergenerator is not using the correct primary key since the parent table has a auto generated pk (id) . Am I doing something wrong or is there perhaps a workaround? Thanx Best Regards lxtechie -- 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] Please help me with plugin development
Hi, I'm write sfUserOnlinePlugin then put package.xml file into root plugin directory with next content: ?xml version=1.0 encoding=UTF-8? package xmlns=http://pear.php.net/dtd/package-2.0; xmlns:tasks=http://pear.php.net/dtd/tasks-1.0; xmlns:xsi=http:// www.w3.org/2001/XMLSchema-instance packagerversion=1.9.0 version=2.0 xsi:schemaLocation=http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd; namesfUserOnlinePlugin/name channelpear.symfony-project.com/channel summaryUser status plugin/summary descriptionThis plugin allow you to manage user status by changing user class in your factories.yml to sfUserOnline. This class extends sfUser class and you don't drop any user logic./description lead nameYura Rodchyn/name userrodchyn/user emailrodc...@gmail.com/email activeyes/active /lead date2010-03-11/date time20:10:52/time version release0.0.8/release api1.0.0/api /version stability releasealpha/release apialpha/api /stability license uri=http://www.gnu.org/licenses/lgpl-3.0.txt;LGPL/ license notes version 0.0.8 /notes contents dir name=/ file md5sum=aea1105ba6653b8d79f4640016732c3e name=README.txt role=data/ file md5sum=c716a1686109a384ddf36168020f8494 name=lib/ sfUserOnline.class.php role=data/ file md5sum=d66e52924e588adf77167fc36506a997 name=lib/storage/ onlineMemcacheStorage.class.php role=data/ file md5sum=99742a782501bc0492e3a8a572736f50 name=lib/storage/ onlineStorage.class.php role=data/ /dir /contents dependencies required php min5.0.0/min /php pearinstaller min1.4.0/min /pearinstaller package namesymfony/name channelpear.symfony-project.com/channel min1.4.0/min max1.4.100/max /package /required /dependencies phprelease /phprelease /package after that run command from cli pear package this command create sfUserOnlinePlugin-0.0.8.tgz file. I submit it to plugin and got 0.0.8 version alpha. But, if I install this plugin in new project it install plugin into root plugins directory plugins/README.txt plugins/lib/sfUserOnline.class.php plugins/lib/storage/... ... How to set normal setup to /plugins/sfUserOnlinePlugin/ ? -- 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: propel:build-schema not working[jobeet]
On 12 Mar, 05:10, Tahar Yazid Touaibia ytouaib...@gmail.com wrote: in the tutorial, i did not see any instruction concerning : --orm=Propel http://www.symfony-project.org/jobeet/1_4/Propel/en/01#chapter_01_sub_project_creation -- 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] Doctrine question
I have the following yaml schema: Profile: # blah blah Channel: actAs: { Timestampable: ~ } columns: sender_id: { type: integer, notnull: true } receiver_id: { type: integer, notnull: true } relations: Profile: { local: sender_id, foreign: id } How can I relate receiver_id to the same Profile table as sender_id? Cheers, A. -- 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
Re: [symfony-users] Doctrine question
Hi, Try this : Channel: actAs: { Timestampable: ~ } columns: sender_id: { type: integer, notnull: true } receiver_id: { type: integer, notnull: true } relations: SenderProfile: { local: sender_id, foreign: id, class: Profile} ReceiverProfile: { local: receiver_id, foreign: id, class: Profile} //Syam Alexander Deruwe wrote: I have the following yaml schema: Profile: # blah blah Channel: actAs: { Timestampable: ~ } columns: sender_id: { type: integer, notnull: true } receiver_id: { type: integer, notnull: true } relations: Profile: { local: sender_id, foreign: id } How can I relate receiver_id to the same Profile table as sender_id? Cheers, A. -- 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
RE: [symfony-users] Doctrine question
That worked just fine! Thanks a bunch. A. -Oorspronkelijk bericht- Van: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] Namens Syam Verzonden: vrijdag 12 maart 2010 15:14 Aan: symfony-users@googlegroups.com Onderwerp: Re: [symfony-users] Doctrine question Hi, Try this : Channel: actAs: { Timestampable: ~ } columns: sender_id: { type: integer, notnull: true } receiver_id: { type: integer, notnull: true } relations: SenderProfile: { local: sender_id, foreign: id, class: Profile} ReceiverProfile: { local: receiver_id, foreign: id, class: Profile} //Syam -- 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: propel:build-schema not working[jobeet]
what version of symfony are you using? if you're using 1.3/1.4 so ... maybe you create the project with default configuration (Doctrine) and that is why Propel task does not exist. If you are starting to learn symfony I recommend you learn Doctrine because that's the future of Symfony. Grettings from El Salvador. On 11 mar, 06:26, Tahar Yazid Touaibia ytouaib...@gmail.com wrote: Hello, I am new to symfony, i just installed it and am trying to follow the jobeet tutorial. When i run the following command i got an error : php symfony propel:build-schema The message displayed : there are no tasks defined in the Propel namespace. I running symfony on wamp and here is the result of my check_configuration.php file : ** Mandatory requirements ** OK PHP version is at least 5.2.4 (5.2.5) ** Optional checks ** OK PDO is installed OK PDO has some drivers installed: mysql, sqlite2 OK PHP-XML module is installed OK XSL module is installed OK The token_get_all() function is available OK The mb_strlen() function is available OK The iconv() function is available OK The utf8_decode() is available [[WARNING]] The posix_isatty() is available: FAILED *** Enable the php_posix extension (used to colorized the CLI output) *** [[WARNING]] A PHP accelerator is installed: FAILED *** Install a PHP accelerator like APC (highly recommended) *** OK php.ini has short_open_tag set to off OK php.ini has magic_quotes_gpc set to off OK php.ini has register_globals set to off OK php.ini has session.auto_start set to off OK PHP version is not 5.2.9 I would appreciate any help that can let me go further in the tutorial. Thanks in advance Yaz -- -- 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
Re: [symfony-users] Linking to the upload path from a template.
On Fri, Mar 12, 2010 at 2:00 AM, Gareth McCumskey gmccums...@gmail.com wrote: In your template: ?php echo image_tag($sf_config-get('sf_upload_dir').'/myImages/'.$image_name) ? The $sf_config variable is a copy of the sfConfig object used in the actions. Thank you, but I'm afraid that didn't work. Instead, it printed the error message: Notice: Undefined variable: sf_config in ..path/to/the/template.php.. on line 24 Fatal error: Call to a member function get() on a non-object in on line 24. It seems that $sf_config is not available in my template. Does that make any sense? (symfony 1.4 here). Instead, I tried using sfConfig::get('sf_upload_dir'). The result was slightly better: img src=/myapp/projects/myapp/web/uploads/myImages/5e1a2b0308e404ecd8128b933f667274039e9e59.jpg / The first /myapp/ is the right webpath to the /web/ directory, but sf_upload_dir seems to hold the filesystem path to the upload directory (/projects/myapp/web/uploads/), rather than the webpath. Remiving it form the path yielded better results: ?php echo image_tag('/uploads/myimages/'.$image_name) ? did display the image tag, though it has the /uploads/ part hardcoded. Moreover, it produces the image tag, but I can't find the way to access the url (for instance, if I want to link to it). Any thoughts? (and where can I find the list of functions and variables I can use from the template?) Thanks, Luis. -- 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: Simple Form Question
Here is what I did, in my BaseForm class I added this method: public function setValue($field, $value){ if(!in_array($field, array_keys($this-values))){ throw new sfException(sprintf('Unkown field %s in %s object.', $field, get_class($this))); } $this-values[$field] = $value; } On Mar 11, 10:34 pm, Raphael Schumacher m...@raphaelschumacher.ch wrote: Which action are you in, executeNew(), executeCreate(), executeEdit() or any other one? The thing in general is that the defaults are used for filling the widgets with default data when you render the form for displaying it to the user. It's not taken into the object itself when you are about to save the object (e.g. as a consequence from a submit by the user). My personal solution here to set the data directly into the form's object: $supportTicket = $this-form-getObject(); $supportTicket-set('customer_id', $this-getUser()-getAttribute('customer_id')); // there are alternatives to this setter function, but this one should work for sure Hope that helps, RAPHAEL -- 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: Custom logger via factory.yml?
Hey Scott, I guess you're right.. if the aggregate logger registers itself for the application.log event, it will simply stuff those log messages down into it's contained loggers, regardless of whether they are listening for this event themselves. Frankly, I think we have established that symfony logging sucks for everything that is non- symfony, and I think I can see why they're using the Zend logging in Symfony 2. For the time being I think you're right to manually instantiate it in the configuration. Good discussion, I hope some code members are following along, and hopefully enlighten us as to why every logger relies on the dispatcher and insists on registering itself for application.log. In my opinion the loggers should be dumb writer classes, and there should be one sfLogger in charge of listening for application.log and using the loggers simply to persist those log messages. How ever else this was conceived is beyond me. Daniel On Mar 11, 3:31 pm, Scott S. trebledm...@gmail.com wrote: Hi Daniel, I'm attempting to implement your suggested method of custom logging, since I have a requirement of logging certain activities in my application outside the standard log files. I've called my event type activity.log for reference. Logging messages of type activity.log works. The problem: even though ActivityFileLogger unregisters for the application.log event type (after the call to parent::initialize), everything that gets written to the application log is also being written to the activity.log file, in addition to the activity.log events. Looking through the framework source, I see that sfAggregateLogger registers itself for application.log events (via parent::initialize) after adding the specified loggers, though it also unregisters each of its loggers from application.log when adding them. So I'm kind of at a loss as to why all the application events are getting logged to my custom log. Here's what I've got: class ActivityFileLogger extends sfFileLogger { public function initialize(sfEventDispatcher $dispatcher, $options = array()) { parent::initialize($dispatcher, $options); $dispatcher-connect('activity.log', array($this, 'listenToLogEvent')); $dispatcher-disconnect('application.log', array($this, 'listenToLogEvent')); } } class AuditLogger // wrapper for application code to do the custom logging { // ... public function logActivity($message) { sfContext::getInstance()-getEventDispatcher()-notify(new sfEvent($this, 'activity.log', array($message))); } } And from factories.yml (I've omitted the default loggers): all: logger: class: sfAggregateLogger param: loggers: activity_log: class: ActivityFileLogger param: file: %SF_LOG_DIR%/activity.log Any ideas? Is it really advantageous to use this approach, versus just creating an instance early in the application and using it in the controller? I'm also thinking in terms of how I'll have to modify factories.yml to get this custom logging to work in prod as well as dev without altering the lack of application logging. Thanks a bunch for the help you've already provided here! Scott On Feb 26, 9:25 am, Richtermeister nex...@gmail.com wrote: What Daniel said.. Plus, for convenience you can always create a local log method on whatever object you're logging from that wraps the calls to the event- dispatcher. Then you have elegant and short. Daniel On Feb 26, 5:34 am, Christian Hammers c...@lathspell.de wrote: Oh, if the logging does not work because classes go lost, I'd rather want the programm to terminate :) But thanks anyway, the event handling does not sound uninteresting, maybe I can use it for something else somewhen. bye, -christian- On Fri, 26 Feb 2010 13:42:08 +0100 Daniel Lohse annismcken...@googlemail.com wrote: It's longer perhaps but more elegant? You betcha! It doesn't create a new dependency in your code because yourloggercould also *not* be there and the code would still work. Cheers, Daniel On 26.02.2010, at 12:57, Christian Hammers wrote: Hello So instead of $logger-info() I should write something like this? $this-getEventDispatcher()-notify(new sfEvent($this, 'blah.log', array('loglevel'='info', 'msg'='hello world')); Well, that would not exactly be more elegant than: $logger= BlahLogger::getInstance()-info(hello world); bye, -christian- On Thu, 25 Feb 2010 10:21:00 -0800 (PST) Richtermeister nex...@gmail.com wrote: Hey Chris, you don't need to interact with thisloggerdirectly. It just sits there and listens for yourcustomlogging events. The dispatcher is what you need to worry about, since that's used to dispatch the events in the first place. You'll find that the dispatcher is more available throughout the
[symfony-users] Re: swift mailer - delivery_strategy: none
great, thanks! On Mar 12, 3:42 am, Lea Hänsenberger baerne...@gmail.com wrote: Additionally set transport class to Swift_NullTransport to avoid this: dev: mailer: param: delivery_strategy: none transport: class: Swift_NullTransport Cheers, Lea On Mar 12, 2010, at 3:22 , Kevin wrote: When the delivery strategy is set to none should swift mailer still be trying to connect to the smtp server? In my dev environment i don't want it to. I thought setting delivery_strategy to none prevented this. Is this expected? Thanks, Kevin -- 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 -- 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: help il list
Hello! What's the problem? Building forms, rendering in your template file or writing doctrine queries? first of all you need to customize your JobForm.class.php: sfWidgetFormDoctrineChoice() please give us more details and you will get more feedback. Ciao On 13 Mrz., 01:02, Belgacem TLILI belgacem0...@gmail.com wrote: i have this class job: connection: doctrine tableName: job columns: id_marchandise: type: integer(4) primary: true autoincrement: true category: type: string(50) sub_category: type: string(50) i would like have the data of this table in (of my database) like a list of option in indexSuccess.php like this in html select name=job[category] id=job_category option value=1Petit Colis/option option value=2Moyen Colis/option option value=3Grand Colis/option //the data from database option value=7Petite Palette/option option value=8Moyenne Palette/option option value=9Grande Palette/option /select how can i do this how can i build a doctrine request (DQL) -- 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] Problem in creating a Doctrine backend admin module
I have two tables: headline, review. One-to-many relationship, i.e. many reviews may belongs to one headline. 1. symfony doctrine:generate-admin backend BookHeadline is successful. I can go to the backend by /book_headline and admin the headline data; 2. symfony doctrine:generate-admin backend BookReview seems successful but when I go to the backend by /book_review, the following error occurs: 500 | Internal Server Error | InvalidArgumentException The /book_review/:Array.:sf_format route has some missing mandatory parameters (:Array). When I try to look at the routes, it shows: Name Method Pattern book_review GET/book_review.:sf_format book_review_new GET/book_review/new.:sf_format book_review_createPOST /book_review.:sf_format book_review_edit GET/book_review/:Array/edit.:sf_format book_review_updatePUT/book_review/:Array.:sf_format book_review_deleteDELETE /book_review/:Array.:sf_format book_review_show GET/book_review/:Array.:sf_format book_review_objectGET/ book_review/:Array/:action.:sf_format book_review_collectionPOST /book_review/:action/ action.:sf_format I can go to new action, though. Any hints on this? -- 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