Skip to content

Commit fff3e5e

Browse files
Fix saving content not updating the page (#12108)
* Fix relation type tests * Fix saving content not updating the UI We have to map to display after we've saved content or we'll be missing information generated when saving content such as ID * Dont map to display to get isBlueprint
1 parent 413a278 commit fff3e5e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Umbraco.Web.BackOffice/Controllers/ContentController.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -821,8 +821,7 @@ private async Task<ActionResult<ContentItemDisplay>> PostSaveInternal(ContentIte
821821
defaultCulture);
822822

823823
//get the updated model
824-
var display = mapToDisplay(contentItem.PersistedContent);
825-
bool isBlueprint = display.IsBlueprint;
824+
bool isBlueprint = contentItem.PersistedContent.Blueprint;
826825

827826
var contentSavedHeader = isBlueprint ? "editBlueprintSavedHeader" : "editContentSavedHeader";
828827
var contentSavedText = isBlueprint ? "editBlueprintSavedText" : "editContentSavedText";
@@ -922,6 +921,9 @@ private async Task<ActionResult<ContentItemDisplay>> PostSaveInternal(ContentIte
922921
throw new ArgumentOutOfRangeException();
923922
}
924923

924+
// We have to map do display after we've actually saved the content, otherwise we'll miss information that's set when saving content, such as ID
925+
var display = mapToDisplay(contentItem.PersistedContent);
926+
925927
//merge the tracked success messages with the outgoing model
926928
display.Notifications.AddRange(globalNotifications.Notifications);
927929
foreach (var v in display.Variants.Where(x => x.Language != null))

tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/relationTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ context('Relation Types', () => {
2525
cy.get('select[name="relationType-parent"]').select('Document');
2626

2727
cy.get('select[name="relationType-child"]').select('Media');
28+
29+
cy.get('[name="relationType-isdependency"]').last().click({force: true})
2830

2931
cy.get(".btn-primary").click();
3032
});

0 commit comments

Comments
 (0)