You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RichTextValue.output always uses the siteroot for rendering (via output_relative_to).
This means that the ITransform adapter is not called for the correct context.
The default display template already uses context.text.output_relative_to(view.context), so maybe .output should be removed?
The text was updated successfully, but these errors were encountered:
I'd prefer to keep output but make it context aware and deprecate output_relative_to. AFAICT, the richtextvalue doesn't have access to the context where it's used. So, when keeping output we need to pass the context (maybe with the siteroot as default). This would be quite a breaking change unless we go for another name, like text and deprecate output too.
Maybe we should also add a __call__ method, which returns the output,which would solve: #25
I once tried to obtain the correct context from the global request, but I guess that's not the way to go: #17
In any case, the distinction btw output and output_relative_to often leads to confusion - I already spend a good amount of time with that.
/cc'ing @davisagli because he knows this package quite well.
We can get the context by walking the frame stack.
I've added an implementation of that to the PR for plone.restapi.
Maybe we should use that here instead of plone.restapi.
RichTextValue.output always uses the siteroot for rendering (via output_relative_to).
This means that the ITransform adapter is not called for the correct context.
The default display template already uses context.text.output_relative_to(view.context), so maybe .output should be removed?
The text was updated successfully, but these errors were encountered: