Skip to content

Instantly share code, notes, and snippets.

@icetee
Created March 23, 2020 14:59
Show Gist options
  • Save icetee/8712bf849b793e67b8dcfb4175dc6819 to your computer and use it in GitHub Desktop.
Save icetee/8712bf849b793e67b8dcfb4175dc6819 to your computer and use it in GitHub Desktop.
Drupal realname diff
diff --git a/realname.api.php b/realname.api.php
index 09e813e..d5420bd 100644
--- a/realname.api.php
+++ b/realname.api.php
@@ -53,6 +53,17 @@ function hook_realname_update($realname, $account) {
}
+/**
+ * Respond to updates to accounts
+ *
+ * @see realname_update()
+ *
+ * @ingroup realname
+ */
+function hook_realname_matches_alter(&$matches, $accounts) {
+
+}
+
/**
* @} End of "addtogroup hooks".
*/
diff --git a/src/Controller/RealnameAutocompleteController.php b/src/Controller/RealnameAutocompleteController.php
index 77aeea2..d3a16ba 100644
--- a/src/Controller/RealnameAutocompleteController.php
+++ b/src/Controller/RealnameAutocompleteController.php
@@ -99,6 +99,8 @@ class RealnameAutocompleteController extends EntityAutocompleteController {
'label' => $this->t('@realname (@username)', ['@realname' => $account->getDisplayName(), '@username' => $account->getAccountName()]),
];
}
+
+ \Drupal::moduleHandler()->alter('realname_matches', $matches, $accounts);
}
return $matches;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment