diff --git a/core/modules/image/image.admin.inc b/core/modules/image/image.admin.inc index ca97c41..09c1b67 100644 --- a/core/modules/image/image.admin.inc +++ b/core/modules/image/image.admin.inc @@ -94,8 +94,14 @@ function template_preprocess_image_style_preview(&$variables) { ); $images = array( - 'original' => array('label' => t('Sample original image'), 'path' => $sample['path']), - 'derivative' => array('label' => t('Sample modified image'), 'path' => $style->buildUri($sample['path'])), + 'original' => array( + 'label' => t('Sample original image'), + 'path' => $sample['path'], + ), + 'derivative' => array( + 'label' => t('Sample modified image'), + 'path' => $style->buildUri($sample['path']), + ), ); // Create derivative if necessary. @@ -119,7 +125,12 @@ function template_preprocess_image_style_preview(&$variables) { $variables[$type]['attributes'] = array( 'width' => $width, 'height' => $height, - 'style' => String::format('width: @width; height: @height;', array('@width' => $width . 'px', '@height' => $height . 'px')), + 'style' => String::format('width: @width; height: @height;', + array( + '@width' => $width . 'px', + '@height' => $height . 'px', + ) + ), 'alt' => $image_info['label'], ); $variables[$type]['rendered'] = array( diff --git a/core/modules/image/image.field.inc b/core/modules/image/image.field.inc index ae53804..c971a74 100644 --- a/core/modules/image/image.field.inc +++ b/core/modules/image/image.field.inc @@ -453,10 +453,7 @@ function template_preprocess_image_formatter(&$variables) { // The link path and link options are both optional, but for the options to be // processed, the link path must at least be an empty string. if (isset($variables['path']['path'])) { - $path = $variables['path']['path']; $options = isset($variables['path']['options']) ? $variables['path']['options'] : array(); - // When displaying an image inside a link, the html option must be TRUE. - $options['html'] = TRUE; - $variables['url'] = url($path, $options); + $variables['url'] = url($variables['path']['path'], $options); } } diff --git a/core/modules/image/lib/Drupal/image/Plugin/ImageEffect/CropImageEffect.php b/core/modules/image/lib/Drupal/image/Plugin/ImageEffect/CropImageEffect.php index 9a97fe1..fce1ac1 100644 --- a/core/modules/image/lib/Drupal/image/Plugin/ImageEffect/CropImageEffect.php +++ b/core/modules/image/lib/Drupal/image/Plugin/ImageEffect/CropImageEffect.php @@ -50,7 +50,7 @@ public function getSummary() { '#data' => $this->configuration, ); $summary += parent::getSummary(); - $summary['#data']['anchor_label'] = self::getAnchorOptions($this->configuration['anchor']); + $summary['#data']['anchor_label'] = static::getAnchorOptions($this->configuration['anchor']); return $summary; } @@ -68,7 +68,7 @@ public function getForm() { $form['anchor'] = array( '#type' => 'radios', '#title' => t('Anchor'), - '#options' => self::getAnchorOptions(), + '#options' => static::getAnchorOptions(), '#theme' => 'image_anchor', '#default_value' => $this->configuration['anchor'], '#description' => t('The part of the image that will be retained during the crop.'), diff --git a/core/modules/image/templates/image-style.html.twig b/core/modules/image/templates/image-style.html.twig index 9a24420..6b52839 100644 --- a/core/modules/image/templates/image-style.html.twig +++ b/core/modules/image/templates/image-style.html.twig @@ -17,11 +17,11 @@ * neither omission nor an empty string satisfies accessibility * requirements, so it is strongly encouraged for code calling * theme('image') to pass a meaningful value for this variable. - * http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.8 - * http://www.w3.org/TR/xhtml1/dtds.html - * http://dev.w3.org/html5/spec/Overview.html#alt * * @see template_preprocess_image_style() + * @see http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.8 + * @see http://www.w3.org/TR/xhtml1/dtds.html + * @see http://dev.w3.org/html5/spec/Overview.html#alt * * @ingroup themeable */ diff --git a/core/modules/image/templates/image-widget.html.twig b/core/modules/image/templates/image-widget.html.twig index 99e14e1..43faffc 100644 --- a/core/modules/image/templates/image-widget.html.twig +++ b/core/modules/image/templates/image-widget.html.twig @@ -13,7 +13,7 @@ * @ingroup themeable */ #} -
+ {% if preview is defined %}
{{ preview }}