#1511: When running fromArray on an array that has a null value on a field that
Doctrine expects to be an array, it throws an error.
-----------------------------------+----------------------------------------
 Reporter:  jpuro                  |       Owner:  jwage
     Type:  defect                 |      Status:  new  
 Priority:  major                  |   Milestone:       
Component:  Attributes             |     Version:  1.0.2
 Keywords:                         |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  0    
-----------------------------------+----------------------------------------
 When trying to merge in an array into one of my retrieved objects from
 the database, one of the collections of the merged array has a
 null value.  The problem is that Doctrine is expecting it to be set,
 and PHP throws the following exception:

 "Argument 1 passed to Doctrine_Record::fromArray() must be an array, null
 given, called in
 C:\dev\Apache2.2\htdocs\epicQuote\php\amfphp\services\lib\Doctrine\Record.php
 on line 1464 and defined"

 The solution is to do a check right before the the recursive function
 call to fromArray on line 1464 so that it makes sure the value passed
 to the fromArray is actually an array.  When I did this change to my
 local copy it seems to have fixed the issue:

                 if ( is_array($value) ) {
                   $this->$key->fromArray($value, $deep);
                 }

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1511>
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