It seems that SeoSuite has a problem with Babel.
I have installed both and set up the contexts, the htaccess file and the gateway.
Unfortunately, only empty pages are displayed in the frontend.
I get the following error message:
[2023-12-11 08:33:10] (ERROR @ /.../core/components/seosuite/model/seosuite/snippets/seosuitesnippets.class.php : 384) PHP warning: Undefined property: SeoSuiteSnippets::$babel
[2023-12-11 08:33:10] (ERROR @ /.../core/components/seosuite/model/seosuite/seosuite.class.php : 267) PHP warning: Undefined array key "debug"
if I uninstall SeoSuite, the site works perfectly.
ModX 2.8.6
PHP 8.1
SEO Suite 2.0.6
Babel 3.1.1
What is the response code? 500?
The “error” messages you provided are just warnings. It’s unlikely they break the site.
Is there maybe another “real” error message in the server error log? (Fatal error can’t get logged by MODX in the MODX error log.)
Its a PHP 8 Problem.
When i setup PHP 7.4 it works.
Error Log-File:
[Mon Dec 11 12:52:50 2023] [error] [client 91.2.51.115:0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /.../core/components/seosuite/model/seosuite/snippets/seosuitesnippets.class.php:141\nStack trace:\n#0 /.../core/components/seosuite/model/seosuite/snippets/seosuitesnippets.class.php(141): implode()\n#1 /.../core/cache/includes/elements/modsnippet/53.include.cache.php(14): SeoSuiteSnippets->seosuiteMeta()\n#2 /.../core/model/modx/modscript.class.php(76): include('...')\n#3 /.../core/model/modx/modx.class.php(1865): modScript->process()\n#4 /.../core/components/seosuite/model/seosuite/plugins/seosuiteresourceplugin.class.php(238): modX->runSnippet()\n#5 /.../core/components/seosuite/model/seosuite/seosuite.class.php(338): SeoSuiteResourcePlugin->onLoadWebDocument()\n#6 /.../core/c...'
In the file core/components/seosuite/model/seosuite/snippets/seosuitesnippets.class.php
on line 141, change 'output' => implode($values, PHP_EOL)
to the following instead: (The function parameters have to be switched.)
$values[] = $this->getChunk($tplLink, [
'name' => 'alternate',
'value' => $alternative['url'],
'hreflang' => str_replace(['_', '.utf8'], ['-', ''], $alternative['locale'])
]);
}
$meta['_alternates'] = [
'name' => 'alternates',
'value' => $this->modx->getChunk($tplAlternateWrapper, [
'output' => implode(PHP_EOL, $values)
])
];
}
ksort($meta);
$html = [];
foreach ($meta as $key => $item) {
$tpl = isset($item['tpl']) && !empty($item['tpl']) ? $item['tpl'] : null;
$key = trim($key, '_');
1 Like
Thank you! That’s the solution!