-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
Add system status check for missing dedupe rules #22369
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Standard links)
|
colemanw
reviewed
Jan 4, 2022
colemanw
reviewed
Jan 4, 2022
braders
force-pushed
the
dedupeRulesSystemCheck
branch
from
January 4, 2022 22:51
89348cd
to
e1307c2
Compare
colemanw
reviewed
Jan 4, 2022
braders
force-pushed
the
dedupeRulesSystemCheck
branch
from
January 5, 2022 10:27
e1307c2
to
0e703c2
Compare
colemanw
reviewed
Jan 5, 2022
I've given this |
colemanw
added
the
merge ready
PR will be merged after a few days if there are no objections
label
Jan 5, 2022
braders
force-pushed
the
dedupeRulesSystemCheck
branch
from
January 5, 2022 16:45
0e703c2
to
7a5b11d
Compare
colemanw
added
merge on pass
and removed
merge ready
PR will be merged after a few days if there are no objections
labels
Jan 5, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
As discussed in core#2918, CiviCRM assumes that
Unsupervised
andSupervised
dedupe rules will always exist, but allows the system to get into a state where onlyGeneral
rules are actually configured. This adds a system check to warn when eitherUnsupervised
orSupervised
dedupe rules are missing.Before
It was possible to configure CiviCRM without either
Unsupervised
orSupervised
dedupe rules. This can lead to exceptions being thrown, blocking certain functionality from working correctly. For example:After
If dedupe rules have not been configured correctly, system messages will be shown warning the user that they should review their configuration. A link to the dedupe contacts screen is included, and from here the configuration can be changed:
Note that it's still too easy (in my opinion) to get into a bad state, and I'd still like to implement the UI improvements suggested on core#2918 if I can find time.
Technical Details
The code felt tidiest when split into two check functions, both using a shared
getContactTypesForRule
method. This does mean that two very similar database queries are required, rather than a single query. However, I belive this should be a fairly efficient database call and so I don't think this should be a massive problem.I've not included tests because:
CRM/Utils/Check/Component/
had tests which I could use as a reference.Comments
I wasn't 100% sure which severity and icon to go for. I've settled on
\Psr\Log\LogLevel::WARNING
andfa-server
, but did very much wonder if\Psr\Log\LogLevel::ERROR
would be more appropriate.