# Babel with SeoSuite not working

**URL:** <https://community.modx.com/t/babel-with-seosuite-not-working/7319>\
**Category:** Random\
**Created:** [December 11, 2023, 7:44am UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319 "2023-12-11T07:44:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mediengaarage](https://community.modx.com/user_avatar/community.modx.com/mediengaarage/32/496_2.png) [@mediengaarage](https://community.modx.com/u/mediengaarage)\
**Post date:** [December 11, 2023, 7:44am UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319/1 "2023-12-11T07:44:24Z")

</div>

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:

```auto
[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

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [December 11, 2023, 9:11am UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319/2 "2023-12-11T09:11:44Z")

</div>

> [@mediengaarage](#):
>
> only empty pages are displayed in the frontend.

What is the response code? 500?

> [@mediengaarage](#):
>
> I get the following error message:

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

---

<div class="post-metadata">

**Author:** ![mediengaarage](https://community.modx.com/user_avatar/community.modx.com/mediengaarage/32/496_2.png) [@mediengaarage](https://community.modx.com/u/mediengaarage)\
**Post date:** [December 11, 2023, 11:57am UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319/3 "2023-12-11T11:57:36Z")

</div>

Its a PHP 8 Problem.  
When i setup PHP 7.4 it works.

Error Log-File:

```auto
[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...'

```

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [December 11, 2023, 12:21pm UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319/4 "2023-12-11T12:21:50Z")

</div>

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

> <https://github.com/Sterc/seosuite/blob/37d16a3d4d9bd145c75e7a26c1a49361a1bed174/core/components/seosuite/src/Snippets/Meta.php#L142>

---

<div class="post-metadata">

**Author:** ![mediengaarage](https://community.modx.com/user_avatar/community.modx.com/mediengaarage/32/496_2.png) [@mediengaarage](https://community.modx.com/u/mediengaarage)\
**Post date:** [December 11, 2023, 2:30pm UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319/5 "2023-12-11T14:30:07Z")

</div>

Thank you! That’s the solution!

---

<div class="post-metadata">

**Author:** ![mediengaarage](https://community.modx.com/user_avatar/community.modx.com/mediengaarage/32/496_2.png) [@mediengaarage](https://community.modx.com/u/mediengaarage)\
**Post date:** [May 7, 2025, 1:17pm UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319/6 "2025-05-07T13:17:58Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [May 7, 2025, 1:43pm UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319/7 "2025-05-07T13:43:08Z")

</div>

It looks like this error occurs “when user have no access to some context” that was fixed [with the following commit on Github](https://github.com/Sterc/seosuite/commit/cdf034ab521f16321b046202e90a2eb1c52f9983) 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).

---

<div class="post-metadata">

**Author:** ![mediengaarage](https://community.modx.com/user_avatar/community.modx.com/mediengaarage/32/496_2.png) [@mediengaarage](https://community.modx.com/u/mediengaarage)\
**Post date:** [May 7, 2025, 2:31pm UTC](https://community.modx.com/t/babel-with-seosuite-not-working/7319/8 "2025-05-07T14:31:18Z")

</div>

Thank you! It works!
