-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Inside UmbracoApiController, trying to output value of RTE value containing a macro causes error #7362
Comments
I just found issue #6141, which seems to be heavily related. I tried getting the content via GetByRoute, however, and I am getting the exact same result. It works when I try to access an RTE value without a macro, but gives an error when the RTE contains a macro. |
Just to let you know, macros need all kinds of contexts to be available and it's not going to be easy to make this work. I think v7 we just logged an error saying we can't render macros without an HTTP context and a pointer to what the content is you're rendering. Here's a hint I got from my colleague to see if you can get it to work:
There is the
So 2 things to conclude here:
For #2 I'll be marking this issue to be worked on by the community in case you or someone else can help. |
On point 2, would it be better to remove all the null checks for IPublishedContent in If the macro does need a current page then the failure will be handled by the chosen |
@stevemegson That suggestion sounds good to me. I would have no issue with writing my Marcos so that they can handle not having the usual context when being accessed from an API Controller. It’s much better than not being able to use them at all. |
Hi @Zweben, We're writing to let you know that we've added the For more information about issues and states, have a look at this blog post Thanks muchly, from your friendly PR team bot :-) |
Hiya @Zweben, Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more. We will close this issue for now but we're happy to open it up again if you think it's still relevant (for example: it's a feature request that's not yet implemented, or it's a bug that's not yet been fixed). To open it this issue up again, you can write For example:
This will reopen the issue in the next few hours. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
On code running inside an UmbracoApiController or UmbracoAuthorizedApiController, any attempt to output the value of a "Rich Text Editor" property that contains an embedded macro causes the error:
Umbraco version
I am seeing this issue on Umbraco version 8.4.0.
Steps to reproduce
Sample code
The text was updated successfully, but these errors were encountered: