-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
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
Steps to reproduce
- Inject
entityResource
into an angular controller - Call
getAll("DocumentType")
- 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 commentedon Oct 23, 2023
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 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 🤖 🙂
kjac commentedon Oct 30, 2023
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 usingentityResource
.The following code:
...produces this log message:
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 theEntityRepository
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 theEntityRepository
and mapped by theEntityMapDefinition
, and should include both document, media and member types.github-actions commentedon Oct 30, 2023
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 :-)