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

V15: Fix draft being seeded #18470

Merged
merged 2 commits into from
Feb 26, 2025
Merged

Conversation

Zeegaan
Copy link
Member

@Zeegaan Zeegaan commented Feb 26, 2025

Notes

  • When saving any seeded document, the draft version would also end up being seeded, this PR remedies that, by checking if its a draft node.
  • Passes preview into GetEntryOptions, this way we do not seed draft nodes when saving.

How to test

  • You can check by creating one document, and then restarting the site.
  • Set a breakpoint in GetEntryOptions
  • Go and save the document, assert that the draft verison now gets the correct entry options (not the seeded one)
using Microsoft.Extensions.Caching.Hybrid;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Models;

namespace _15;

public class DemoComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        
        builder.Services.AddOptions<CacheSettings>().Configure(x =>
        {
            x.Entry.Document.LocalCacheDuration = TimeSpan.FromSeconds(5);
        });
    }
}

@Zeegaan Zeegaan enabled auto-merge (squash) February 26, 2025 21:15
@Zeegaan Zeegaan merged commit 2bdeefe into v15/dev Feb 26, 2025
21 checks passed
@Zeegaan Zeegaan deleted the v15/bugfix/fix-draft-being-seeded branch February 26, 2025 21:48
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.

2 participants