Hi Everyone I see the same problem as mentioned by this post (http:// groups.google.com/group/symfony-users/browse_thread/thread/ 41f54b8c71ce607f/ad08bf3766215dce?lnk=gst&q=user +profile#ad08bf3766215dce - I have noted something strange about sfGuard 3.1.1.
I created a table UserProfile for my project. Which is the profile_class for sfGuardUser. I get an error 500 everytime someone logins with a user that is created directly from sfGuardUser's admin pages.) but the solution (re- build the filters) does not work. The reason I think the solution does not work is because none of the filter files change (SVN does not detect a modification). Note: I created the table first then ran propel:build-all-load, I then created a config/app.yml file and included the following - all: sf_guard_plugin: success_signout_url: @homepage profile_class: UserProfile Then I ran the propel:build-all-load command again followed by propel:build-forms and propel:build-filters because propel:build-all- load gave the following warning: Phing was run before and used many custom classes that might conflict with your model classes. In case of errors try running "propel:build- forms" and "propel:build-filters" alone. This is due to a PHP limitation that cannot be fixed in symfony. A stack trace of the 500 error: 500 | Internal Server Error | PropelException Unable to execute INSERT statement. [wrapped: SQLSTATE[HY000]: General error: 1364 Field 'first_name' doesn't have a default value] stack trace * at () in SF_ROOT_DIR\lib\vendor\symfony\lib\plugins\sfPropelPlugin\lib \vendor\propel\util\BasePeer.php line 299 ... 296. 297. } catch (Exception $e) { 298. Propel::log($e->getMessage(), Propel::LOG_ERR); 299. throw new PropelException("Unable to execute INSERT statement.", $e); 300. } 301. 302. // If the primary key column is auto- incremented, get the id now. * at BasePeer::doInsert(object('Criteria'), object('DebugPDO')) in SF_ROOT_DIR\lib\model\om\BaseUserProfilePeer.php line 819 ... 816. // use transaction because $criteria could contain info 817. // for more than one table (I guess, conceivably) 818. $con->beginTransaction(); 819. $pk = BasePeer::doInsert($criteria, $con); 820. $con->commit(); 821. } catch(PropelException $e) { 822. $con->rollBack(); * at BaseUserProfilePeer::doInsert(object('UserProfile'), object ('DebugPDO')) in SF_ROOT_DIR\lib\model\om\BaseUserProfile.php line 1010 ... 1007. // If this object has been modified, then save it to the database. 1008. if ($this->isModified()) { 1009. if ($this->isNew()) { 1010. $pk = UserProfilePeer::doInsert ($this, $con); 1011. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which 1012. // should always be true here (even though technically 1013. // BasePeer::doInsert() can insert multiple rows). * at BaseUserProfile->doSave(object('DebugPDO')) in SF_ROOT_DIR\lib\model\om\BaseUserProfile.php line 959 ... 956. 957. $con->beginTransaction(); 958. try { 959. $affectedRows = $this->doSave($con); 960. $con->commit(); 961. foreach (sfMixer::getCallables ('BaseUserProfile:save:post') as $callable) 962. { * at BaseUserProfile->save(object('DebugPDO')) in SF_ROOT_DIR\plugins\sfGuardPlugin\lib\model\om \BasesfGuardUser.php line 847 ... 844. if ($this->collUserProfiles !== null) { 845. foreach ($this->collUserProfiles as $referrerFK) { 846. if (!$referrerFK->isDeleted()) { 847. $affectedRows += $referrerFK- >save($con); 848. } 849. } 850. } * at BasesfGuardUser->doSave(object('DebugPDO')) in SF_ROOT_DIR\plugins\sfGuardPlugin\lib\model\om \BasesfGuardUser.php line 790 ... 787. 788. $con->beginTransaction(); 789. try { 790. $affectedRows = $this->doSave($con); 791. $con->commit(); 792. foreach (sfMixer::getCallables ('BasesfGuardUser:save:post') as $callable) 793. { * at BasesfGuardUser->save(null) in SF_ROOT_DIR\plugins\sfGuardPlugin\lib\user \sfGuardSecurityUser.class.php line 83 ... 80. 81. // save last login 82. $user->setLastLogin(time()); 83. $user->save($con); 84. 85. // remember? 86. if ($remember) * at sfGuardSecurityUser->signIn(object('sfGuardUser'), '') in SF_ROOT_DIR\plugins\sfGuardPlugin\modules\sfGuardAuth\lib \BasesfGuardAuthActions.class.php line 37 ... 34. if ($this->form->isValid()) 35. { 36. $values = $this->form->getValues(); 37. $this->getUser()->signin($values['user'], array_key_exists('remember', $values) ? $values['remember'] : false); 38. 39. // always redirect to a URL set in app.yml 40. // or to the referer * at BasesfGuardAuthActions->executeSignin(object('sfWebRequest')) in SF_ROOT_DIR\lib\vendor\symfony\lib\action\sfActions.class.php line 53 ... 50. } 51. 52. // run action 53. return $this->$actionToRun($request); 54. } 55. } 56. * at sfActions->execute(object('sfWebRequest')) in SF_ROOT_DIR\lib\vendor\symfony\lib\filter \sfExecutionFilter.class.php line 90 ... 87. { 88. // execute the action 89. $actionInstance->preExecute(); 90. $viewName = $actionInstance->execute($this- >context->getRequest()); 91. $actionInstance->postExecute(); 92. 93. return is_null($viewName) ? sfView::SUCCESS : $viewName; * at sfExecutionFilter->executeAction(object ('sfGuardAuthActions')) in SF_ROOT_DIR\lib\vendor\symfony\lib\filter \sfExecutionFilter.class.php line 76 ... 73. return sfView::SUCCESS; 74. } 75. 76. return $this->executeAction($actionInstance); 77. } 78. 79. /** * at sfExecutionFilter->handleAction(object('sfFilterChain'), object('sfGuardAuthActions')) in SF_ROOT_DIR\lib\vendor\symfony\lib\filter \sfExecutionFilter.class.php line 42 ... 39. { 40. $timer = sfTimerManager::getTimer(sprintf ('Action "%s/%s"', $actionInstance->getModuleName(), $actionInstance- >getActionName())); 41. 42. $viewName = $this->handleAction($filterChain, $actionInstance); 43. 44. $timer->addTime(); 45. $timer = sfTimerManager::getTimer(sprintf ('View "%s" for "%s/%s"', $viewName, $actionInstance->getModuleName(), $actionInstance->getActionName())); * at sfExecutionFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR\lib\vendor\symfony\lib\filter \sfFilterChain.class.php line 53 ... 50. } 51. 52. // execute the next filter 53. $this->chain[$this->index]->execute($this); 54. } 55. } 56. * at sfFilterChain->execute() in SF_ROOT_DIR\lib\vendor\symfony\lib\filter \sfCommonFilter.class.php line 29 ... 26. public function execute($filterChain) 27. { 28. // execute next filter 29. $filterChain->execute(); 30. 31. // execute this filter only once 32. $response = $this->context->getResponse(); * at sfCommonFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR\lib\vendor\symfony\lib\filter \sfFilterChain.class.php line 53 ... 50. } 51. 52. // execute the next filter 53. $this->chain[$this->index]->execute($this); 54. } 55. } 56. * at sfFilterChain->execute() in SF_ROOT_DIR\lib\vendor\symfony\lib\filter \sfRenderingFilter.class.php line 33 ... 30. public function execute($filterChain) 31. { 32. // execute next filter 33. $filterChain->execute(); 34. 35. // get response object 36. $response = $this->context->getResponse(); * at sfRenderingFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR\lib\vendor\symfony\lib\filter \sfFilterChain.class.php line 53 ... 50. } 51. 52. // execute the next filter 53. $this->chain[$this->index]->execute($this); 54. } 55. } 56. * at sfFilterChain->execute() in SF_ROOT_DIR\lib\vendor\symfony\lib\controller \sfController.class.php line 245 ... 242. } 243. 244. // process the filter chain 245. $filterChain->execute(); 246. } 247. else 248. { * at sfController->forward('sfGuardAuth', 'signin') in SF_ROOT_DIR\lib\vendor\symfony\lib\controller \sfFrontWebController.class.php line 48 ... 45. } 46. 47. // make the first request 48. $this->forward($moduleName, $actionName); 49. } 50. catch (sfException $e) 51. { * at sfFrontWebController->dispatch() in SF_ROOT_DIR\lib\vendor\symfony\lib\util\sfContext.class.php line 159 ... 156. */ 157. public function dispatch() 158. { 159. $this->getController()->dispatch(); 160. } 161. 162. /** * at sfContext->dispatch() in SF_ROOT_DIR\web\backend_dev.php line 13 ... symfony settings ... app_sf_guard_plugin_profile_class: UserProfile app_sf_guard_plugin_success_signout_url: @homepage ------------------------------------------------- Any suggestions on how I could solve this problem? I tried deleting all the filter files and recreating them using the propel:build- filters. My plan of action is to create a new table named sfGuardUserProfile instead and see what happens. Till I get a reply from someone :). Thanks Zain --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---