Skip to content

Commit

Permalink
Bugfix: Use siteNode while rendering in API
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikdro committed Feb 10, 2021
1 parent e49b4d6 commit b27c418
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Classes/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ public function initializeAction()
$this->response->setComponentParameter(SetHeaderComponent::class, 'Vary', 'Origin');
}


public function renderCookieSettingsAction(array $dimensions = [])
/**
* @param NodeInterface $siteNode
* @throws \Neos\ContentRepository\Exception\NodeException
* @throws \Neos\Eel\Exception
*/
public function renderCookieSettingsAction(NodeInterface $siteNode)
{
$this->view->setVariablesToRender(['html', 'needsRenew']);

$q = new FlowQuery([$this->contextFactory->create(['dimensions' => $dimensions])->getRootNode()]);
$q = new FlowQuery([$siteNode]);
$node = $q->find('[instanceof KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings]')->get(0);

//Reply with empty string, if there is no configured CookieConsent
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ prototype(Neos.Neos:Page) {
package = 'KaufmannDigital.GDPR.CookieConsent'
controller = 'Api'
action = 'renderCookieSettings'
arguments.dimensions = ${site.context.dimensions}
arguments.siteNode = ${site.contextPath}
absolute = true
}

Expand Down

0 comments on commit b27c418

Please sign in to comment.