When deleting language branch, CancelReason not propagated on client side

Fixed in

EPiServer.CMS.UI 10.10.5

Created

Jul 18 2017

Updated

Jul 28 2017

Area

CMS UI

State

Closed, Fixed and tested


Description

Steps to reproduce

1. Add following initialization module code to Alloy.

using EPiServer;
using EPiServer.Core;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
 
namespace AlloyTemplates.Business
{
    [InitializableModule]
    [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    public class InitializationModule : IInitializableModule
    {
        public void Initialize(InitializationEngine context)
        {
            var contentEvents = ServiceLocator.Current.GetInstance();
 
            contentEvents.MovingContent += this.MovingContent;
            contentEvents.DeletingContentLanguage += this.DeletingContentLanguage;
        }
 
        public void Uninitialize(InitializationEngine context)
        {
            var contentEvents = ServiceLocator.Current.GetInstance();
 
            contentEvents.MovingContent -= this.MovingContent;
            contentEvents.DeletingContentLanguage -= this.DeletingContentLanguage;
        }
 
        private void MovingContent(object sender, ContentEventArgs e)
        {
            if (e.TargetLink.Equals(ContentReference.WasteBasket, true) == false)
            {
                return;
            }
 
            e.CancelAction = true;
            e.CancelReason = "You're not allowed to delete this content. You need permission to this function.";
        }
 
        private void DeletingContentLanguage(object sender, ContentEventArgs e)
        {
            e.CancelAction = true;
            e.CancelReason = "You're not allowed to delete this language. You need permission to this function.";
        }
    }
}

2. For any page, create a language branch.
3. Add the versions gadget.
4. Delete the new language branch.

Expected: The CancelReason should be displayed.

Actual: A general exception is displayed.