Skip to content

Instantly share code, notes, and snippets.

@housser
Last active August 29, 2015 14:25
Show Gist options
  • Save housser/ba03c50f670dc5310520 to your computer and use it in GitHub Desktop.
Save housser/ba03c50f670dc5310520 to your computer and use it in GitHub Desktop.
Dealing with this issue, trying to post OG Content to Drupal using Services: https://drupal.stackexchange.com/questions/159149/setting-og-with-services-module
diff --git a/og.module b/og.module
index 6f28205..a3aa3be 100755
--- a/og.module
+++ b/og.module
@@ -762,6 +762,12 @@ function og_form_group_reference_validate($form, &$form_state) {
if (!empty($form_state['values'][$field_name][LANGUAGE_NONE])) {
return;
}
+
+ // @TODO: Find out why the 'og_group_ref' field isn't getting maintained in the 'values' array by form_builder()
+ if (!empty($form_state['input'][$field_name][LANGUAGE_NONE])) {
+ $form_state['values'][$field_name] = $form_state['input'][$field_name];
+ return;
+ }
}
// No group selected, throw an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment