title: Symfony: problem saving a form object
body: <p>I am using SF 1.4.8 with Propel ORM for a project. I have an action that allows a user to save their user profile. It looks something like this:</p>
  
  <pre><code>public function executeEditUser(sfwebRequest $request)
  {
      // some code commented out for brevity
      $tainted_values = $user_profile-&gt;toArray(BasePeer::TYPE_FIELDNAME);   
  
      $this-&gt;form-&gt;bind(array_merge($tainted_values, $form_params), $file_params);
  
      if ($this-&gt;form-&gt;isValid())
      {
          $this-&gt;form-&gt;save();
          return $this-&gt;redirect('@user_account');
      }    
  }
  </code></pre>
  
  <p>The User form class overrides the doSave() and Update() methods as follows:</p>
  
  <pre><code>protected function doSave($con = null)
  {
      $profile = $this-&gt;getObject();
      // code commented out (saving files etc)
  
       return parent::doSave($con);
  }
  
  public function updateObject($values = null)
  {
      $object = parent::updateObject($values);
      $paththname = $object-&gt;getPictPath();
  
      if (!empty($pathname))
      {
          $image_name = basename($pathname);
          $object-&gt;setPictPath($image_name);
      }
      return $object;
  }
  </code></pre>
  
  <p>When the user edits and saves the profile - the code runs as normal, but the object does not get updated in the database. I stepped through the code and in the save() method of the form, the object execution path indicates that no changes have been made to the object (even though the user entered values were correctly bound and the validate() method returned true.</p>
  
  <p>Here is a stacktrace of warnings printed in the Apache error log file:</p>
  
  <pre><code>[Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   1. {main}() /home/voidstar/work/webdev/frameworks/symfony/sites/mywebsite/web/frontend_dev.php:0, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   2. sfContext-&gt;dispatch() /home/voidstar/work/webdev/frameworks/symfony/sites/mywebsite/web/frontend_dev.php:13, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   3. sfFrontWebController-&gt;dispatch() /lib/vendor/symfony/symfony-1.4.8/lib/util/sfContext.class.php:170, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   4. sfController-&gt;forward() /lib/vendor/symfony/symfony-1.4.8/lib/controller/sfFrontWebController.class.php:48, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   5. sfFilterChain-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/controller/sfController.class.php:238, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   6. sfRenderingFilter-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfFilterChain.class.php:53, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   7. sfFilterChain-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfRenderingFilter.class.php:33, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   8. sfGuardRememberMeFilter-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfFilterChain.class.php:53, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP   9. sfFilterChain-&gt;execute() /home/voidstar/work/webdev/frameworks/symfony/sites/mywebsite/plugins/sfGuardPlugin/lib/sfGuardRememberMeFilter.class.php:53, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  10. sfBasicSecurityFilter-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfFilterChain.class.php:53, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  11. sfFilterChain-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfBasicSecurityFilter.class.php:72, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  12. sfGoogleAnalyticsFilter-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfFilterChain.class.php:53, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  13. sfFilterChain-&gt;execute() /home/voidstar/work/webdev/frameworks/symfony/sites/mywebsite/plugins/sfGoogleAnalyticsPlugin/lib/filter/sfGoogleAnalyticsFilter.class.php:45, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  14. sfExecutionFilter-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfFilterChain.class.php:53, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  15. sfExecutionFilter-&gt;handleAction() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfExecutionFilter.class.php:42, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  16. sfExecutionFilter-&gt;executeAction() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfExecutionFilter.class.php:78, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  17. sfActions-&gt;execute() /lib/vendor/symfony/symfony-1.4.8/lib/filter/sfExecutionFilter.class.php:92, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  18. userActions-&gt;executeEditProfile() /lib/vendor/symfony/symfony-1.4.8/lib/action/sfActions.class.php:60, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  19. sfFormObject-&gt;save() /home/voidstar/work/webdev/frameworks/symfony/sites/mywebsite/apps/frontend/modules/user/actions/actions.class.php:68, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  20. UserProfileForm-&gt;doSave() /lib/vendor/symfony/symfony-1.4.8/lib/form/addon/sfFormObject.class.php:130, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  21. sfFormObject-&gt;doSave() /home/voidstar/work/webdev/frameworks/symfony/sites/mywebsite/lib/form/core/UserProfileForm.class.php:119, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  22. UserProfileForm-&gt;updateObject() /lib/vendor/symfony/symfony-1.4.8/lib/form/addon/sfFormObject.class.php:159, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  23. sfFormObject-&gt;updateObject() /home/voidstar/work/webdev/frameworks/symfony/sites/mywebsite/lib/form/core/UserProfileForm.class.php:136, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP  24. sfFormPropel-&gt;processValues() /lib/vendor/symfony/symfony-1.4.8/lib/form/addon/sfFormObject.class.php:181, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in /home/voidstar/work/webdev/frameworks/symfony/sites/mywebsite/lib/model/core/om/BaseUserProfile.php on line 2903, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  [Thu Jun 09 12:46:49 2011] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://mywebsite.localhost/frontend_dev.php/members/user/profile
  </code></pre>