Commit ece29cdc authored by Stève ORIOL's avatar Stève ORIOL Committed by George
Browse files

Resolve #3187232 "Does not flush webp files"

parent ff22f4a4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -61,6 +61,11 @@ class FlushSingleImage implements FlushSingleImageInterface {
      if (is_file($style_path) && file_exists($style_path)) {
        $style_paths[] = $style_path;
      }
      $path_parts = pathinfo($style_path);
      $style_path_webp = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp';
      if (is_file($style_path_webp) && file_exists($style_path_webp)) {
        $style_paths[] = $style_path_webp;
      }
    }

    return $style_paths;
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ class FlushSingleImageForm extends FormBase {
   */
  public static function checkStyles(array &$form, FormStateInterface $form_state) {

    $paths = \Drupal::service('flush_single_image')->flush($form_state->getValue('path'));
    $paths = \Drupal::service('flush_single_image')->getStylePaths($form_state->getValue('path'));

    if ($paths) {
      $element = [