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.
LogViewBuilder does this:
$build_list[$key] = [
'#type' => 'inline_template',
'#template' => $entity->getTemplate()->getTemplate(),
'#context' => $entity->getParams(),
#context also needs to get the source entity keyed with the entity type ID without the 'commerce_' prefix (so "order", "payment"), and the owner if the source entity implements entity owner interface.
Comment | File | Size | Author |
---|---|---|---|
#2 | logviewbuilder_context_source_entity_and_owner-2839398-2.patch | 1.15 KB | vasike |
Comments
Comment #2
vasikeHere is patch, but not sure about this.
Comment #3
bojanz CreditAttribution: bojanz at Centarro commentedDecided to skip the owner, cause templates can get it from the source entity: {{ product.owner }) isn't that hard.
Comment #5
bojanz CreditAttribution: bojanz at Centarro commentedTweaked and committed. Had to fix a test along the way.