tingobol / gii-template-collection

Automatically exported from code.google.com/p/gii-template-collection
0 stars 0 forks source link

FullCrud generation fail on MANY_MANY (r92) #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a FullModel using a table with MANY_MANY.
2. Try to create a FullCrud using this model.

What is the expected output? What do you see instead?
Expected: the crud generation.
Instead: a PHP error after hitting "preview":
"Undefined index: Author_has_Post(Author_id, Post_id)"
Source: protected/extensions/gtc/fullCrud/FullCrudCode.php(127)

What version of the product are you using? On what operating system?
r92

Please provide any additional information below.
The possible cause is having this piece of code:
CActiveRecord::model($model)->tableSchema->columns[$relation[2]]
Where $relation[2] does not have a column name on MANY_MANY.

Original issue reported on code.google.com by rodrigo.coelho@gmail.com on 5 Sep 2010 at 12:54

GoogleCodeExporter commented 9 years ago
Please, post the E-R model for your model? I guess: Author & Post tables.

Original comment by robregonm on 6 Sep 2010 at 3:37

GoogleCodeExporter commented 9 years ago
Attached example files: ER model image and the DDL for the tables.
There is also a patch for the issue.

Original comment by rodrigo.coelho@gmail.com on 6 Sep 2010 at 8:32

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r95.

Original comment by schm...@usrbin.de on 8 Sep 2010 at 1:50