I have a paragraph of type "rich text" which has a single long text field attached. This paragraph type is referenced by another paragraph field in a basic page content type. The form display of this field is preview. I have enabled the preview display mode for the rich text paragraph and have set the formatter of the text field to be smart trimmed. This results in a WSOD with message "The website encountered an unexpected error. Please try again later.". Switching back to the standard trim and I'm able to view the node edit screen again. Looking in the logs I see this as a potential culprit:

Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'canonical' found for the 'paragraph' entity type in Drupal\Core\Entity\Entity->toUrl() (line 214 of /var/www/hdmicrosite/web/core/lib/Drupal/Core/Entity/Entity.php).

I've seen a few posts like this now and it's never been the paragraphs module at fault it seems...

Comments

vaccinemedia created an issue. See original summary.

markie’s picture

Status: Active » Postponed (maintainer needs more info)

@vaccinemedia Can you retest against the development release? I just added a patch that addresses when a link is missing and the error you are seeing is similar.

vaccinemedia’s picture

@markie I've updated to the dev you mention and I am now able to view paragraphs in preview mode in the backend / node edit screen with the rich text smart trimmed. Thank you for the speedy fix! Awesome :)

vaccinemedia’s picture

Status: Postponed (maintainer needs more info) » Needs review

Popping into needs review until a couple more people have tested the issue

markie’s picture

Status: Needs review » Active

Moving to active until a patch or change needs to be reviewed.

ultimike’s picture

First off - thanks for the most outstanding issue title - made it super-easy to find this issue.

Anyway, I was having the exact same issue using 8.x-1.0, updated to the latest -dev release, and all is looks fixed.

thanks,
-mike

ruloweb’s picture

Status: Active » Fixed

That commit solves my issue too. I have a paragraphs and enabled the Smart Trim for the Token View Mode, and when I was displaying one of the paragraph' field had the same Fatal Error.

This kind of issue was introduced in Drupal 8.2.x, I have seen a few of these missed 'canonical' links.

I think we can mark this as fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.