Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20598 Phone ext in profile edit mode is messing up with address #10377

Closed
wants to merge 3 commits into from

Conversation

samuelsov
Copy link
Contributor

@seamuslee001
Copy link
Contributor

Jenkins re test this please

1 similar comment
@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton
Copy link
Contributor

test this please

@eileenmcnaughton
Copy link
Contributor

eileenmcnaughton commented Sep 4, 2017

Note this is something I would be uncomfortable merging without a test

@samuelsov
Copy link
Contributor Author

@eileenmcnaughton Ok, i guess you mean you want me to add a test. It could be an excellent exercise for me :)

@eileenmcnaughton
Copy link
Contributor

what a good idea :-)

@samuelsov
Copy link
Contributor Author

samuelsov commented Sep 30, 2017

It was kind of tricky to reproduce using php...
It seemed like an easy to reproduce problem but it's a bit of an edge case... we need to have a few conditions realized at the same time :

  • it's only when using the profile to update a contact and not when creating a contact
  • the user must be logged in (or we need a checksum) so that it will blank empty values
// If a user has logged in, or accessed via a checksum
// Then deliberately 'blanking' a value in the profile should remove it from their record
  • phone field must be after the address field so that phone extension will add a new empty address block at the end (otherwise the correct address will be recreated after being deleted)

Anyway, the test is there and gives an error without the patch and no error with the patch which is what we want i guess.

@samuelsov
Copy link
Contributor Author

As a side note, here is an abstract of the data array we get without the patch after formatProfileContactParams (2 addresses but only one in the profile because the phone extension has leaked in the address) :

[address] => Array
        (
            [1] => Array
                (
                    [location_type_id] => 1
                    [is_primary] => 1
                    [street_address] => Saint Helier St
                    [country_id] => 1228
                )

            [2] => Array
                (
                    [location_type_id] => 1
                    [is_primary] => 1
                )

        )

@eileenmcnaughton
Copy link
Contributor

test this please

@samuelsov
Copy link
Contributor Author

I'm not sure to understand how those failing tests are related to the PR but look like it is because other PR seems to pass the test correctly. I will have to reproduce this locally (off-topic, my testing environment is broken so it will take longer than i though... it always takes longer)

@mlutfy
Copy link
Member

mlutfy commented Mar 9, 2018

jenkins, test this please

@eileenmcnaughton
Copy link
Contributor

test this please

@mlutfy
Copy link
Member

mlutfy commented Mar 12, 2018

For reference:

CRM_Contribute_Form_ContributionTest::testSubmitCreditCardWithEmailReceipt
Failed asserting that 0 matches expected 1.

/home/jenkins/buildkit/build/core-10377-7appn/sites/all/modules/civicrm/tests/phpunit/CRM/Contribute/Form/ContributionTest.php:316
/home/jenkins/buildkit/build/core-10377-7appn/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:184
/home/jenkins/buildkit/bin/phpunit4:545

@eileenmcnaughton
Copy link
Contributor

My money is the test fail is an e-notice & the true fail is being hidden because of an issue with the test - which #11798 should fix

@seamuslee001
Copy link
Contributor

test this please

@eileenmcnaughton
Copy link
Contributor

closing in favour of #11978 which has a couple of minor tweaks and, importantly, is not on the last page :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants