- Issue created by @iseeaflyingcrane
- First commit to issue fork.
- Assigned to gbyte
- 🇷🇺Russia walkingdexter
@iseeaflyingcrane Thanks for the issue! This is a valid point.
The reason for this behavior is that product variation does not have a canonical link template. However, if an entity doesn't have a canonical template, it can still have a canonical link.
EntityHelper::supports()
excludes entities that can be successfully added to the sitemap.@gbyte Maybe we should support all content entity types? We can move entity types without a canonical link template to a separate table on the /admin/config/search/simplesitemap/entities page and warn users about possible errors.
- 🇩🇪Germany gbyte Berlin
I don't use commerce - what would the canonical link of a product variation be and why does it not have a canonical link template?
In \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\EntityUrlGenerator::processEntity we get the entity's URL by calling
$entity->toUrl();
which in turn seems to assume a canonical path and if not given, the form edit path - see \Drupal\Core\Entity\EntityBase::toUrl.Do you mean to allow all content entities and then try-catch around the
$entity->toUrl();
block if no URL is returned? Feel free to experiment with this.