Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V9: Inserting partial via template doesn't use await #11220

Closed
bjarnef opened this issue Sep 29, 2021 · 4 comments · Fixed by #11243
Closed

V9: Inserting partial via template doesn't use await #11220

bjarnef opened this issue Sep 29, 2021 · 4 comments · Fixed by #11243

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Sep 29, 2021

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

9.0.0

Bug summary

When inserting a partial view via template editor in backoffice it just use the following like in v8:

@Html.Partial("Breadcrumb")

It should instead use the recommended approach in .NET5:

@(await Html.PartialAsync("Breadcrumb"))

Specifics

No response

Steps to reproduce

Insert a partial via backoffice template editor and notice it render the partial like in v8, but not async.

Expected result / actual result

No response

@louisjrdev
Copy link
Contributor

So I was potentially going to make this change looks simplish based on needing to change the snippet that is created in this file.

However, how is the multi targeting of V8 and V9 working in the js if at all?

@bjarnef
Copy link
Contributor Author

bjarnef commented Sep 30, 2021

@louisjrdev the V8 and V9 code base is in two separate branches. v9/contrib is now the default branch. So you could eventually fork this and submit a PR target on this branch.
https://github.com/umbraco/Umbraco-CMS/blob/v9/contrib/src/Umbraco.Web.UI.Client/src/common/services/templatehelper.service.js

But yeah it seems the snippet is generated in this line:
https://github.com/umbraco/Umbraco-CMS/blob/v9/contrib/src/Umbraco.Web.UI.Client/src/common/services/templatehelper.service.js#L19

@louisjrdev
Copy link
Contributor

@bjarnef Aha nice, I thought that was the case but just wanted to check.

Great I will probably get a PR in for this soon, but if anyone else wants to work on it in the meantime feel free.

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 1, 2021

Microsoft also mention in the docs here:
https://docs.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-5.0#synchronous-html-helper

Partial and RenderPartial are the synchronous equivalents of PartialAsync and RenderPartialAsync, respectively. The synchronous equivalents aren't recommended because there are scenarios in which they deadlock. The synchronous methods are targeted for removal in a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants