CRM-20598 Phone ext in profile edit mode is messing up with address #11978
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Using a profile with phone+ext field is messing with the contact address in edit mode.
Before
To reproduce :
create a profile with "Phone and Extension" on primary field and some primary address fields (street, city, country)
use the profile in edit mode : e.g. http://example.com/civicrm/profile/view?reset=1&id=3&gid=1
first time, with no phone and address data, every is fine. Second time, with already existing address in the database, the address is removed.
After
Fixed
Technical Details
This is a reviewer's cut of #10377 which stalled on another unit test failing. As such I'm setting to merge-on-pass. I altered it in minor ways - mostly extracting to another function for readability & adding a few lines to the unit test
Comments
Thanks for writing a test for this @samuelsov - I found this because I was looking for something that could be resolved out of the queue & searched for items with the 'has-test' label & decided that the reason this was never getting through was it had fallen so far back that everytime someone evaluated it they got the tests to run to understand the problem, but then the test results had been wiped by the time the next person looked.