Umbraco-CMS
Umbraco-CMS copied to clipboard
Add handling of failed publish.
When publishing, if the selected page does not yet have a page created, handle the FailedPublishNothingToPublish error so that the user is not presented with an exception. A warning is shown to the user that some languages failed to publish due to nothing to publish and to check that a page has been created for selected languages. Additionally fixed a validation issue where publish would always succeed if all languages were selected.
Issue: 15352
Prerequisites
- [X] I have added steps to test this contribution in the description below
If there's an existing issue for this PR then this fixes 15352
Description
This pull request contains the following changes:
- Handle the FailedPublishNothingtoPublish publish result in ContentController.cs. A warning now appears when the user attempts to publish a language for which no page has been created. See below image for warning text contents.
- Removed conditions to always publish successfully if all languages are selected.
Steps to test (taken from main issue body):
- Create a page with List view enabled.
- Enable several languages in the settings section.
- Create a child page and set "Allow vary by culture" to true. This page should be created in only one language.
- Go back to the List view page.
- Select the created page.
- Click "Publish" in top-right.
- Select a language for which a page has not been created.
- Click "Publish" in the popup.
- Observe that a warning message appears informing the user that a publish was attempted for a page that has not been created.
- Repeat 7. but select all languages.
- Observe warning message from 9.
Hi there @nagolucky18, thank you for this contribution! 👍
While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
- It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
- The automated tests all pass (see "Checks" tab on this PR)
- The level of security for this contribution is the same or improved
- The level of performance for this contribution is the same or improved
- Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
- If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
- [x] 💡 The contribution looks original and the contributor is presumably allowed to share it
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.
If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.
Thanks, from your friendly Umbraco GitHub bot 🤖 🙂
Thank you @nagolucky18 Someone from the Core collabs team will look into this! Mind that it's holiday times so might take some time :) Merry Chrismas 🎉
Let's get this merge in :) 🎉