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.
Hi,
I am implementing an "embed" solution for entities. Entities are stored in mongodb and entityreference fields can embed the referenced entity within the field. Therefor, at the load time, field items already have the referenced entity loaded, along with the target_id.
The problem is that hook_field_formatter_prepare_view loads the referenced entity anyway.
Is there a way to avoid this?
Thanks,
Mihai
Comment | File | Size | Author |
---|---|---|---|
#1 | entityreference-preloaded-entities-2301477-1.patch | 1.34 KB | mihai_brb |
Comments
Comment #1
mihai_brb CreditAttribution: mihai_brb commentedI attached a first patch. This solution works for me. I am not sure if this will break something, so any feedback is appreciated.
This approach is somehow inspired from what field collection module does here:
http://api.drupalecommerce.org/api/misc/field_collection!field_collectio...
Thanks,
Mihai