Problem with sfDoctrinePlugin code generator:
For regular fields like int, string... When no value is input in the
form, an empty string is passed to Doctrine. This does not work for int
as an empty string is not a valid integer.
Checking for an empty string and passing null in that case works and
makes more sense even for strings as it sets a null value in the DB
instead of an empty string:
in data/generator/sfDoctrineAdmin/template/actions/action.class.php:
<?php else: ?>
if ($<?php echo $this->getSingularName() ?><?php echo $name ?>?
== )
$this-><?php echo $this->getSingularName() ?>->set('<?php echo
$column->getName() ?>', null);
else
$this-><?php echo $this->getSingularName() ?>->set('<?php echo
$column->getName() ?>', $<?php echo $this->getSingularName() ?>['<?php
echo $name ?>']);
<?php endif; ?>