Skip to content

V16.1: Fix broken content creation when using blueprints #19518

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lauraneto
Copy link
Contributor

@lauraneto lauraneto commented Jun 10, 2025

This issue was introduced in #19292 (to be released in 16.1.0) and was preventing the fields from being filled in (based on the blueprint) in the UI.

Due to the usage of umbDeepMerge(defaultData, preset), since the values and variants were set to []in defaultData, they wouldn't be overridden by the ones in preset.
By changing the order of the parameters to umbDeepMerge(preset, defaultData), the preset values now take precedence.

With a blueprint:
image

Before the fix:
Recording 2025-06-10 at 13 49 55

After the fix:
Recording 2025-06-10 at 13 44 11

Fixes preset not overriding values in the various createScaffold methods.
@Copilot Copilot AI review requested due to automatic review settings June 10, 2025 10:51
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue with content creation blueprints by ensuring that preset values correctly override default data when merging using umbDeepMerge. The key changes involve reversing the parameter order for umbDeepMerge in the scaffold creation logic across member, media, and document data sources.

  • Reversed parameter order in umbDeepMerge to prioritize preset values over defaultData.
  • Updated the type for the preset parameter in the member data source.
  • Applied identical changes to the media and document data sources.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Umbraco.Web.UI.Client/src/packages/members/member/repository/detail/member-detail.server.data-source.ts Updates the type of preset and reverses the merge order in createScaffold.
src/Umbraco.Web.UI.Client/src/packages/media/media/repository/detail/media-detail.server.data-source.ts Reverses the merge order in createScaffold for media details.
src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/detail/document-detail.server.data-source.ts Reverses the merge order in createScaffold for document details.
Comments suppressed due to low confidence (3)

src/Umbraco.Web.UI.Client/src/packages/members/member/repository/detail/member-detail.server.data-source.ts:67

  • [nitpick] Consider adding an inline comment to explain why the parameters are reversed (preset taking precedence over defaultData) to assist future maintainers.
const scaffold = umbDeepMerge(preset, defaultData);

src/Umbraco.Web.UI.Client/src/packages/media/media/repository/detail/media-detail.server.data-source.ts:60

  • [nitpick] Consider including an inline comment detailing the reasoning behind reversing the parameter order to improve code clarity.
const scaffold = umbDeepMerge(preset, defaultData);

src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/detail/document-detail.server.data-source.ts:59

  • [nitpick] Consider adding an inline comment explaining the inversion of parameters to reinforce that preset values intentionally override defaultData.
const scaffold = umbDeepMerge(preset, defaultData);

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a testing perspective this looks to work as expected - for variant and invariant pages I see the expected default values now.

I am seeing some intermittent issues though with pages loading. If I create a new content item and select a blueprint I'm often getting a blank workspace shown (no console errors). Retry a few times and it works. I'm also seeing this on main though, so might be one to tackle in a separate PR (just tagging @nielslyngsoe and @iOvergaard so they are aware of this).

I'll need to leave it for a FE-er to do the code review so won't explicitly approve even though, as I say, for the specific issue identified it looks to work as expected.

@andr317c @nhudinh0309 - might be worth considering an acceptance test for the creation of content from a blueprint? I recall we had a regression in this area before and I could certainly see that now we have "property value presets" that do a similar thing, there is more chance of something being affected in this area.

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