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

Add handling of failed publish. #15469

Merged

Conversation

nagolucky18
Copy link
Contributor

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

  • 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.

nothing_to_publish_warning

  • Removed conditions to always publish successfully if all languages are selected.

Steps to test (taken from main issue body):

  1. Create a page with List view enabled.
  2. Enable several languages in the settings section.
  3. Create a child page and set "Allow vary by culture" to true. This page should be created in only one language.
  4. Go back to the List view page.
  5. Select the created page.
  6. Click "Publish" in top-right.
  7. Select a language for which a page has not been created.
  8. Click "Publish" in the popup.
  9. Observe that a warning message appears informing the user that a publish was attempted for a page that has not been created.
  10. Repeat 7. but select all languages.
  11. Observe warning message from 9.

Copy link

github-actions bot commented Dec 17, 2023

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
  • 💡 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 🤖 🙂

@busrasengul
Copy link
Contributor

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 🎉

@mikecp mikecp self-assigned this Feb 12, 2024
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
@JasonElkin JasonElkin force-pushed the 15352_error_on_list_view_publish branch from 4556999 to 8653e1e Compare February 29, 2024 15:43
@busrasengul
Copy link
Contributor

Let's get this merge in :) 🎉

@busrasengul busrasengul merged commit 0cf436f into umbraco:contrib Mar 1, 2024
12 of 13 checks passed
@busrasengul busrasengul self-assigned this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FailedPublishNothingToPublish error on publishing with List View
3 participants