Skip to content
Snippets Groups Projects

get page path with $entity->toUrl()->toString()

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -230,7 +230,7 @@ function cloudfront_cache_path_invalidate_settings($entity_type, $bundle_type, $
$paths[] = trim($value);
}
}
$detail_page = $config->get('detail_page')[$i] ? \Drupal::service('path_alias.manager')->getAliasByPath("/$bundle/" . $entity_id) : '';
$detail_page = $config->get('detail_page')[$i] ? $entity->toUrl()->toString() : '';
if ($entity->hasLinkTemplate('canonical')) {
$path = 'internal:/' . $entity->toUrl('canonical')->getInternalPath();
Loading