function amp_update_8003 in Accelerated Mobile Pages (AMP) 8
Same name and namespace in other branches
- 8.3 amp.install \amp_update_8003()
- 8.2 amp.install \amp_update_8003()
Fix Amp's image style dependencies.
File
- ./
amp.install, line 69
Code
function amp_update_8003() {
$config_factory = \Drupal::configFactory();
$styles = [
'amp_metadata_content_image_min_696px_wide',
'amp_metadata_logo_600x60',
];
foreach ($styles as $style) {
$image_style = \Drupal::entityTypeManager()
->getStorage('image_style')
->load($style);
if ($image_style) {
$config = $config_factory
->getEditable('image.style.' . $style);
$config
->set('dependencies.enforced.module', [
'amp',
]);
$config
->save();
}
}
}