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
Improper resource URLs generated in Plone 5.0.5 #1663
Comments
@ebrehault this seems to be related to your previous changes in the resource registry in #1300. |
maybe this is an stupid proposal but… anyway: has anybody on the @plone/framework-team thought about the following possible implementation for the resources registries story:
what can we accomplish with this?
is that possible? do you want a PLIP? |
Note that I was not suggesting to bring back the old cmf registries back. |
in my opinion what I'm proposing is what we should have done to get rid of the old resource registries in an orderly way:
I have no idea of the implications, but better now than later. |
Not sure what the old resource registries would solve in the context of Plone 5? Adding a single JS file directly inside a template without any registration may lead to the welcome RequireJS errors. So the old registries would blindly inject the JS scripts in the same way with the same risk of random breaking. The fundamental limitation (not sure if I am allowed to call it a flaw) is that dominance of the RequireJS approach is often not compatible with third-party JS modules. There has to be a clear, well-defined and under all circumstances working way to have arbitrary JS code living side by side with stuff under the control of RequireJS. This is not a question how we register JS/CSS files (as bundles/resource or through the old CMF registries), the question is how both can live side by side without side-effects. Side rant: the current limitation of one JS file per resource is neither friendly nor approachable.some JS modules have one main JS module and other JS modules as plugins...you need to define multiple resource in this case because a resource is limited to one JS file per resource. I personally don't care why this limitation exist but the leads to a huge configuration overhead and verbose configuration with the result that the related XML snippets in registry.xml become much larger than related configurations in jsregistry.xml. Readabilty and easy approachability is king (from the integrators prospective and in particular from the prospective of not so advanced Plone devs). |
I get many dilemmas when I think about it. The JavaScript we are used to write for Plone 4.x is not compatible with Plone 5.x. It needs to be rewritten to support AMD and RequireJS. So the addons need to break compatibility and have two supported versions. There's not an easy way to make an upgrade step to reuse the old JS, besides the registry would be different anyway. On the other hand, we are thinking about adopting ReactJS instead of Backbone and every place I study ReactJS, they use a different approach to work with Javascript modules. They use Webpack, and Webpack figures out how to work with modules without using RequireJS. So I don't know if it's the case to rewrite our registry – to stop using RequireJS and Grunt in favor of using Webpack instead – or if we are going to build a Frankenstein... Our way to manage resources will be disconnected with the way other places do ReactJS, which means that if we get in trouble, it will be our problem and we will not find easy help in the internet. |
I don't think using webpack is the way to go... not now. Webpack is amazing but it won't work with the Plone add-ons ecosystem, you need to have full control of your JavaScript sources. AMD is the only way to go right now. |
@zopyx this bug is due to my commit 45bd7db Note: meanwhile, you can just exclude your bundle from merging and it should work fine. |
@zopyx I got it. URLs prefixing works fine with bundles, but you have no bundle, you use cssregistry.xml. I need to dig a little bit more. |
@ebrehault any news about this? I've a similar issue as @zopyx but I'm using a bundle (a simple bundle with a CSS inside, that want to refers to resouces defined somewhere else). Rght now I need to define CSS with relative URLs like 😞 |
@keul, well I haven't worked on this issue yet, but what you describe is a different issue (I have to admit I did not think about referencing external resources, I am afraid it will be quite complex to handle, but I will try to figure it out). |
Thanks @ebrehault, much appreciated. |
I ran into this yesterday and can confirm that @ebrehault's solution of turning off the
|
Sorry for the noob question, @displacedaussie, but how do I insert that XML in the GenericSetup? |
@emansije you'd have to include that XML in a file system add-on, though a very recent merge gives Plone the ability to import XML like that through the web. |
I had a similar issue too yesterday. After compiling it, i had mockup patterns updated, but i lost tinymce button icons because there were some resources with a wrong url, for example: or a couple of fonts needed by plone-logged-in.css. With @ebrehault and @displacedaussie trick, it seems to be fixed, but i don't know if this change will affect something else. |
The same issue appeared on demo.plone.de with Plone 5.1.1. I worked around this with collective/demo.plone.de@a1d41f5 but it needs a proper fix in the core. |
In 5.1.2-pending i could not reprocide it any more. Can this be closed? @ebrehault |
@ebrehault I had the same issue as @cekk but with tinymce-icons in a clean instance: When running 5.1.1 in production I got requests to http://localhost:8082/Plone7/++plone++production/++unique++2018-04-18T13:49:25.560803/++plone++static/fonts/tinymce.ttf and http://localhost:8082/Plone7/++plone++production/++unique++2018-04-18T13:49:25.560803/++plone++static/fonts/tinymce.woff which do not exists so the icons in tinymce were broken. The workaround fixed these In 5.1.2 the icons in tinymce work but Plone does not use a When I run in foreground the issue never appears. Since the fix might be due to a change in tinymce the issue might still be open. |
I think so, because I haven't seen any recent changes that could have fixed it. |
Issue can be reproduced on 5.1.3-pending Reproduce: https://cms.integrationsviden.dk/++plone++production/++unique++2018-09-11T17:21:00.926425/++plone++static/fonts/plone-fontello.woff |
Afaik this was fixed. Please reopen if i am wrong. |
Just like @displacedaussie I am trying to change the tags to but I am still with Improper resource URL However in TTW override way I edit the file default.css and change the local routes with ../../fonts and the error is corrected. I am using 5.1.6 migrated from 5.1.5 Any suggestion to definitively solve? |
Copied from Community.plone.org for your convenience:
I tried again to get my XML Director stuff flying on Plone 5.0 with the 5.0.5 release - however the nightmare with falling from one trap into another continues.
I have a stylesheet referencing to some SVGs in my resource folder:
The stylesheet is configured using cssregistry.xml:
However the resource files can not be loaded due to some improper URL.
Where is this ++plone++production/++unique++/... prefix in the URL of the resource files coming from?
The text was updated successfully, but these errors were encountered: