Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In #2169099: Avoid unnecessary entity loads in group reference fields, we eliminated a call to Entity's load() method when loading field values. Looking at the codebase, it appears we can eliminate another call to this method when saving group field values.
In the attached patch, I followed the same approach of using og_get_entity_groups() instead of
$wrapper->{$field_name . '__og_membership'}->value()
from #2169099 in _og_update_entity_fields().
Comment | File | Size | Author |
---|---|---|---|
#2 | 2220575-og-avoid-save-on-load-2.patch | 642 bytes | ezra-g |
og-avoid-save-on-load.patch | 641 bytes | ezra-g | |
Comments
Comment #1
amitaibushouldn't it be
$gids = !empty($gids[$target_type]) ? $gids[$target_type] : array();
Comment #2
ezra-g CreditAttribution: ezra-g commentedYes, that sounds correct. Thanks for the fast review!
Here's an updated patch.
Comment #3
amitaibuCommitted, thanks.
Comment #7
guillaumev CreditAttribution: guillaumev commentedThis commit apparently caused this issue: https://drupal.org/node/2264759