- πΊπΈUnited States Chris Matthews
@bkosborne, would it be possible to commit the patch β in #5 π Flush image styles for the media thumbnail on file replace Needs work as is, and then create a follow-up issue for the remaining concern re: sites that don't have a dynamic thumbnail for non-image based media?
- πΊπΈUnited States glynster
We just ran into this issue as well. As much as the module works well for 'thumbnail' it skips all the image styles connected. It makes sense that if the original file is updated all image styles connected are flushed?
- πΊπΈUnited States glynster
Something like this referenced from 'Flush Single Image Style':
/** * {@inheritdoc} */ public function flush(string $path, int $action = self::ACTION_UNLINK): array { if (!in_array($action, [self::ACTION_UNLINK, self::ACTION_REGENERATE])) { throw new \InvalidArgumentException("The argument \$action must be either " . get_class($this) . "::ACTION_UNLINK or " . get_class($this) . "::ACTION_REGENERATE"); } $style_paths = $this->getStylePaths($path); $flushed_style_paths = []; foreach ($style_paths as $style_id => $style_path) { if ($action == self::ACTION_UNLINK) { if ($this->fileSystem->unlink($style_path)) { $flushed_style_paths[$style_id] = $style_path; } } elseif ($action == self::ACTION_REGENERATE) { $imageStyle = ImageStyle::load($style_id); if ($imageStyle->createDerivative($path, $style_path)) { $flushed_style_paths[$style_id] = $style_path; } } } return $flushed_style_paths; }
- πΊπ¦Ukraine dburiak
Attached is an updated patch with flashing as it's done on the Flush Single Image Style module.