Yii Framework Forum: Getting form data to a CActiveRecord model works for one model but not for another - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Getting form data to a CActiveRecord model works for one model but not for another Rate Topic: -----

#1 User is offline   petruza 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 38
  • Joined: 12-July 10

Posted 19 July 2010 - 12:42 PM

I'm getting a submitted form in this way:
$resume->attributes = $_POST['ResumeModel'];
$profile->attributes = $_POST['UserProfile'];

Both CActiveRecord models are correctly populated before this from the corresponding tables, they have the correct data and all.
Both models' data is present on $_POST as modified by the form.
But it seems that the assignment to the attributes property works only for $profile and not for $resume.
If I check their values after that assignment, $profile doesn't get the edits from the form.
Is there something in the definition of the model that can cause that? As far as I can see, both models are similarly implemented
I don't understand why this happens, does anyone have a clue?
Thanks!
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 19 July 2010 - 01:20 PM

Safe attributes maybe?
http://www.yiiframew...ute-assignments
0

#3 User is offline   petruza 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 38
  • Joined: 12-July 10

Posted 19 July 2010 - 06:15 PM

View PostMike, on 19 July 2010 - 01:20 PM, said:


Indeed, thanks!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users