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

[REF] Code cleanup on location entities for the Contact Summary screen #22967

Merged
merged 1 commit into from
Apr 10, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Builds on #22966 & cleans up location fetching with a view to reducing complexity & notices

Before

2 problems
1) the code is really confusing - handling the loading in 2 places
2) not all keys are loaded - resulting in enotices at the tpl layer.

After

most - not yet address - location entities loaded in one function with mapping done in the same function, all fields loaded so less notices

Technical Details

Comments

@civibot
Copy link

civibot bot commented Mar 18, 2022

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy Can I get you to check this one (I just rebased to see if it passes first) - it prevents a really annoying set of notices in smarty secure

1 similar comment
@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy Can I get you to check this one (I just rebased to see if it passes first) - it prevents a really annoying set of notices in smarty secure

@eileenmcnaughton
Copy link
Contributor Author

ug - it failed - on your new test I think - yay

testContactSummary

This builds on civicrm#22966 to improve loading of location entities.

It addresses 2 problems
1) the code is really confusing - handling the loading in 2 places
2) not all keys are loaded - resulting in enotices at the tpl layer.

Note that address still seems kinda tricky so I haven't worked through
that in this PR.
@demeritcowboy
Copy link
Contributor

There is a lot going on in here. This might take a while.

@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy yeah - hopefully it's not as crazy as it looks - but I did take a while to figure out what the original code was doing (there is a bunch more of the original stuff that should be removable after this with a bit more work)

@demeritcowboy
Copy link
Contributor

jenkins retest this please

@demeritcowboy
Copy link
Contributor

Even though it's not a big PR in terms of lines of code, there was a lot to look at here and I had to do it in pieces over a couple days. I'm not sure if there's a way to make that easier for similar PRs, but anyway see comments below.

  • General standards
    • [r-explain] PASS
    • [r-user] PASS
    • [r-doc] PASS
    • [r-run] PASS
      • Ok.
      • The custom fields also still seem to work ok.
  • Developer standards
    • [r-tech] PASS with comments
      • It switches to api4 which changes the permissions model to check_permission=true, but I can't think how it matters here.
      • It bypasses the DAO level string "null" handling, but other than it displaying "null" I can't see how it matters for these fields since I'm not sure how they would be "null". And if something is setting them to string null then should probably address that.
      • It changes the ordering and the indexing of the arrays, but I can't see where it matters.
      • It no longer runs the "lookup" loop for some of the types but I can't find any differences.
    • [r-maint] PASS
    • [r-code] PASS
    • [r-test] PASS

@demeritcowboy demeritcowboy merged commit d1bae2d into civicrm:master Apr 10, 2022
@eileenmcnaughton
Copy link
Contributor Author

Thanks @demeritcowboy - I appreciate you following me into this rather nasty code!

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.

2 participants