blueriver/MuraCMS — pull request #1706 by cameroncf (2014-12-17 16:13:42+00:00)
Title: UserBean addAddress() Fix

The setAllValues() on the user save nukes the newAddresses value and the cfif statement never evaluates to true. A test case for this bug would be something along the lines of:

user = $.getBean( "User" ).loadBy( userId = 'some-user-id' );
address = $.getBean("addressBean");
address.setAddress1( 'Hello World Ave' );
user.addAddress(address);
user.save(); // The address doesn't get saved here

This change just temporarily saves the address values so they can exist after the user save. I also added in some error checking so the addresses don't save if the user object failed to save.