Commit 7670b660 authored by ezra-g's avatar ezra-g Committed by amitaibu

Issue #2220575 by ezra-g: Avoid Entity's load() method when saving group reference values.

parent 63cde2e8
......@@ -929,9 +929,9 @@ function _og_update_entity_fields($entity_type, $entity) {
}
}
else {
foreach ($wrapper->{$field_name . '__og_membership'}->value() as $og_membership) {
$gids[] = $og_membership->gid;
}
$target_type = $field['settings']['target_type'];
$gids = og_get_entity_groups($entity_type, $entity, array(OG_STATE_ACTIVE), $field_name);
$gids = !empty($gids[$target_type]) ? $gids[$target_type] : array();
}
if ($gids) {
$wrapper->{$field_name}->set($gids);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment