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

Revert "Revert "use / for font url to fix production-bundle issues"" #175

Merged
merged 3 commits into from
Oct 22, 2021

Conversation

thet
Copy link
Member

@thet thet commented Oct 22, 2021

This reverts commit 9bc2a08.

In production mode, icon fonts are not found due to urls like:
http://localhost:8080/Plone/++plone++production/++unique++2021-10-22T12:54:21.278234/++plone++static/++plone++static/fonts/plone-fontello.ttf?89786008
@mister-roboto
Copy link

@thet thanks for creating this Pull Request and help improve Plone!

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.

Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

@thet
Copy link
Member Author

thet commented Oct 22, 2021

@jenkins-plone-org please run jobs

@thet thet merged commit 274753a into 1.x Oct 22, 2021
@thet thet deleted the fix-icon-fonts branch October 22, 2021 12:35
@sneridagh
Copy link
Member

@thet could you please elaborate why did you revert this? Also, why is it needed?

image

In a site deployed in a different directory it will fail... because there's no Plone in the root...

Also, I realised of this is present also in 5.2.7 after upgrading a site to that.

/cc @erral @tisto

@erral
Copy link
Member

erral commented Mar 27, 2022

There was an error for Plone sites not deployed in the root of the domain, reported by @cekk here:

#162

I thought I found the issue and added a PR to fix that:

#168

But it looks like it did not fixed the issue, and I think it was merged without properly testing it. I think @agitator pinged me about it, so I reverted my PR and reopened the original issue:

#171

@erral
Copy link
Member

erral commented Mar 27, 2022

So the current status should be the original: fontello icons are no properly rendered it Plone is not deployed in the root of the domain.

@tisto
Copy link
Member

tisto commented Mar 31, 2022

@thet we really need feedback from you here. This is a serious issue for us and IMHO for the Plone community as well. We shipped the latest Plone version to lots of clients that are important to us, and all icons of the site are broken.

I understand if you don't have time right now to look into this. Though, then the right cause of action here would be to revert whatever commit/PR caused this and ship a new plone.staticresources package right away. IMHO this issue is serious enough to ask the @plone/release-team to ship Plone 5.2.8 asap after creating a fix.

@erral can you pinpoint the PR/commit that initially caused this?

@erral
Copy link
Member

erral commented Mar 31, 2022 via email

@thet
Copy link
Member Author

thet commented Mar 31, 2022

@tisto I agree this needs to be fixed.
If I remember correctly making the font paths relative works in development mode but not in production mode, where the ++unique++ and ++production++ paths are inserted.
@agitator should know about some other implications on this, he was providing an initial fix on that.

In current not-yet-released Plone 6 with the new resource registry this shouldn't happen anymore AFAIK /cc @jensens

I'm open for any good solution on this and do not have strong opinions other than a fix should not break another valid and common use case.
so go ahead with this!

@jensens
Copy link
Member

jensens commented Mar 31, 2022

++unique++ is replaced by ++webresource++. ++production++ is no longer needed since merging does not make sense anymore.

Overall all three traversers are based on the same plone.resource.traversal.UniqueResourceTraverser, so they work exactly the same. The only difference is the way the unique part is created. So overall, without looking further, the behavior should be the same and the failure as well, I guess, just with a different name between the 2 ++.

The idea to base the traversers on the root/navigation root is to make all cachable at its best.
This happens here:
https://github.com/plone/Products.CMFPlone/blob/1f09a8585c152ed559fdc24056bd8b77941b248a/Products/CMFPlone/resources/browser/resource.py#L250-L256

@sneridagh
Copy link
Member

But this is all about Plone 6. I assume Plone 6 will be fine.

How we address the problem that in production mode a relative link to that is broken? Also, I remember that something like that happen in Diazo, but it manages to inject the right path always.

@jensens
Copy link
Member

jensens commented Mar 31, 2022

Right, in 6 we also do not have fontello anymore, we use the new icon sub-system.

thet added a commit that referenced this pull request Mar 31, 2022
Fix issue with Glyphicons and Fontello font loading on Portals where the portal root is a level higher.
The fonts are now loaded relative to the CSS requesting them.

Fixes: #162
Fixes: #203

Ref: #168
Ref: #171
Ref: #175
Ref: https://community.plone.org/t/deployments-not-rooted-fail-to-load-the-fontello-icons/15047/12?u=thet
@thet thet mentioned this pull request Mar 31, 2022
thet added a commit that referenced this pull request Mar 31, 2022
Fix issue with Glyphicons and Fontello font loading on Portals where the portal root is a level higher.
The fonts are now loaded relative to the CSS requesting them.

Fixes: #162
Fixes: #203

Ref: #168
Ref: #171
Ref: #175
Ref: https://community.plone.org/t/deployments-not-rooted-fail-to-load-the-fontello-icons/15047/12?u=thet
thet added a commit that referenced this pull request Mar 31, 2022
Fix issue with Glyphicons and Fontello font loading on Portals where the portal root is a level higher.
The fonts are now loaded relative to the CSS requesting them.

Fixes: #162
Fixes: #203

Ref: #168
Ref: #171
Ref: #175
Ref: https://community.plone.org/t/deployments-not-rooted-fail-to-load-the-fontello-icons/15047/12?u=thet
mister-roboto pushed a commit to plone/buildout.coredev that referenced this pull request Mar 31, 2022
Branch: refs/heads/1.x
Date: 2022-03-31T21:11:08+02:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: plone/plone.staticresources@f6a3d5b

Fix icon font loading.

Fix issue with Glyphicons and Fontello font loading on Portals where the portal root is a level higher.
The fonts are now loaded relative to the CSS requesting them.

Fixes: plone/plone.staticresources#162
Fixes: plone/plone.staticresources#203

Ref: plone/plone.staticresources#168
Ref: plone/plone.staticresources#171
Ref: plone/plone.staticresources#175
Ref: https://community.plone.org/t/deployments-not-rooted-fail-to-load-the-fontello-icons/15047/12?u=thet

Files changed:
A news/xxxx.bugfix
A src/plone/staticresources/upgrades/17.zcml
A src/plone/staticresources/upgrades/profiles/17/registry.xml
M src/plone/staticresources/profiles/default/metadata.xml
M src/plone/staticresources/profiles/default/registry/bundles.xml
M src/plone/staticresources/profiles/last_compilation/registry.xml
M src/plone/staticresources/static/plone-fontello.less
M src/plone/staticresources/static/plone-glyphicons.less
M src/plone/staticresources/upgrades/configure.zcml
Repository: plone.staticresources

Branch: refs/heads/1.x
Date: 2022-03-31T21:11:08+02:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: plone/plone.staticresources@9dcd84d

Compiled.

Files changed:
M src/plone/staticresources/static/plone-fontello-compiled.css
M src/plone/staticresources/static/plone-fontello-compiled.css.map
M src/plone/staticresources/static/plone-glyphicons-compiled.css
M src/plone/staticresources/static/plone-glyphicons-compiled.css.map
Repository: plone.staticresources

Branch: refs/heads/1.x
Date: 2022-03-31T23:29:29+02:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: plone/plone.staticresources@15a5a4d

Merge pull request #207 from plone/fix-icon-font-loading

Fix icon font loading

Files changed:
A news/xxxx.bugfix
A src/plone/staticresources/upgrades/17.zcml
A src/plone/staticresources/upgrades/profiles/17/registry.xml
M src/plone/staticresources/profiles/default/metadata.xml
M src/plone/staticresources/profiles/default/registry/bundles.xml
M src/plone/staticresources/profiles/last_compilation/registry.xml
M src/plone/staticresources/static/plone-fontello-compiled.css
M src/plone/staticresources/static/plone-fontello-compiled.css.map
M src/plone/staticresources/static/plone-fontello.less
M src/plone/staticresources/static/plone-glyphicons-compiled.css
M src/plone/staticresources/static/plone-glyphicons-compiled.css.map
M src/plone/staticresources/static/plone-glyphicons.less
M src/plone/staticresources/upgrades/configure.zcml
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 this pull request may close these issues.

6 participants