Overview
The current logic in ContentTemplate::getPreviewSuggestionQuery does not account for entities the user might not have access to - such as unpublished ones when the use does not have the permission to view published content.
This can result in \Drupal\canvas\Entity\ContentTemplate::normalizeForClientSide returning a client side representation with a null 'suggestedPreviewEntityId', which in turn results in the UI stating
No preview content is available To build a template, you must have at least one [entity type].
Despite there being plenty of previewable entities available -- it just happens that the one with the highest entity id is not one the user has access to view.
This can be reproduced by creating a template for the article content type, and make it so the highest-nid article is unpublished
Visit that template and this is what you get:
Proposed resolution
- Expand the query conditions to limit results to ones the current user can view
- Consider adjusting the "No preview content is available" message to not assume an absence of [[entity type]] entities - they might exist yet aren't available for preview for other reasons.
User interface changes

| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2026-01-14 at 1.14.39 PM.png | 60.05 KB | bnjmnm |
Comments