-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add patch: Call image styles warmer batch operations statically
- Loading branch information
1 parent
042a3b5
commit 6938123
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
patches/image_style_warmer/custom-call-image-styles-warmer-batch-ops-statically.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/modules/contrib/image_style_warmer/src/BatchService.php b/modules/contrib/image_style_warmer/src/BatchService.php | ||
index edf34cda..7d48180a 100644 | ||
--- a/modules/contrib/image_style_warmer/src/BatchService.php | ||
+++ b/modules/contrib/image_style_warmer/src/BatchService.php | ||
@@ -19,7 +19,7 @@ class BatchService { | ||
* @param object $context | ||
* Context for operations. | ||
*/ | ||
- public function warmUpFileProcess($fid, $count, &$context) { | ||
+ public static function warmUpFileProcess($fid, $count, &$context) { | ||
/** @var \Drupal\image_style_warmer\ImageStylesWarmerInterface $image_styles_warmer */ | ||
$image_styles_warmer = \Drupal::service('image_style_warmer.warmer'); | ||
$file = File::load($fid); | ||
@@ -45,7 +45,7 @@ public function warmUpFileProcess($fid, $count, &$context) { | ||
* @param array $operations | ||
* Array of operations. | ||
*/ | ||
- public function warmUpFileFinished($success, array $results, array $operations) { | ||
+ public static function warmUpFileFinished($success, array $results, array $operations) { | ||
$messenger = \Drupal::messenger(); | ||
if ($success) { | ||
$messenger->addMessage(t('@count files warmed up.', ['@count' => count($results)])); |