Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataObjects that return an empty PreviewURL result in 404 in preview panel #1304

Closed
3 tasks
GuySartorelli opened this issue May 4, 2022 · 0 comments
Closed
3 tasks

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented May 4, 2022

It is perfectly valid for a CMSPreviewable object to return null or an empty string from the PreviewURL() method - for example a dataobject which expects to belong to a page may return an empty value if it does not currently have a page relation set.

In this case the preview panel should display the "no preview available" message instead of spitting out a 404 - and ideally would be collapsed when loading this object (which is the same behaviour you would have for objects that are not CMSPreviewable.

Acceptance Criteria

  • If a DataObject which implements CMSPreviewable has no preview URL in the current context, the preview panel displays a relevant message instead of an error page
  • The preview panel is collapsed by default for the above mentioned situation
  • When navigating to an edit form for a DataObject that does have a preview URL, the previously used mode (e.g. split, preview, or edit) is used (i.e. the above collapsing is not stored)

PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants