Development

Changeset 3291

You must first sign up to be able to contribute.

Changeset 3291

Show
Ignore:
Timestamp:
01/15/07 22:55:21 (2 years ago)
Author:
fabien
Message:

fixed exception in admin generator when submitting non parseable date

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/data/generator/sfPropelAdmin/default/template/actions/actions.class.php

    r3288 r3291  
    247247      if ($<?php echo $this->getSingularName() ?>['<?php echo $name ?>']) 
    248248      { 
    249         $dateFormat = new sfDateFormat($this->getUser()->getCulture()); 
    250         <?php $inputPattern = ($type == CreoleTypes::DATE ? 'd' : 'g'); ?> 
    251         <?php $outputPattern = ($type == CreoleTypes::DATE ? 'i' : 'I'); ?> 
    252         $value = $dateFormat->format($<?php echo $this->getSingularName() ?>['<?php echo $name ?>'], '<?php echo $outputPattern ?>', $dateFormat->getInputPattern('<?php echo $inputPattern ?>')); 
    253         $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($value); 
     249        try 
     250        { 
     251          $dateFormat = new sfDateFormat($this->getUser()->getCulture()); 
     252          <?php $inputPattern = ($type == CreoleTypes::DATE ? 'd' : 'g'); ?> 
     253          <?php $outputPattern = ($type == CreoleTypes::DATE ? 'i' : 'I'); ?> 
     254          $value = $dateFormat->format($<?php echo $this->getSingularName() ?>['<?php echo $name ?>'], '<?php echo $outputPattern ?>', $dateFormat->getInputPattern('<?php echo $inputPattern ?>')); 
     255          $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($value); 
     256        } 
     257        catch (sfException $e) 
     258        { 
     259          // not a date 
     260        } 
    254261      } 
    255262      else