Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CiviCRM for Drupal 8 patch
diff --git a/civicrm.install b/civicrm.install
index a6bbc99..2531b4c 100644
--- a/civicrm.install
+++ b/civicrm.install
@@ -60,6 +60,7 @@ function civicrm_install() {
* @param $phase
*/
function civicrm_requirements($phase) {
+# require_once DRUPAL_ROOT . "/modules/libraries/libraries.module";
$requirements = array();
$civicrm_base = _civicrm_find_civicrm();
@@ -126,13 +127,13 @@ function civicrm_requirements($phase) {
function _civicrm_find_civicrm() {
if ($path = drupal_get_path('module', 'civicrm')) {
if (file_exists($path . '/CRM/Core/ClassLoader.php')) {
- return \Drupal\Core\File\FileSystem::realpath($path);
+ return \Drupal::service('file_system')->realpath($path);
}
}
if ($path = libraries_get_path('civicrm')) {
if (file_exists($path . '/CRM/Core/ClassLoader.php')) {
- return \Drupal\Core\File\FileSystem::realpath($path);
+ return \Drupal::service('file_system')->realpath($path);
}
}
diff --git a/civicrm.module b/civicrm.module
index c4502a9..a8021b9 100644
--- a/civicrm.module
+++ b/civicrm.module
@@ -93,7 +93,7 @@ function civicrm_entity_extra_field_info() {
* We use this hook to add the pseudo-fields we've added in civicrm_entity_extra_field_info()
* to the user display.
*/
-function civicrm_user_view(array &$build, \Drupal\user\UserInterface $account, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode, $langcode) {
+function civicrm_user_view(array &$build, \Drupal\user\UserInterface $account, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) {
\Drupal::service('civicrm');
// We need the $contact_id so that we know what data to pull out of Civicrm.
@@ -245,4 +245,4 @@ function civicrm_theme() {
*/
function template_preprocess_civicrm_contact(&$vars) {
$vars['civicrm_contact'] = $vars['elements']['#civicrm_contact'];
-}
\ No newline at end of file
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.