Fix broken RSS feeds after TYPO3 update
This commit is contained in:
parent
59fce3b037
commit
1fb7bd72a4
2 changed files with 22 additions and 5 deletions
|
@ -32,20 +32,34 @@ class XmlSitemapRenderer extends Typo3XmlSitemapRenderer
|
|||
*/
|
||||
public $cObj;
|
||||
|
||||
private array $typoScriptConfiguration = [];
|
||||
|
||||
public function render(string $_, array $typoScriptConfiguration, ServerRequestInterface $request): string
|
||||
{
|
||||
$this->typoScriptConfiguration = $typoScriptConfiguration;
|
||||
|
||||
return parent::render($_, $typoScriptConfiguration, $request);
|
||||
}
|
||||
|
||||
protected function initialize(array $fullConfiguration)
|
||||
{
|
||||
parent::initialize($fullConfiguration);
|
||||
$this->view->assign('settings', $this->getSettings());
|
||||
}
|
||||
|
||||
private function getSettings(): array
|
||||
{
|
||||
$settings = [];
|
||||
foreach (array_keys($typoScriptConfiguration['userFunc.']['variables.'] ?? []) as $variableName) {
|
||||
foreach (array_keys($this->typoScriptConfiguration['userFunc.']['variables.'] ?? []) as $variableName) {
|
||||
if (substr($variableName, -1) === '.') {
|
||||
continue;
|
||||
}
|
||||
$settings[$variableName] = $this->cObj->cObjGetSingle(
|
||||
$typoScriptConfiguration['userFunc.']['variables.'][$variableName] ?? '',
|
||||
$typoScriptConfiguration['userFunc.']['variables.'][$variableName . '.'] ?? []
|
||||
$this->typoScriptConfiguration['userFunc.']['variables.'][$variableName] ?? '',
|
||||
$this->typoScriptConfiguration['userFunc.']['variables.'][$variableName . '.'] ?? []
|
||||
);
|
||||
}
|
||||
$this->view->assign('settings', $settings);
|
||||
|
||||
return parent::render($_, $typoScriptConfiguration, $request);
|
||||
return $settings;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,9 @@ services:
|
|||
arguments:
|
||||
- 'pages'
|
||||
|
||||
DanielSiepmann\DsSite\Frontend\RssFeed\XmlSitemapRenderer:
|
||||
public: true
|
||||
|
||||
DanielSiepmann\DsSite\Frontend\DataProcessing\CategoriesCounts:
|
||||
public: true
|
||||
arguments:
|
||||
|
|
Loading…
Reference in a new issue