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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz created an issue. See original summary.

vasike’s picture

Status: Active » Needs review
FileSize
1.15 KB

Here is patch, but not sure about this.

bojanz’s picture

Title: Log templates should have access to the source entity and owner » Log templates should have access to the source entity

Decided to skip the owner, cause templates can get it from the source entity: {{ product.owner }) isn't that hard.

  • bojanz committed 8bd0dfc on 8.x-2.x authored by vasike
    Issue #2839398 by vasike: Log templates should have access to the source...
bojanz’s picture

Status: Needs review » Fixed

Tweaked and committed. Had to fix a test along the way.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.