Ticket #315 (closed defect: duplicate)
Transfer Scaffolding inserts "wrong" ID name for related items
| Reported by: | stephenmoretti | Owned by: | boomfish |
|---|---|---|---|
| Priority: | high | Milestone: | 3.1 Maintenance Beta |
| Version: | 2.0.304 | Severity: | major |
| Keywords: | TransferORM, Unity | Cc: |
Description
I was scaffolding a couple of simple crud applications and kept getting an error from the edit form for fields in a plural relationship. It seems that the view generator is inserting the wrong primary key field name.
Looking at it further, the object XML the sourceKey field for the related item was showing the column name, which is correct in most cases. However, we have some legacy components that require the ID field of a table to be "ID", where as I have "tablenameID". To compensate I used the alias property in the transfer package to set the primary key name to "ID".
Looking in the Transfer Adapter, when the sourceKey is set for a primary key it doesn't take into account if there is an alias and hence why I was getting an error.
Anyway, hope that makes sense. Attached is a patch, so that if a PK field has an alias the adapter uses the alias rather than the name.
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)