Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Autosave triggers when opening xhtml local block property on page without changes made

Found in

EPiServer.CMS.UI 9.5.0

Fixed in

EPiServer.CMS.UI 10.2.0

(Or a related package)

Created

May 04, 2016

Updated

Jun 27, 2018

Area

CMS UI

State

Closed, Fixed and tested


Description

Steps to reproduce:

1. Create Alloy MVC site and update to latest Core and UI.
2. Create new block type and name it TestBlock.cs

namespace EPiServer.Templates.Alloy.Models.Blocks
 
{
 
/// <summary>
 
/// Used to provide a composite property on the start page to set site logotype settings
 
/// </summary>
 
[SiteContentType(
 
GUID = "EF114502-0522-4846-A1C5-6FEDE7295C35")]
 
[SiteImageUrl]
 
public class TestBlock : SiteBlockData
 
{
 
[Display(
 
GroupName = SystemTabNames.Content,
 
Order = 310)]
 
[CultureSpecific]
 
public virtual XhtmlString Goat { get; set; }
 
}
 
}

3. Create TestBlock.cshtml

@model TestBlock
 
<div>
 
@Html.PropertyFor(m => m.Goat)
 
</div>

4. Add the following property to StandardPage.cs

public virtual TestBlock TestBlock { get; set; }
 
Add this to the StandardPage cshtml
 
<div class="TestBlock">
 
@Html.PropertyFor(m => m.CurrentPage.TestBlock)
 
</div>

5. Build/Rebuild the project.
6. Create a new page of type StandardPage.
7. Add content to block property xhtml editor.
8. Publish the page.
9. (This may not be a necessary step, but just in case) Rebuild the project in Visual Studio.
10. To simulate clearing of client cache, copy the edit mode url of the page into a private browsing session (incognito mode).
11. Paste the url into the browser.
12. It should open up the recently published page in edit mode.
13. Click the block property and click out of it. Notice that autosave is triggered when it shouldn't be.