Skip to content

Instantly share code, notes, and snippets.

View Temaruk's full-sized avatar

Gergely Tamás Kurucz Temaruk

  • Chemaxon
  • Budapest, Hungary
View GitHub Profile
@Temaruk
Temaruk / gist:1632293
Created January 18, 2012 10:13
Fixes error when the registering user wants to join a group. There is no 'contact_id' key in the array $values, but there is an 'id' key, which is exactly what is needed.
diff --git a/docroot/sites/all/modules/civicrm/CRM/Bridge/OG/Utils.php b/docroot/sites/all/modules/civicrm/CRM/Bridge/OG/Utils.php
index c7d184e..41286c1 100644
--- a/docroot/sites/all/modules/civicrm/CRM/Bridge/OG/Utils.php
+++ b/docroot/sites/all/modules/civicrm/CRM/Bridge/OG/Utils.php
@@ -100,6 +100,9 @@ class CRM_Bridge_OG_Utils {
if ( $values['is_error'] ) {
CRM_Core_Error::fatal( );
}
+ if ( isset($values['id']) && !isset($values['contact_id'])) {
+ $values['contact_id'] = $values['id'];