Skip to content

Angular entityResource does not return 'alias' for DocumentType #15023

@chrden

Description

@chrden

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

12.2.0

Bug summary

The angular entityResource does not return a value for the 'alias' property when "DocumentType" is passed to the type parameter

Specifics

When injecting the entityResource into an angular controller, and then calling the getAll(type, postFilter) method, the resulting array of Document Types always returns an empty string for the alias property.

It's not made clear from the below documentation what the result object should look like but both the contentTypeResource and elementTypeResource return the alias property correctly populated
https://apidocs.umbraco.com/v12/ui/#/api/umbraco.resources.entityResource

I found this when upgrading to Umbraco v12.2.0 as we were previously using contentTypeResource but a change was made to restrict element types from being returned and we need to be able to retrieve a complete list of all Document Types, regardless of whether or not they are an element type:
b2831dc

image

Steps to reproduce

  1. Inject entityResource into an angular controller
  2. Call getAll("DocumentType")
  3. Review returned object to find alias property is always empty

Expected result / actual result

alias property is correctly populated when calling entityResource.getAll("DocumentType")

Activity

github-actions

github-actions commented on Oct 23, 2023

@github-actions

Hi there @chrden!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

self-assigned this
on Oct 30, 2023
kjac

kjac commented on Oct 30, 2023

@kjac
Contributor

Hi @chrden,

Thank you for reaching out 😄 apologies for the belated response, and thanks for putting in the effort to make this issue report so detailed 💪

I can confirm that the alias is indeed empty when using entityResource.

The following code:

image

...produces this log message:

image

This applies to any entity type, it is not limited to document types. The screenshots above is from V10, so this has been around for a long time.

Unfortunately there is no easy fix to mend this. The document type Alias is simply not available when mapping entities to their response models. This has to do with how the EntityRepository is built.

Still, I'm going to put this up for grabs, if anyone out there would like to have a go at mending it. A fix should ensure that the alias property is fetched by the EntityRepository and mapped by the EntityMapDefinition, and should include both document, media and member types.

removed their assignment
on Oct 30, 2023
github-actions

github-actions commented on Oct 30, 2023

@github-actions

Hi @chrden,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post.

Thanks muchly, from your friendly Umbraco GitHub bot :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kjac@chrden

        Issue actions

          Angular entityResource does not return 'alias' for DocumentType · Issue #15023 · umbraco/Umbraco-CMS