I get error Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'canonical' found for the 'paragraph' entity type in Drupal\Core\Entity\EntityBase->toUrl() (line 211 of core/lib/Drupal/Core/Entity/EntityBase.php). when add Mobile Native Share button to paragraph.
The problem caused by this line in mobile_native_share_entity_view():
$url = !empty($entity) ? $entity->toUrl('canonical', ['absolute' => TRUE])->toString() : NULL;
Not all entity types has 'canonical' url.
Wrap getting url in "try/catch". And if entity with Mobile Native Share button does not have 'canonical' url - use the current page URL, where this entity rendered.
try {
$url = $entity->toUrl('canonical', ['absolute' => TRUE])->toString();
}
catch (\Exception $e) {
// If no link template 'canonical' found for the entity type,
// set NULL to use the current page URL.
$url = NULL;
} Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.