Content references: Avoid requesting references for content that is not yet persisted server side#21035
Merged
nielslyngsoe merged 6 commits intorelease/17.0from Dec 3, 2025
Conversation
ed9a586 to
d4e260e
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where the backoffice client was requesting content references for new, unpersisted documents, resulting in unnecessary 404 API errors. The fix adds a check for the isNew state before making the API request to fetch referenced-by data.
Key changes:
- Add import for
UmbSubmittableWorkspaceContexttype to check entity persistence state - Implement early return logic when entity is new (not yet persisted server-side)
- Set empty results (
_total = 0,_items = []) for new entities instead of making API request
...ions/relations/reference/workspace-info-app/entity-references-workspace-view-info.element.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
madsrasmussen
approved these changes
Dec 3, 2025
leekelleher
pushed a commit
that referenced
this pull request
Dec 3, 2025
#21009) (#21027) * fix: uses 'href' as property instead of attribute * build: runs on PR to release branches * Content references: Avoid requesting references for content that is not yet persisted server side (#21035) * Avoid requesting references for content that is not yet persisted server side. * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> * refactor to use condition * revert * danish translations * da translation --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Niels Lyngsø <[email protected]> * fix: CTRL+Click now opens links in new tab on Linux The router's anchor click handler incorrectly assumed non-Windows platforms use Meta (⌘) key for "open in new tab". This broke CTRL+Click on Linux, which uses CTRL like Windows. Changed detection from "is Windows" to "is Mac" so Linux correctly uses CTRL+Click while Mac continues to use Meta+Click. Also replaced deprecated navigator.platform with navigator.userAgent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Andy Butland <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Niels Lyngsø <[email protected]> Co-authored-by: Claude <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Prerequisites
Relates to #21034 which fixes a failing test caused by #20999, which in turn was resolving an API regression in 17.
Description
With the update from the linked PR above, a request for a content item that doesn't exist will now return a 404. This seems semantically request from an API perspective, but currently the backoffice client is requesting this endpoint for new content, that is not yet persisted. This leads to an error response for a network request in the console, and impacted an E2E test.
This PR avoids making the request when the entity is new, which avoids getting the 404 response, and also removes one unnecessary network request.
Testing
Create a new document and immediately browse to the "Info" tab. You should see no API request to
/umbraco/management/api/v1/document/{id}}/referenced-by.From an existing content item, the "Info" tab should continue to display the references.