Skip to content

Commit

Permalink
Merge pull request #51 from City-of-Helsinki/UHF-7946
Browse files Browse the repository at this point in the history
UHF-7946: Fixed issue with responsive image styles
  • Loading branch information
tuutti authored Jan 16, 2023
2 parents 6705e38 + 049c309 commit 467379e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions helfi_proxy.module
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
use Drupal\Core\Asset\AttachedAssetsInterface;
use Drupal\Core\Entity\EntityInterface;

/**
* Implements hook_module_implements_alter().
*/
function helfi_proxy_module_implements_alter(&$implementations, $hook) : void {
// Move helfi_proxy_file_url_alter() implementation to the top of the
// list, so this is always run first before any other alter hooks, more
// specifically before 'crop_file_url_alter()' which seems to convert certain
// responsive image styles to an external URL that will break our
// implementation. @see UHF-7946.
if ($hook === 'file_url_alter') {
$group = $implementations['helfi_proxy'];
$implementations = ['helfi_proxy' => $group] + $implementations;
}
}

/**
* Implements hook_file_url_alter().
*/
Expand Down

0 comments on commit 467379e

Please sign in to comment.