Repository navigation
Content Types: Refresh composing types when a property is added to a composition (closes #24117) #24126
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
Merged
kjac
merged 4 commits into
v17/dev
from
v17/bugfix/24117-refresh-composing-types-on-property-add
Oct 9, 2026
Merged
Content Types: Refresh composing types when a property is added to a composition (closes #24117) #24126
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b71fcec
Refresh composing content types when a property is added.
AndyButland 25fb4f1
fix(core): propagate an alias change to deriving types, and address r…
AndyButland 51bb272
Include a few more test scenarios for chained inheritance
kjac e9c653b
For batched updates: Only load the content types once, and ensure tha…
kjac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
tests/Umbraco.Tests.Integration/Umbraco.Core/Cache/ReloadPublishedCacheTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| using NUnit.Framework; | ||
| using Umbraco.Cms.Core.Cache; | ||
| using Umbraco.Cms.Core.DependencyInjection; | ||
| using Umbraco.Cms.Core.Models.PublishedContent; | ||
| using Umbraco.Cms.Core.PublishedCache; | ||
| using Umbraco.Cms.Core.Sync; | ||
| using Umbraco.Cms.Tests.Common.Testing; | ||
| using Umbraco.Cms.Tests.Integration.Testing; | ||
| using Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; | ||
| using Umbraco.Extensions; | ||
|
|
||
| namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Cache; | ||
|
|
||
| [TestFixture] | ||
| [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] | ||
| internal sealed class ReloadPublishedCacheTests : UmbracoIntegrationTestWithContentEditing | ||
| { | ||
| private IPublishedContentTypeCache PublishedContentTypeCache => GetRequiredService<IPublishedContentTypeCache>(); | ||
|
|
||
| private DistributedCache DistributedCache => GetRequiredService<DistributedCache>(); | ||
|
|
||
| protected override void CustomTestSetup(IUmbracoBuilder builder) | ||
| { | ||
| builder.AddUmbracoHybridCache(); | ||
|
|
||
| // The harness registers a no-op server messenger, which would swallow the refresh and let this test | ||
| // pass without the cache refresher ever running. | ||
| builder.Services.AddUnique<IServerMessenger, ContentEventsTests.LocalServerMessenger>(); | ||
| } | ||
|
|
||
| [Test] | ||
| public void Reloading_The_Published_Cache_Clears_The_Published_Content_Type_Cache() | ||
| { | ||
| IPublishedContentType primed = PublishedContentTypeCache.Get(PublishedItemType.Content, ContentType.Key); | ||
| Assert.IsNotNull(primed); | ||
|
|
||
| // This is what the "Reload Memory Cache" backoffice action triggers. Reloading the published caches from | ||
| // the database cache is only meaningful if the content types the content is projected through are | ||
| // reloaded too, so the cached published content types have to go as well. | ||
| DistributedCache.RefreshAllPublishedSnapshot(); | ||
|
|
||
| IPublishedContentType after = PublishedContentTypeCache.Get(PublishedItemType.Content, ContentType.Key); | ||
| Assert.IsFalse(ReferenceEquals(primed, after), "the published content type should have been rebuilt, not re-served from the cache"); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.