From ae16101d6b9d423a0dc7dd71516a8d3417a0ed73 Mon Sep 17 00:00:00 2001 From: Scott Reeves Date: Wed, 7 Sep 2016 22:07:51 -0400 Subject: [PATCH] Issue #2641380 by gnuget, darketaine, Chernous_dn, dinarcon, mohit_aghera, joelpittet, hass, davidhernandez, Wim Leers, Cottser: image-widget.html.twig references a non-existing classy/image-widget library --- core/themes/classy/classy.libraries.yml | 6 ++++++ core/themes/classy/css/components/image-widget.css | 14 +++++++++++++- .../templates/content-edit/image-widget.html.twig | 1 - core/themes/seven/templates/image-widget.html.twig | 12 ++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 core/themes/seven/templates/image-widget.html.twig diff --git a/core/themes/classy/classy.libraries.yml b/core/themes/classy/classy.libraries.yml index eb5e0b254c545e6..f970f86b15fbfca 100644 --- a/core/themes/classy/classy.libraries.yml +++ b/core/themes/classy/classy.libraries.yml @@ -56,6 +56,12 @@ forum: component: css/components/forum.css: { weight: -10 } +image-widget: + version: VERSION + css: + component: + css/components/image-widget.css: {} + indented: version: VERSION css: diff --git a/core/themes/classy/css/components/image-widget.css b/core/themes/classy/css/components/image-widget.css index 3da51ef8579a0eb..56777c41ea43d0f 100644 --- a/core/themes/classy/css/components/image-widget.css +++ b/core/themes/classy/css/components/image-widget.css @@ -1,7 +1,19 @@ - /** + * @file * Image upload widget. + * + * This CSS file is not used in this theme (Classy). It was intended to be used, + * but due to a bug, Drupal 8 shipped with it not being used. To not break + * backwards compatibility, we continue to not load it in Classy. Every + * subtheme of Classy is encouraged to use it, by attaching the + * classy/image-widget asset library in their image-widget.html.twig file. + * + * @see core/themes/seven/templates/content-edit/image-widget.html.twig. + * + * @todo In Drupal 9, let core/themes/classy/templates/content-edit/image-widget.html.twig + * attach the classy/image-widget asset library. */ + .image-preview { float: left; /* LTR */ padding: 0 10px 10px 0; /* LTR */ diff --git a/core/themes/classy/templates/content-edit/image-widget.html.twig b/core/themes/classy/templates/content-edit/image-widget.html.twig index 5e8033ffaee2d4f..dac3a227b3d3a5e 100644 --- a/core/themes/classy/templates/content-edit/image-widget.html.twig +++ b/core/themes/classy/templates/content-edit/image-widget.html.twig @@ -10,7 +10,6 @@ * @see template_preprocess_image_widget() */ #} -{{ attach_library('classy/image-widget') }} {% if data.preview %}
diff --git a/core/themes/seven/templates/image-widget.html.twig b/core/themes/seven/templates/image-widget.html.twig new file mode 100644 index 000000000000000..a7cf3ad48a1ff1a --- /dev/null +++ b/core/themes/seven/templates/image-widget.html.twig @@ -0,0 +1,12 @@ +{# +/** + * @file + * Theme override for an image field widget. + * + * Included from Classy theme. + * + * @see template_preprocess_image_widget() + */ +#} +{% include '@classy/content-edit/image-widget.html.twig' %} +{{ attach_library('classy/image-widget') }}