Commit 63a75fee authored by Michael Lutz's avatar Michael Lutz Committed by Bojan Živanović
Browse files

Issue #3089266 by mikelutz: AddressDefaultFormatter must implement...

Issue #3089266 by mikelutz: AddressDefaultFormatter must implement \Drupal\Core\Security\TrustedCallbackInterface as of Drupal 8.8
parent b33dc1f6
Loading
Loading
Loading
Loading
+17 −1
Changes for src/Plugin/Field/FieldFormatter/AddressDefaultFormatter.php: 17 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -19,6 +19,15 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Render\Element;
use Symfony\Component\DependencyInjection\ContainerInterface;

// @codingStandardsIgnoreStart
// @todo remove this BC layer once support for Drupal 8.7 is sunsetted
if (interface_exists('\Drupal\Core\Security\TrustedCallbackInterface')) {
  interface TrustedCallbackInterface extends \Drupal\Core\Security\TrustedCallbackInterface {}
}
else {
  interface TrustedCallbackInterface {}
}
// @codingStandardsIgnoreStop
/**
 * Plugin implementation of the 'address_default' formatter.
 *
@@ -30,7 +39,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
 *   },
 * )
 */
class AddressDefaultFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
class AddressDefaultFormatter extends FormatterBase implements ContainerFactoryPluginInterface, TrustedCallbackInterface {

  /**
   * The address format repository.
@@ -285,4 +294,11 @@ class AddressDefaultFormatter extends FormatterBase implements ContainerFactoryP
    return $values;
  }

  /**
   * {@inheritdoc}
   */
  public static function trustedCallbacks() {
    return ['postRender'];
  }

}