-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Should we be applying the ThemeTransform on FilesystemFile? #207
Comments
@mauritsvanrees @petschki @thet @MrTango @pbauer Thoughts? |
I would expect the theme transform to be run on all files. Well, on Page Templates anyway. But really anything with html. I wonder if it would help if the theme transform does not run on subrequests, or if that has unwanted side effects. |
@mauritsvanrees Mmmh, I see your point, however it shouldn't fail, even on a direct request to the resource... Maybe what needs to be fixed then is the |
I am having an issue with a theme that defines some
[theme:parameters]
and a request that tries to get aplone.resource.file.FilesystemFile
, such as Mosaic trying to get the Basic layout (Somethig likehttp://localhost:8080/Plone/++contentlayout++default/basic.html
)This particular issue happens in
plone.app.theming/src/plone/app/theming/transform.py
Lines 175 to 180 in d2fe5c1
where
findContext(self.request)
would return a<FilesystemResourceDirectory object at default>
and so, you would get a
zExceptions.NotFound
This can be reproduced by adding
in
plonetheme/barceloneta/theme/manifest.cfg
and reapplying the theme. So when trying to edit a mosaic page you will get a genericError loading layout specified for this content. Falling back to basic layout.
which loops forever. And you can see in the terminalI believe there is no use in applying the
ThemeTransform
when returning a file from the filesystem. (As a side effect we would get a faster response time for resources).Now, I am not 100% sure which Interface should be better to adapt. I've replaced
Interface
withILocation
(fromzope.location.interfaces.ILocation
) in@adapter(ILocation, IThemingLayer)
and it does fix the issue, but I am not entirely sure if this is the Interface I should be using.So, is this a desired change? if so, do you have a better suggestion on which Interface to use?
The text was updated successfully, but these errors were encountered: