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

Deprecate dupeQuery hook #29544

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add deprecation notice to hook_civicrm_dupeQuery
  • Loading branch information
colemanw committed Mar 1, 2024
commit b8b80ebec85fc982e0064f193af29cca7354d3b9
2 changes: 1 addition & 1 deletion CRM/Dedupe/BAO/DedupeRuleGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static function supportedFields($requestedType): array {
}
}
//Does this have to run outside of cache?
CRM_Utils_Hook::dupeQuery(CRM_Core_DAO::$_nullObject, 'supportedFields', $fields);
CRM_Utils_Hook::dupeQuery(NULL, 'supportedFields', $fields);
Civi::$statics[__CLASS__]['supportedFields'] = $fields;
}

Expand Down
8 changes: 5 additions & 3 deletions CRM/Utils/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -1627,15 +1627,17 @@ public static function export(&$exportTempTable, &$headerRows, &$sqlColumns, $ex
* Type of queries e.g table / threshold.
* @param array $query
* Set of queries.
*
* @return mixed
*/
public static function dupeQuery($obj, $type, &$query) {
$null = NULL;
return self::singleton()->invoke(['obj', 'type', 'query'], $obj, $type, $query,
$original = $query;
self::singleton()->invoke(['obj', 'type', 'query'], $obj, $type, $query,
$null, $null, $null,
'civicrm_dupeQuery'
);
if ($original !== $query) {
CRM_Core_Error::deprecatedWarning('hook_civicrm_dupeQuery is deprecated.');
}
}

/**
Expand Down