#1415: import data from yml, problem with dates and postgres
-----------------------------------+----------------------------------------
 Reporter:  lucassus               |       Owner:  jwage
     Type:  defect                 |      Status:  new  
 Priority:  minor                  |   Milestone:  1.0.1
Component:  Import/Export          |     Version:  1.0  
 Keywords:                         |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  0    
-----------------------------------+----------------------------------------
 When I'm trying import data from this yaml:
 {{{
 Store_Product_Item:

     Store_Product_2:
         sku:            philippi_260010
         name:           Klocki
         categories:     [Store_Category_Decorations1_1,
 Store_Category_Kids1_1_4]
         description:    "Lorem ipsum dolor sit amet."
         price:          60.50
         not_available_to: <?= date('Y-m-d', strtotime('+1 week')) ?>
 }}}

 Postgres throws exception:
 {{{
 Fatal error: Uncaught exception 'Doctrine_Connection_Pgsql_Exception' with
 message 'SQLSTATE[22007]: Invalid datetime format: 7 ERROR:  invalid input
 syntax for type date: "1220911200"' in
 /var/www/redmachine/lib/Doctrine/Connection.php:1074
 }}}

 The reason is that Doctrine's yaml parser (Doctrine_Parser_sfYaml_Inline)
 casts string with date to timestamp. Unfortunately postgres doesn't
 understand timestamps when I have column with date type.

 Everything works when I comment out this code
 (Doctrine_Parser_sfYaml_Inline, line: 391):
 {{{
 //case preg_match(self::getTimestampRegex(), $scalar):
 //  return strtotime($scalar);
 }}}

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1415>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" 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.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to