Babel with SeoSuite not working

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.)

1 Like

Thank you! That’s the solution!

It has worked for a long time now. Unfortunately, I am now receiving an Error 500 with the following error message:

www.domain.de [Wed May 07 13:57:24 2025] [error] [client 2003:cf:f0a:2f00:64ca:1f7a:6ca7:b97e:0] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getOption() on null in /.../core/components/seosuite/model/seosuite/snippets/seosuitesnippets.class.php:359\nStack trace:\n#0 /.../core/components/seosuite/model/seosuite/snippets/seosuitesnippets.class.php(126): SeoSuiteSnippets->getAlternateLinks()\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(237): modX->runSnippet()\n#5 /.../core/components/seosuite/model/seosuite/seosuite.class.php(338): SeoSuiteResourcePlugin->onLoadWebDocument()\n#6 /.../...'

PHP 8.3
Babel 3.5.0
SEO Suite 2.0.6
ModX 2.8.8

It looks like this error occurs “when user have no access to some context” that was fixed with the following commit on Github for the 3.x version.

I don’t think a 2.x version of the SeoSuite extra is maintained anymore, so you probably have to fix the code yourself:

In the file core/components/seosuite/model/seosuite/snippets/seosuitesnippets.class.php on line 356 ($ctx = $this->modx->getContext($contextKey);) add an if(... statement to make sure $ctx is not null (like it’s done in the commit linked above).

Thank you! It works!