Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Fix font fusion implementation #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Classes/Fusion/FontImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ class FontImplementation extends AbstractFusionObject
{
const GOOGLE_WEBFONT_API = '//fonts.googleapis.com/css';

/**
* @Flow\InjectConfiguration(package="CM.Neos.ThemeModule")
* @var array
*/
protected $configuration;

/**
* @Flow\Inject
* @var Request
Expand Down Expand Up @@ -54,19 +60,19 @@ class FontImplementation extends AbstractFusionObject
*/
public function evaluate()
{
$currentSitePackageKey = $this->requestService->getCurrentSitePackageKey();
$settings = $this->settingsRepository->findByIdentifier($currentSitePackageKey);
if ($settings === null) {
if ($this->configuration === null) {
return null;
}

$presetVariables = $settings['presetVariables'];
$presetVariables = $this->configuration['scss']['presetVariables'];

if (isset($presetVariables['font']['type']['font']) && is_array($presetVariables['font']['type']['font']) && count($presetVariables['font']['type']['font']) > 0) {
$fontSettings = $presetVariables['font']['type']['font'];
} else {
return null;
}

$currentSitePackageKey = $this->requestService->getCurrentSitePackageKey();
$fonts = $this->buildService->buildFontOptions($currentSitePackageKey);

if (!isset($fonts) || !is_array($fonts) || count($fonts) === 0) {
Expand Down