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

Inconsistent error when creating an empty admin template #16943

Closed
sarahelsaig opened this issue Nov 1, 2024 · 0 comments · Fixed by #16944
Closed

Inconsistent error when creating an empty admin template #16943

sarahelsaig opened this issue Nov 1, 2024 · 0 comments · Fixed by #16944
Labels

Comments

@sarahelsaig
Copy link
Contributor

Describe the bug

If you try to create a new admin template with empty content, the template is not created but also no error or warning is displayed either. If you edit an existing admin template by clearing out its content, then the The content is mandatory. validation message is displayed, but this does not happen when creating a brand new template. This is certainly a bug, and very confusing behavior.

Additionally, it's not made clear why an empty content is not allowed. I know that using Placements to not even display the shape is a more "correct" approach, but that's a more advanced feature. The validation message should funnel the user towards Placements by mentioning the option and perhaps including a link to the relevant documentation page, instead of just saying that the field is mandatory.

Orchard Core version

Latest dev branch.

To Reproduce

  1. Go to Admin > Design > Templates.
  2. Create a template, e.g. name "Menu" and content "custom template".
  3. Click Edit on the template.
  4. Clear content and click save.
  5. Observe the "The content is mandatory." message is present.
  6. Delete the template.
  7. Do it again, this time with empty content during creation.
  8. Observe that the validation message is missing. If you didn't pay attention, you may think the page wasn't even submitted.

Expected behavior

  • The empty content validation message should be the same regardless whether we are creating a new template or editing an existing one.
  • The message should be something like "The content is mandatory. If you left the content empty because you want to hide the shape, use the {Placements}(relative link to the Placements menu item) instead. See the docs for more about this feature."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant