The error log reports...

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

This error appears to be similar to the one mentioned in this core issue.

Of course, linking a paragraph text field to the content is a bit silly and it happened to me by accident when configuring my paragraph display. Simply because the 'link to content' checkbox is enabled by default and I didn't think to uncheck it.

Steps to reproduce
1. Create a simple paragraph type
2. Add a Text (plain) field to the paragraph type
3. Change the display formatter from plain text to title
4. Leave the default settings unchanged - (Display as h2, linked to content)
5. Add this paragraph type to a content type.
6. Create a node, add a paragraph and populate the text field.
7. Save the node and attempt to view it.
8. WSOD

To resolve the issue
1. Edit the paragraph type
2. Edit the display formatter settings
3. Uncheck 'Link to the content'
4. Save the paragraph type
5. The node can now be viewed

Comments

MrPaulDriver created an issue. See original summary.

mrpauldriver’s picture

Issue summary: View changes
mrpauldriver’s picture

Issue summary: View changes
adamps’s picture

Status: Active » Needs review
StatusFileSize
new2.2 KB

Thanks for the bug report. Here is a patch that should fix it. If the entity type doesn't support linking, then the 'link to content' setting will not be shown.

danielcavanagh’s picture

StatusFileSize
new2.22 KB

I'm seeing a different but related error during node preview

The link is generated for a valid entity type (ie. node) but the generation fails because the node doesn't exist yet (and thus can't yet have a URL)

Please see the revised patch

adamps’s picture

Thanks @danielcavanagh. As you say, your have found a different but related error. So I think there should be a separate issue and commit please.

Next step on this issue is for review of #4. @MrPaulDriver please can you confirm this fixes your problem?

mrpauldriver’s picture

Sorry Adam. Yes this fixes problem for me.

  • AdamPS committed 1211f04 on 8.x-1.x
    Issue #3081284 by AdamPS: Paragraphs: A WSOD occurs when formatting a...
adamps’s picture

Status: Needs review » Fixed
adamps’s picture

For #5 I have raised #3087749: Bug with node preview on newly created node. @danielcavanagh please can you move your patch there and also update the IS to describe the symptoms?

Status: Fixed » Closed (fixed)

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