Change record status: 
Project: 
Introduced in branch: 
8.x-2.x
Introduced in version: 
8.x-2.0-beta6
Description: 

Previously the buildPaneSummary() method was expected to return an HTML string, which required panes to inject the renderer service to render a renderable array into a string. This complicated matters, and made it harder to extend & modify the method by child classes.

Since beta6, the method returns a renderable array.

Before (ContactInformation):

  /**
   * {@inheritdoc}
   */
  public function buildPaneSummary() {
    return $this->order->getEmail();
  }

After (ContactInformation):

  /**
   * {@inheritdoc}
   */
  public function buildPaneSummary() {
    return [
      '#plain_text' => $this->order->getEmail(),
    ];
  }

Before (BillingInformation):

  /**
   * {@inheritdoc}
   */
  public function buildPaneSummary() {
    $summary = '';
    if ($billing_profile = $this->order->getBillingProfile()) {
      $profile_view_builder = $this->entityTypeManager->getViewBuilder('profile');
      $summary = $profile_view_builder->view($billing_profile, 'default');
      $summary = $this->renderer->render($summary);  
    }
    return $summary;
  }

After (BillingInformation):

  /**
   * {@inheritdoc}
   */
  public function buildPaneSummary() {
    $summary = [];
    if ($billing_profile = $this->order->getBillingProfile()) {
      $profile_view_builder = $this->entityTypeManager->getViewBuilder('profile');
      $summary = $profile_view_builder->view($billing_profile, 'default');
    }
    return $summary;
  }

Note that a BC layer ensures that returning an HTML string from buildPaneSummary() still works, but is discouraged.

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done
Details: 
Progress: