summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Eskola2018-04-13 19:37:26 (GMT)
committerLauri Eskola2018-04-13 19:37:26 (GMT)
commitb888a36c1256d9db5fdb4a7c9d4eef6825e6b440 (patch)
treeb4a35a44350cfab2d42012a78b361a1073fde8af
parent3e1d6c20e20e6e48447d0accbfebe520b86a8ba2 (diff)
Issue #2930274 by dawehner, Berdir, slashrsm, Sam152: View mode class is not built correctly in media.html.twig
-rw-r--r--core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php1
-rw-r--r--core/themes/classy/templates/content/media.html.twig2
2 files changed, 2 insertions, 1 deletions
diff --git a/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php b/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
index c6c1c95..3c94312 100644
--- a/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
+++ b/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
@@ -173,6 +173,7 @@ class MediaUiFunctionalTest extends MediaFunctionalTestBase {
$this->drupalGet('media/' . $first_media_item->id());
$assert_session->statusCodeEquals(200);
$assert_session->pageTextContains($first_media_item->getName());
+ $assert_session->elementsCount('css', '.media--view-mode-full', 1);
// Go to second media item.
$this->drupalGet('media/' . $second_media_item->id());
diff --git a/core/themes/classy/templates/content/media.html.twig b/core/themes/classy/templates/content/media.html.twig
index 24d3d3a..422030e 100644
--- a/core/themes/classy/templates/content/media.html.twig
+++ b/core/themes/classy/templates/content/media.html.twig
@@ -17,7 +17,7 @@
'media',
'media--type-' ~ media.bundle()|clean_class,
not media.isPublished() ? 'media--unpublished',
- view_mode ? 'media--view-mode-' ~ view_mode.id()|clean_class,
+ view_mode ? 'media--view-mode-' ~ view_mode|clean_class,
]
%}
<article{{ attributes.addClass(classes) }}>