Skip to content

Adds support for retrieval of data type references when data type is routed using a GUID#19184

Merged
AndyButland merged 4 commits intov13/devfrom
v13/bugfix/add-support-for-guid-data-type-reference-retrieval
May 14, 2025
Merged

Adds support for retrieval of data type references when data type is routed using a GUID#19184
AndyButland merged 4 commits intov13/devfrom
v13/bugfix/add-support-for-guid-data-type-reference-retrieval

Conversation

@AndyButland
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Resolves #19182

Description

Although integer IDs are used for backoffice routes in Umbraco 13, we mostly support replacing the integer ID with it's GUID equivalent. But not for data type references as shown in the linked issue.

This PR adds that support so that these requests are resolved.

Testing

  • Navigate to a data type that's used on a document type and verify you see the references shown on the "Info" panel.
  • Look-up the data type's GUID and manually change the route so this is used in place of the integer ID.
  • Verify the references are still shown.

Copilot AI review requested due to automatic review settings April 29, 2025 05:59
Copy link
Contributor

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 adds the ability to resolve data type references when a GUID is used in place of the integer ID, supporting a more flexible routing mechanism for data types.

  • Introduces a new route attribute for handling GUID requests.
  • Adds an overload for GetReferences that accepts a Guid and converts it to an integer id for lookup.

@AndyButland AndyButland changed the title Adds support for retrieval of data type references when data type is routed using a GUID. Adds support for retrieval of data type references when data type is routed using a GUID May 12, 2025
Copy link
Contributor

@nikolajlauridsen nikolajlauridsen left a comment

Choose a reason for hiding this comment

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

Looks good, and tests good, however it didn't seem right to me to fetch the entire entity to get the ID, so I checked if we could use the IdKeyMap instead, which we can 😄 since I already had already implemented this I decided to just push it, please have a look and see if you agree.

I was gonna do it in 1 commit so it could easily be rolled back, but I forgot to amend, sorry 😅

@AndyButland
Copy link
Contributor Author

Agreed, that's much better - thanks.

@AndyButland AndyButland merged commit 87b2153 into v13/dev May 14, 2025
18 of 19 checks passed
@AndyButland AndyButland deleted the v13/bugfix/add-support-for-guid-data-type-reference-retrieval branch May 14, 2025 08:54
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