diff --git a/plugins/FeedsProcessor.inc b/plugins/FeedsProcessor.inc index 5aa64e7..33d239a 100644 --- a/plugins/FeedsProcessor.inc +++ b/plugins/FeedsProcessor.inc @@ -442,6 +442,18 @@ abstract class FeedsProcessor extends FeedsPlugin { // Set property and field values. $this->map($source, $parser_result, $entity); + // Mukurtu patch. + // If importing user is an admin/mukurtu admin, flag field to skip + // OG validation. Long term we should make these disparate OG/protocol + // systems work together. + global $user; + if (!empty($entity->og_group_ref[LANGUAGE_NONE]) && (in_array('Mukurtu Administrator', $user->roles) || in_array('administrator', $user->roles))) { + foreach ($entity->og_group_ref[LANGUAGE_NONE] as $delta => $value) { + $entity->og_group_ref[LANGUAGE_NONE][$delta]['field_mode'] = 'mukurtu_import'; + } + } + // end Mukurtu patch. + // Allow modules to alter the entity before validating. module_invoke_all('feeds_prevalidate', $source, $entity, $item, $entity_id); $this->entityValidate($entity, $source);