For some reason this module works differently in my local testing to my online server. When local I cannot use the "font displays" feature, but can enable the fonts and use them in my CSS. With my online server its the direct opposite, cant use the fonts in css since they dont load, but the Font Displays do work. Im on the Pantheon.io server platform.
On my local dev environment when using 'Font Displays' feature I get the following error.
Notice: Undefined property: Drupal\fontyourface\Entity\FontDisplay::$css_fallbacks in fontyourface_font_css() (line 302 of modules/fontyourface/fontyourface.module).
fontyourface_font_css(Object, Object) (Line: 79)
fontyourface_page_attachments(Array) (Line: 297)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array) (Line: 273)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments
Comment #2
btmash commented@Macronomicus,
Thanks for submitting the issue. I'm definitely a quite confused since this was one of the first things I was checking. I guess my first set of questions are
Any screenshots you can post around this would also be immensely helpful.
Comment #3
btmash commented@macronomicus, I think I have narrowed down some of the issues. It has to do with the module hook load order not being respected by its weight (which I'm still not sure why it happens). Anyways, with the new dev release, the load order will be updated if you click on any submit button on the font-your-face settings form. Additionally, the issue around the undefined property should be resolved as well (doing an empty check beforehand). Please try the latest dev and let me know if it works.
Comment #4
criscomI had the same issue with version 8.x-3.0-alpha3. I tried to upate to the latest dev version. And it worked after I did the following:
drush pm-unistall google_fonts_api
drush en google_fonts_api
Then I re-imported from google_fonts_api.
Currently working as a charm. Thanks!
Comment #5
mfischer@m2.engineering commentedLooks like a switch from direct access to attribute css_fallbacks to access via method getFallback(). Fixed it, see attached patch.
Comment #8
btmash commented@mfischer, Sorry for not getting back on this sooner. I reviewed the patch and it looks good. Committed and pushed. Thank you for your patch.
Comment #9
btmash commented