Ticket #1106 (closed defect: worksforme)
Saving related records doesn't work
| Reported by: | jasoneisen | Owned by: | romanb |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Record | Version: | 0.11.0 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | yes | |
| Status: | Pending User Response | Has Patch: | no |
Description (last modified by jasoneisen) (diff)
Doesn't work in either RC2 or RC3. This is my step by step output trying to save a related record. Any columns changed on the $company record itself are saved fine.
echo "Original address: ". $company->Contacts[0]->contact_address1 ." ";
$company->Contacts[0]->contact_address1 = "adsfsdafsd";
echo "Address after setting it: ". $company->Contacts[0]->contact_address1 ." "; echo "Address array: ";
print_r($company->Contacts[0]->toArray()); $company->save();
echo "Address after saving it: ". $company->Contacts[0]->contact_address1 ." "; $contact = Doctrine::getTable('Contact')->find($company->Contacts[0]->contact_id);
echo "Address after querying: ". $company->Contacts[0]->contact_address1 ." "; I've tried this on RC2 and RC3. Anything $company columns save fine, but no related records do. This my step by step output for saving a related company address field.
echo "Saved Address: ".$contact->contact_address1;
// OUTPUT
Original address: 123 Test Sts
Address after setting it: adsfsdafsd
Address array: Array
(
[contact_id] => 20
[company_id] => 289
[contact_address1] => adsfsdafsd
[contact_address2] => asdfasdfsd
[contact_city] => Lexington
[state_id] => 18
[country_id] =>
[contact_zip] => 40404
[contact_phone] => 0123456789
[contact_fax] => 1234567890
[contact_cell] =>
)
Address after saving it: adsfsdafsd
Address after querying: 123 Test Sts
Saved Address: 123 Test Sts