Home » Database » DB_DataObject_FormBuilder » Bug #3853
problem rendering forms with multiple primary (sub)keys
Details
| Submitted | 2005-03-16 23:06 UTC |
|---|---|
| From | esad-public at 25novembar dot com |
| Assigned | justinpatrin |
| Status | Wont fix |
| Package | DB_DataObject_FormBuilder |
| PHP Version | 4.3.4 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-03-16 23:06 UTC] esad-public at 25novembar dot com
Description:
------------
If one DataObject has more than one primary key (see NOTE), it is impossible to show only one key.
When you specify (the wanted one) primary key in the fb_fieldsToRender, it doesn't get rendered if fb_hidePrimary is set to true. On the other hand, If you set it to false, all primary keys get rendered
NOTE: Theoretically the primary key is only one, but can be a combination of more fields - DB Object marks both fields as primary keys
Reproduce code:
---------------
class DataObjects_DealerType extends DB_DataObject
{
var $__table = 'DealerType';
var $Manufacturer_ID; // int(10) not_null primary_key multiple_key unsigned
var $Dealer_ID;// int(10) not_null primary_key multiple_key unsigned
var $fb_hidePrimaryKey = false;
var $fb_fieldsToRender=array("Manufacturer_ID","Category");
}
Expected result:
----------------
Form rendered with fields: Manufacturer_ID and Category fields
Actual result:
--------------
Form rendered with fields Manufacturer_ID, Dealer_ID, Category fields (Dealer_ID is rendered although not specifed)
[2005-03-16 23:53 UTC] esad-public at 25novembar dot com
Yes, that's what I meant.
I can see possible problems with supporting multi-column primary key (such as get()), but in this case it would be trivial to support this in FormBuilder.
Are there plans for support for multi-column primary keys in DBO at all?