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

dev/core#1473 - Missing address on /user when location type label dif… #16100

Merged
merged 1 commit into from
Jan 1, 2020

Conversation

jitendrapurohit
Copy link
Contributor

…fers from its name

Overview

Missing address on /user when location type label differs from its name.

Before

To replicate -

  • Update label of some location type. Eg Home -> HomeEdited
  • Visit /user and notice the warnings displayed on the page.

image

  • No address is printed for the contact -

image

After

Notice Error fixed which displays the address values correctly -

image

Comments

Gitlab - https://lab.civicrm.org/dev/core/issues/1473

@civibot civibot bot added the master label Dec 13, 2019
@civibot
Copy link

civibot bot commented Dec 13, 2019

(Standard links)

@demeritcowboy
Copy link
Contributor

I tested this and it works in terms of making it appear, but a couple of r-run things are confusing me so give me a little bit to do a fuller review and sort out which are related and not.

@demeritcowboy
Copy link
Contributor

Ok I've narrowed it down to one real issue and one "concern". The real issue is that this fixes the bug but introduces a new bug, but the old bug is worse than the new bug so overall it's an improvement. Does that make sense? Ok, details:

  • General standards
    • [r-explain] PASS
    • [r-user] PASS
    • [r-doc] PASS
    • [r-run] Issue
      • Tested adding IM and website to the profile. What's happening now with both of those is that if you do the following it ends up outputting the name as part of the output. It worked properly before the patch.
        • Change the Yahoo IM provider option to Yahoo-x.
        • Add IM Primary to the stock "name and address" profile.
        • On a contact that has a yahoo IM filled in visit the /user page.
        • Not in the field label but in the actual value, it will show screenname (Yahoo), instead of screenname (Yahoo-x).
        • It's similar for website - it will be something like https://www.example.com (Work), instead of whatever "Work" was changed to.
      • (Not an issue just was confusing) The field label on the profile still has the original "Home" wording, but that's because the profile itself has a field where you set the field label. In any case it's not what the PR is about, just was confusing since it seemed related at first.
  • Developer standards
    • [r-tech] PASS
    • [r-code] PASS with comments
      • I'm not sure about the decision to use buildOptions. All the buildOptions calls just end up calling PseudoConstant::get anyway without doing anything else, so could just change the existing PseudoConstant::get call to add the $context parameter, e.g. CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', [], 'validate').
      • If for whatever reason it's decided to use buildOptions, then while it ends up not mattering here the address one uses BAO while the other two use DAO. It feels like using BAO would be better, since then if someone adds an override function in the BAO it's in the right place and will get called.
    • [r-maint] Undecided
    • [r-test] PASS

…fers from its name

Fix issues found by demerit
@jitendrapurohit
Copy link
Contributor Author

Thanks for the detailed testing @demeritcowboy The above issue should be fixed now. Can you pls test and confirm?

@demeritcowboy
Copy link
Contributor

Thanks @jitendrapurohit I retested and it looks ok. That getValues function seems difficult to work with so the inconsistency in $context is difficult to avoid.

@yashodha
Copy link
Contributor

@demeritcowboy Is this ready to merge after the changes?

@demeritcowboy
Copy link
Contributor

Go for it.

@yashodha
Copy link
Contributor

yashodha commented Jan 1, 2020

@demeritcowboy thanks! I am merging this now.

@yashodha yashodha merged commit c323e9e into civicrm:master Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants