Hi guys.
I have a module Company where Primary key is called logo and it is
varchar.
I have another module (invoice) where there is a foreign key for
Company. So in form for Invoice module I use this:
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'company_logo' => new sfWidgetFormPropelChoice(array
('model' => 'Company ', 'add_empty' => true)),
.....
Which creates a select with value company_logo which is what I expect.
I have this for a validation:
$this->setValidators(array(
'id' => new sfValidatorPropelChoice(array('model'
=> 'Invoice', 'column' => 'id', 'required' => false)),
'company_logo' => new sfValidatorPropelChoice(array('model'
=> 'Company ', 'required' => false)),
When I submit form, I get a Propel error:
'id' could not be found in the field names of type 'fieldName'. These
are: Array
(
[logo] => 0
[company_name] => 1
...
)
So why? logo is a primary key so when I use sfValidatorPropelChoice
without setting column value, it is set to null which should be a
primary key of Company module. Even if I set it:
sfValidatorPropelChoice(array('model' => 'Company ', 'column' =>
'logo', 'required' => false)),
It still trigger this error. Code for sfValidatorPropelChoice looks
fine so I don't know where is 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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---