diff core/modules/media/media.module @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/core/modules/media/media.module	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/media/media.module	Thu May 09 15:34:47 2019 +0100
@@ -77,6 +77,7 @@
     'media_oembed_iframe' => [
       'variables' => [
         'media' => NULL,
+        'placeholder_token' => '',
       ],
     ],
   ];
@@ -347,3 +348,14 @@
 
   return FALSE;
 }
+
+/**
+ * Implements hook_entity_type_alter().
+ */
+function media_entity_type_alter(array &$entity_types) {
+  if (\Drupal::config('media.settings')->get('standalone_url')) {
+    /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
+    $entity_type = $entity_types['media'];
+    $entity_type->setLinkTemplate('canonical', '/media/{media}');
+  }
+}