pungpoo / giix

Automatically exported from code.google.com/p/giix
0 stars 0 forks source link

Related data is not saved when new record is created #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create new model record with related data
2. Save with saveRelatedData function

What is the expected output? What do you see instead?
The main model record should be saved and all the related data should be saved 
as well.  Instead, nothing is saved and the browser is returned to the create 
page.

What version of the product are you using? On what operating system?
yii 1.1.6 and giix 1.3

Please provide any additional information below.
I have attached a patch file to correct this issue.  The root of this issue was 
that the primary key of the main model was being used before the model was 
saved.  Thus, for new records, the primary key was null, until after the main 
model is saved.  I simply moved the code that depends on the primary key value 
to execute after the main model was saved and thus the primary key is populated 
for new and existing records.

Original issue reported on code.google.com by keith.w....@gmail.com on 11 Mar 2011 at 5:01

Attachments:

GoogleCodeExporter commented 8 years ago
Issue 9 has been merged into this issue.

Original comment by rodrigo.coelho@gmail.com on 19 Apr 2011 at 4:11

GoogleCodeExporter commented 8 years ago
That patch does not seem to be for the code in Trunk version. Am I doing 
something wrong ?

Original comment by emrek...@gmail.com on 19 Apr 2011 at 4:27

GoogleCodeExporter commented 8 years ago
The trunk code is newer than the patch. Maybe that's the difference you're 
seeing.

Original comment by rodrigo.coelho@gmail.com on 19 Apr 2011 at 4:41

GoogleCodeExporter commented 8 years ago
Fixed by revision 69.

Original comment by rodrigo.coelho@gmail.com on 4 May 2011 at 5:56