-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Fixes issue with duplicate is_billing on inline address forms. #22850
Conversation
(Standard links)
|
In regards to the failed tests, I can't seem to find any relevance with my code or why my code is causing these errors. If I'm not mistaken, they refer to something else. If someone can shed some light, I would highly appreciate it ! |
At line 452 you are creating a brand new address record - was that intended to be something else? |
Ohhh ... 🤦♂️ I definitely forgot to remove those 4 lines of code from the function that I repurposed! Sharp eyes @demeritcowboy , I'll issue a fix right now. |
7421860
to
a7dd4cc
Compare
Squashed commits |
|
@eileenmcnaughton can you merge this? |
@jaapjansma I did see your last comment but this to my mind absolutely requires a unit test & I can't personally merge it without one. I did merge another one today that had been marked as not requiring a test even though I felt uncomfortable - but this is deep in the BAO layer and we already have tests around the matching is_primary functionality. I did mentally add it to my 'long-list' of things to do last time as I understand requests to merge things that I can't merge without a test as a request that I write the unit test. |
@VangelisP are you able to provide a unit test? As per @eileenmcnaughton and @demeritcowboy comment? |
While I haven't written a unit test before, I totally understand you and I am willing to give it a try, heading for a similar test as with |
@VangelisP yep! |
Although I am not quite sure why this failed nearly instantly, this is my take on the PHPUnit test with I tried without the patch and it fails (obviously) and with the patch, it succeeds. What fails? Assigned into a contact 2 addresses with |
Thanks for the test. There's fails on all the PRs right now since something is wrong with the server. |
jenkins retest this please |
Thanks for the fix @VangelisP |
Overview
In the case that someone has 2 addresses registered, they can flag both of them as billing location via the inline address editing checkbox which I believe is wrong. This behaviour does not replicate when you edit the contact.
I am assuming that this is not an intended behaviour. Source Issue: https://lab.civicrm.org/dev/core/-/issues/3080
Before
No validation takes place when someone checks the "billing location" via the inline address editing which means that a contact can have multiple billing addresses.
After
There should be a validation while saving the inline address form to check if the checkbox is already being used in another address ID and if yes, it should not store the checkbox (or unset it).