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

Problem with fontello resources with 1.4.3 version #162

Closed
cekk opened this issue Aug 11, 2021 · 14 comments · Fixed by #171
Closed

Problem with fontello resources with 1.4.3 version #162

cekk opened this issue Aug 11, 2021 · 14 comments · Fixed by #171
Labels
01 type: bug Something isn't working 12 prio: high

Comments

@cekk
Copy link
Member

cekk commented Aug 11, 2021

I've updated my Plone 5.2.4 site to the new 5.2.5 and made the upgrade-step.

The site is published as "http://my-site.com/api" (with /api because it's Volto's backend).
All resources are loaded correctly (with /api/), except fontello ones: they don't have /api in the url and are loaded on a wrong context (that is the the Volto instance).

I think that could be related to recent changes made here.

Could be solved removing the "/"? Something like this:

@fontsPrefix: '++plone++static/fonts/';

@cekk
Copy link
Member Author

cekk commented Aug 11, 2021

@agitator could have the answer ;)

@agitator
Copy link
Member

Moved the fontello fonts to their own bundle, to not include them inlined in every bundle.
Not sure how that should affect volto...?

@nzambello nzambello added 01 type: bug Something isn't working 12 prio: high labels Aug 12, 2021
@nzambello
Copy link
Member

Volto is not affected, but a Plone site used as Volto backend is published under /api
Fontello resources are loaded as /...... so the browser is asking to Volto something that just doesn't exist.

@agitator
Copy link
Member

I recall that I had to play around to make it work for dev and production... using / did solve it.
Not sure what your setup exactly looks like...should we discuss it on discord #classic-ui?
If those paths can't be resolved in your case, maybe inline that font into the css?

@agitator
Copy link
Member

@cekk as we discussed ... best way would be to do a manual bundle... those font bundles won't change anyway

  • don't use plone-compile for that
  • create a little compile-script (probably just a one liner) to inline the fonts
  • add some comments about the process into the readme

Only downside is that all types (ttf/eot/...) of that webfont are loaded then

cc @thet

@sneridagh
Copy link
Member

@agitator so the upgrade step is broken? do the vanilla installation work?

@sneridagh
Copy link
Member

sneridagh commented Sep 12, 2021

@agitator at first I couldn't get a full grasp of the thing, even when we talked about it, but I think now I did:
Login at: https://6.demo.plone.org/api

image

(it's a 200 because Volto or whatever it's in the root answers)

Regardless that's a Volto in the root level, which it's not relevant in the issue (Volto simply does not care), this will break on any site that does not have an instance in the root level, thus, won't be able to deliver the resource properly.

Isn't it more sensible serve and get the assets relatively (like @cekk suggested?).

@erral
Copy link
Member

erral commented Oct 6, 2021

This is because of this commit:

0228cd7

Here we are requesting the font to be loaded from the root of the site.

@agitator
Copy link
Member

agitator commented Oct 6, 2021

create a pull request without the "/" I'll happily will test it out ;-)

@erral
Copy link
Member

erral commented Oct 6, 2021

Done, I just revert the previous commit #168

thet added a commit that referenced this issue Oct 21, 2021
thet pushed a commit that referenced this issue Oct 21, 2021
thet pushed a commit that referenced this issue Oct 21, 2021
@thet
Copy link
Member

thet commented Oct 21, 2021

Fixed via: #168

@thet thet closed this as completed Oct 21, 2021
thet pushed a commit that referenced this issue Oct 21, 2021
Fix problem with fontello resources.
Fixes #162 reverting commit
Ref: #168
Ref: #172
thet pushed a commit that referenced this issue Oct 21, 2021
Fix problem with fontello resources.
Fixes #162 reverting commit
Ref: #168
Ref: #171
thet pushed a commit that referenced this issue Oct 21, 2021
Fix problem with fontello resources.
Fixes #162 reverting commit 8ede7fa
Ref: #168
Ref: #171
thet pushed a commit that referenced this issue Oct 21, 2021
Fix problem with fontello resources.
Fixes #162 reverting commit 8ede7fa
Ref: #168
Ref: #171
@erral
Copy link
Member

erral commented Oct 22, 2021

After the revert of the fix we should reopen this to keep track of it.

@erral erral reopened this Oct 22, 2021
@cekk
Copy link
Member Author

cekk commented Jan 26, 2022

@thet i'm confused.

#172 should be the pr that generated 1.4.4 version, right?
But if i try to download that from pypi, i see that all fontello compiled resources still have "/++plone++static" and not "++plone++static"

thet added a commit that referenced this issue 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 issue 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 issue 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 issue 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
@thet
Copy link
Member

thet commented Apr 2, 2022

Fixed by: #207

@thet thet closed this as completed Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 type: bug Something isn't working 12 prio: high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants