[symfony-users] symfony 1,0 output scaping sf_request....
Hello, I put this in my settings.yml escaping_strategy: on escaping_method:ESC_ENTITIES The manual says: **CAUTION** The usual symfony variables are also escaped when you turn on output escaping. So be aware that `$sf_user`, `$sf_request`, `$sf_param`, and `$sf_context` still work, but their methods return escaped data, unless you add `ESC_RAW` as a final argument to their method calls. But I can't access sf_request (to repopulate a form) in my templates Did I miss something? 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] Symfony 1.1 unset form widget
Hello !! I have some generated code to manage my users (from sfGuard schema). I have done : propel:generate-crud frontend users sfGuardUser --with-show but I don't want to edit the 'created_at' column since it's automatically fill ... so I just unset it inside the configure() method of the base form as explain in the doc : class sfGuardUserForm extends BasesfGuardUserForm { public function configure() { unset($this-widgetSchema['created_at']); unset($this-validatorSchema['created_at']); } } But when I want to edit or crate a user (call to sfGuardUserForm) their is an exception : [InvalidArgumentException] *Widget created_at does not exist.* stack trace * at () in SF_SYMFONY_LIB_DIR\form\sfForm.class.php line 718 ... 715. { 716. if (!$widget = $this-widgetSchema[$name]) 717. { 718. throw new InvalidArgumentException(sprintf('Widget %s does not exist.', $name)); 719. } 720. 721. $values = $this-isBound ? $this-taintedValues : $this-defaults; * at sfForm-offsetGet('created_at') in SF_ROOT_DIR\apps\frontend\modules\users\templates\editSuccess.php line 50 I don't understand because I have already tested this when I read the symfony form book. It doesn't work neither if I try other colum like is_active .. i got the same exception ... !!! Can you help please ? 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: Symfony 1.1 unset form widget
You should probably use the $form-offsetUnset('widgetName'); and make sure it exists using $form-offsetExists('widgetName'); might do some cleaning up a bit more. On Jul 14, 11:49 am, Olivier Revollat [EMAIL PROTECTED] wrote: Hello !! I have some generated code to manage my users (from sfGuard schema). I have done : propel:generate-crud frontend users sfGuardUser --with-show but I don't want to edit the 'created_at' column since it's automatically fill ... so I just unset it inside the configure() method of the base form as explain in the doc : class sfGuardUserForm extends BasesfGuardUserForm { public function configure() { unset($this-widgetSchema['created_at']); unset($this-validatorSchema['created_at']); } } But when I want to edit or crate a user (call to sfGuardUserForm) their is an exception : [InvalidArgumentException] *Widget created_at does not exist.* stack trace * at () in SF_SYMFONY_LIB_DIR\form\sfForm.class.php line 718 ... 715. { 716. if (!$widget = $this-widgetSchema[$name]) 717. { 718. throw new InvalidArgumentException(sprintf('Widget %s does not exist.', $name)); 719. } 720. 721. $values = $this-isBound ? $this-taintedValues : $this-defaults; * at sfForm-offsetGet('created_at') in SF_ROOT_DIR\apps\frontend\modules\users\templates\editSuccess.php line 50 I don't understand because I have already tested this when I read the symfony form book. It doesn't work neither if I try other colum like is_active .. i got the same exception ... !!! Can you help please ? 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: How can I see the raw SQL that a Criteria() object is going to execute?
$c = new Criteria(); $c-addAscendingOrderByColumn(VideoPeer::ID); $c-add(VideoPeer::ID, $start_id, Criteria::GREATER_EQUAL); $c-add(VideoPeer::ID, $end_id, Criteria::LESS_EQUAL); That's a classical limitaion of Propel. Either do : $c = new Criteria(); $c-addAscendingOrderByColumn(VideoPeer::ID); $c-add(VideoPeer::ID, VideoPeer::ID.' BETWEEN '.$start_id.' AND '. $end_id, Criteria::CUSTOM); which I used at first but opens a door to sql injection, since we're not used to escaping anymore and CRITERIA::CUSTOM does not escape for you ! Or do this : $c = new Criteria(); $c-addAscendingOrderByColumn(VideoPeer::ID); $c1 = $c-getNewCriterion(VideoPeer::ID, $start_id, Criteria::GREATER_EQUAL); $c2 = $c-getNewCriterion(VideoPeer::ID, $end_id, Criteria::LESS_EQUAL); $c1-addAnd($c2); $c-add($c1); --~--~-~--~~~---~--~~ 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: Symfony 1.1 unset form widget
I tried the following code but I got *the same exception* this means that offsetExistsreturn true but I can't unset this widget !!! any idea ? class sfGuardUserForm extends BasesfGuardUserForm { public function configure() { if($this-offsetExists('created_at')){ $this-offsetUnset('created_at'); } } } 2008/7/14 CaffeineInc [EMAIL PROTECTED]: You should probably use the $form-offsetUnset('widgetName'); and make sure it exists using $form-offsetExists('widgetName'); might do some cleaning up a bit more. On Jul 14, 11:49 am, Olivier Revollat [EMAIL PROTECTED] wrote: Hello !! I have some generated code to manage my users (from sfGuard schema). I have done : propel:generate-crud frontend users sfGuardUser --with-show but I don't want to edit the 'created_at' column since it's automatically fill ... so I just unset it inside the configure() method of the base form as explain in the doc : class sfGuardUserForm extends BasesfGuardUserForm { public function configure() { unset($this-widgetSchema['created_at']); unset($this-validatorSchema['created_at']); } } But when I want to edit or crate a user (call to sfGuardUserForm) their is an exception : [InvalidArgumentException] *Widget created_at does not exist.* stack trace * at () in SF_SYMFONY_LIB_DIR\form\sfForm.class.php line 718 ... 715. { 716. if (!$widget = $this-widgetSchema[$name]) 717. { 718. throw new InvalidArgumentException(sprintf('Widget %s does not exist.', $name)); 719. } 720. 721. $values = $this-isBound ? $this-taintedValues : $this-defaults; * at sfForm-offsetGet('created_at') in SF_ROOT_DIR\apps\frontend\modules\users\templates\editSuccess.php line 50 I don't understand because I have already tested this when I read the symfony form book. It doesn't work neither if I try other colum like is_active .. i got the same exception ... !!! Can you help please ? 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: Symfony 1.1 unset form widget
Ok that's me ... I'm stupid this morning :) the problem don't come from the code below ... i have to comment the code that retrive 'created_at' int the edit template ... that's all ;) 2008/7/14 Olivier Revollat [EMAIL PROTECTED]: I tried the following code but I got *the same exception* this means that offsetExistsreturn true but I can't unset this widget !!! any idea ? class sfGuardUserForm extends BasesfGuardUserForm { public function configure() { if($this-offsetExists('created_at')){ $this-offsetUnset('created_at'); } } } 2008/7/14 CaffeineInc [EMAIL PROTECTED]: You should probably use the $form-offsetUnset('widgetName'); and make sure it exists using $form-offsetExists('widgetName'); might do some cleaning up a bit more. On Jul 14, 11:49 am, Olivier Revollat [EMAIL PROTECTED] wrote: Hello !! I have some generated code to manage my users (from sfGuard schema). I have done : propel:generate-crud frontend users sfGuardUser --with-show but I don't want to edit the 'created_at' column since it's automatically fill ... so I just unset it inside the configure() method of the base form as explain in the doc : class sfGuardUserForm extends BasesfGuardUserForm { public function configure() { unset($this-widgetSchema['created_at']); unset($this-validatorSchema['created_at']); } } But when I want to edit or crate a user (call to sfGuardUserForm) their is an exception : [InvalidArgumentException] *Widget created_at does not exist.* stack trace * at () in SF_SYMFONY_LIB_DIR\form\sfForm.class.php line 718 ... 715. { 716. if (!$widget = $this-widgetSchema[$name]) 717. { 718. throw new InvalidArgumentException(sprintf('Widget %s does not exist.', $name)); 719. } 720. 721. $values = $this-isBound ? $this-taintedValues : $this-defaults; * at sfForm-offsetGet('created_at') in SF_ROOT_DIR\apps\frontend\modules\users\templates\editSuccess.php line 50 I don't understand because I have already tested this when I read the symfony form book. It doesn't work neither if I try other colum like is_active .. i got the same exception ... !!! Can you help please ? 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: symfony 1,0 output scaping sf_request....
Thanks Ian, The only way I've managed to do it: $sf_data ['sf_request'] - getParameter ('email'); but im sure that i'm missing the point since that's an unscaped version. I did that to: $sf_data ['sf_request'] - get ('email'); [sfException] Call to undefined method sfRequest::get stack trace at () in SF_SYMFONY_LIB_DIR\request\sfRequest.class.php line 435 ... { if (!$callable = sfMixer::getCallable('sfRequest:'.$method)) { throw new sfException(sprintf('Call to undefined method sfRequest::%s', $method)); } array_unshift($arguments, $this);at sfRequest-__call('get', array('user_name'))in n/a line n/a ...at sfWebRequest- get('user_name')in SF_SYMFONY_LIB_DIR\view\escaper \sfOutputEscaperObjectDecorator.class.php line 88 ... throw new sfException('Object does not have a callable get() method.'); } return $this-value-get($key); } /**at sfOutputEscaperObjectDecorator-getRaw('user_name')in SF_SYMFONY_LIB_DIR\view\escaper \sfOutputEscaperGetterDecorator.class.php line 52 ... $escapingMethod = $this-escapingMethod; } return sfOutputEscaper::escape($escapingMethod, $this- getRaw($key)); } } at sfOutputEscaperGetterDecorator-get('user_name') in SF_ROOT_DIR\apps\frontend\modules\public_user\templates \registerSuccess.php line 18 ... td?php echo label_for('user_name', __('Rider ID')) ?/td td ?php echo form_error('user_name') ? ?php echo input_tag('user_name', $sf_data ['sf_request'] - get ('user_name')) ? /td /tr tr at require('E:\Program Files\Apache Software Foundation \Apache2.2\htdocs\sharetheride\apps\frontend\modules\public_user \templates\registerSuccess.php') in SF_SYMFONY_LIB_DIR\view\sfPHPView.class.php line 114 ... // render ob_start(); ob_implicit_flush(0); require($_sfFile); return ob_get_clean(); }at sfPHPView-renderFile('E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sharetheride\apps\frontend\modules/ public_user/templates/registerSuccess.php')in SF_SYMFONY_LIB_DIR\view \sfPHPView.class.php line 251 ... // render template file $template = $this-getDirectory().'/'.$this-getTemplate(); $retval = $this-renderFile($template); if (sfConfig::get('sf_cache') $key !== null) {at sfPHPView-render()in SF_SYMFONY_LIB_DIR\filter \sfExecutionFilter.class.php line 182 ... // render the view and if data is returned, stick it in the // action entry which was retrieved from the execution chain $viewData = $viewInstance-render(); if (sfConfig::get('sf_debug') sfConfig::get('sf_logging_enabled')) {at sfExecutionFilter-execute(object('sfFilterChain'))in SF_SYMFONY_LIB_DIR\filter\sfFilterChain.class.php line 43 ... } // execute the next filter $this-chain[$this-index]-execute($this); } } at sfFilterChain-execute()in SF_SYMFONY_LIB_DIR\filter \sfFlashFilter.class.php line 50 ...} // execute next filter $filterChain-execute(); // remove flash that are tagged to be removed $names = $userAttributeHolder-getNames('symfony/flash/remove');at sfFlashFilter-execute(object('sfFilterChain'))in SF_SYMFONY_LIB_DIR \filter\sfFilterChain.class.php line 43 ... } // execute the next filter $this-chain[$this-index]-execute($this); } } at sfFilterChain-execute()in SF_SYMFONY_LIB_DIR\filter \sfCommonFilter.class.php line 29 ... public function execute($filterChain) { // execute next filter $filterChain-execute(); // execute this filter only once $response = $this-getContext()-getResponse();at sfCommonFilter- execute(object('sfFilterChain'))in SF_SYMFONY_LIB_DIR\filter \sfFilterChain.class.php line 43 ... } // execute the next filter $this-chain[$this-index]-execute($this); } } at sfFilterChain-execute()in SF_SYMFONY_LIB_DIR\filter \sfWebDebugFilter.class.php line 35 ...} // execute next filter $filterChain-execute(); $context= $this-getContext(); $response = $context-getResponse();at sfWebDebugFilter- execute(object('sfFilterChain'))in SF_SYMFONY_LIB_DIR\filter \sfFilterChain.class.php line 43 ... } // execute the next filter $this-chain[$this-index]-execute($this); } } at sfFilterChain-execute()in SF_SYMFONY_LIB_DIR\filter \sfRenderingFilter.class.php line 33 ... public function execute($filterChain) { // execute next filter $filterChain-execute(); if (sfConfig::get('sf_logging_enabled')) {at sfRenderingFilter-execute(object('sfFilterChain'))in SF_SYMFONY_LIB_DIR\filter\sfFilterChain.class.php line 43 ... } // execute the next filter $this-chain[$this-index]-execute($this); } } at sfFilterChain-execute()in SF_SYMFONY_LIB_DIR\controller \sfController.class.php line 276 ...} // process the filter chain $filterChain-execute(); } else {at sfController-forward('public_user', 'register')in
[symfony-users] putting non-symfony code in web folder
hi- i have a symfony site and a non-symfony site, which is a sort of microsite. i would like the microsite to be called like this: http://www.example.com/microsite but, i'm running into problems with 404s, since symfony doesn't recognize 'microsite' as a module. any ideas? thanks, laura --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---