This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » sfGuardPlugin error: sfWidgetFormChoice does not support the following options: 'with_empty'
sfGuardPlugin error: sfWidgetFormChoice does not support the following options: 'with_empty' [message #102793] Tue, 20 July 2010 11:49 Go to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Hi all

Just got a new symfony 1.3 installation, and have installed sfGuardPlugin 4.0.1 into it. I've enabled it, and build schema/model/filters from an Oracle database using Propel 1.5.

I've created a backend application and am trying to access the sfGuardUser module, and I get this error:

500 | Internal Server Error | InvalidArgumentException

sfWidgetFormChoice does not support the following options: 'with_empty'.

It is clearly objecting to part of this base form filter class:

abstract class BasesfGuardUserFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'username'                      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'algorithm'                     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'salt'                          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'password'                      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_at'                    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'last_login'                    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'is_active'                     => new sfWidgetFormChoice(array('with_empty' => false)),
      'is_super_admin'                => new sfWidgetFormChoice(array('with_empty' => false)),
      'sf_guard_user_group_list'      => new sfWidgetFormPropelChoice(array('model' => 'sfGuardGroup', 'add_empty' => true)),
      'sf_guard_user_permission_list' => new sfWidgetFormPropelChoice(array('model' => 'sfGuardPermission', 'add_empty' => true)),
    ));

Any ideas?


Remember Palestine
Re: sfGuardPlugin error: sfWidgetFormChoice does not support the following options: 'with_empty' [message #102797 is a reply to message #102793 ] Tue, 20 July 2010 13:32 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I've dropped back down to Propel 1.4, and it seems the correct filters are now generated. The problematic code is now removed from the base filter class, thus:

abstract class BasesfGuardUserFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'username'                      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'algorithm'                     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'salt'                          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'password'                      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_at'                    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'last_login'                    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'is_active'                     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_super_admin'                => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'sf_guard_user_group_list'      => new sfWidgetFormPropelChoice(array('model' => 'sfGuardGroup', 'add_empty' => true)),
      'sf_guard_user_permission_list' => new sfWidgetFormPropelChoice(array('model' => 'sfGuardPermission', 'add_empty' => true)),
    ));

I will report a bug to the Propel project pronto - and must say I am quite surprised that the error does not generate much in the way of search engine results. Is no-one fully using Propel 1.5 with symfony?


Remember Palestine
Re: sfGuardPlugin error: sfWidgetFormChoice does not support the following options: 'with_empty' [message #102811 is a reply to message #102793 ] Tue, 20 July 2010 16:57 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Raised on the symfony trac here.


Remember Palestine
Re: sfGuardPlugin error: sfWidgetFormChoice does not support the following options: 'with_empty' [message #102860 is a reply to message #102793 ] Wed, 21 July 2010 11:52 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I have been able to confirm on that ticket that the same problem is experienced with the head revision also.


Remember Palestine
Re: sfGuardPlugin error: sfWidgetFormChoice does not support the following options: 'with_empty' [message #103474 is a reply to message #102793 ] Tue, 03 August 2010 12:43 Go to previous message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
This problem looks like it is related only to the Propel 1.5 plugin, and specifically not for MySQL settings. It seems to come about if Oracle settings are specified in propel.ini - see trac ticket.


Remember Palestine
Previous Topic:Mutual foreign keys might be confusing Propel 1.5?
Next Topic:Undefined Method: SimpleXMLElement::__toString()
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software