Ticket #1106 (closed defect: worksforme)

Opened 13 months ago

Last modified 10 months ago

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

Change History

Changed 13 months ago by jasoneisen

  • description modified (diff)

Changed 13 months ago by isleshocky77

  • has_patch unset
  • mystatus set to Pending User Response
  • has_test set

Created a test case for this ticket in r4505 . I cannot get it to fail; however, I'm using the User hasMany Group from the test suite. If this is still not working for you please update the test file to use your model setup. I wonder if it might be your model setup.

Changed 12 months ago by anonymous

  • milestone 0.11.3 deleted

Milestone 0.11.3 deleted

Changed 12 months ago by romanb

  • milestone changed from 0.11.1 to 1.0.0-BETA1

Changed 12 months ago by guilhermeblanco

  • status changed from new to closed
  • resolution set to worksforme

Unable to reproduce. Reopen the ticket when you have a failing test case.

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.