Skip to content

Troubleshooting

4AI assistant opens but most buttons are unresponsive

This is happening because some of the files needed by 4AI are blocked, usually by a security system running on your server, or as a Joomla extension or in your .htaccess file.

AdminTools by Akeeba incorrectly blocks 4AI files

The most common instance is AdminTools by Akeeba blocking access to 2 main files used by 4AI, which results in 4AI being broken.

We suggest you consult with Akeeba to learn about the proper and latest way to fix this, but one of our users collected the following information that appears to fix the problem:

In AdminTools, access the .htaccess Maker ( Components, Admin Tools, Control Panel, .htaccess Maker)

Find the Allow direct access to these files setting. Create two new lines (press the green + icon) and enter the following content in the respective entry box on each line

media/com_forai/vendor/weeblr/forai/assets/encoder/encoder.json media/com_forai/vendor/weeblr/forai/assets/encoder/vocab.bpe Important: there is no trailing slash.

Click on Save & Create .htaccess in the toolbar at the top of the page.

I cannot save some or any settings, I get a Cannot communicate with server Unexpected token < in JSON error message

As of 2023-02-27, there is a bug in the YooTheme WidgetKit component that breaks 4AI (and potentially more extensions from us and others) communication with your Joomla site.

Widgetkit 3.1.16 was released near March 17, 2023, and should contain a fix for this issue. Please refer to the YooTheme support forum thread where this is discussed for any further assistance from YooTheme.

That's not a problem in 4AI and nothing can be done on our side to fix it.

We have identified the problem and multiple users have passed on the information to YooTheme. The YooTheme support forum thread where this is discussed is here.

Until YooTheme comes up with a fixed update, you can:

  • disable widgetkit if you do not actually use it

or

  • apply the following bug fix to WidgetKit:

1 - Open the file /administrator/components/com_widgetkit/vendor/yootheme/framework/src/Routing/Request.php at around line 67, you'll see:

$this->server     = new ServerBag($server ?: $_SERVER);
$this->headers    = new HeaderBag($this->server->getHeaders());

// decode json content type
if (stripos($this->headers->get('CONTENT_TYPE') ?: '', 'application/json') !== false) {
    if ($json = json_decode(@file_get_contents('php://input'), true)) {
        $this->request->add($json);
    }
}

2 - Replace this section so that it looks like this:

$this->server     = new ServerBag($server ?: $_SERVER);
$this->headers    = new HeaderBag($this->server->getHeaders());

// decode json content type
// Fix by Weeblr
if (stripos($this->headers->get('CONTENT_TYPE') ?: '', 'application/json') !== false) {
    if ($json = json_decode(@file_get_contents('php://input'), true)) {
        $saferJson = empty($json) || !is_array($json)
            ? [$json]
            : $json;
        $this->request->add($saferJson);
    }
}
// End fix by Weeblr

3 - After saving the modified file, 4AI should work normally again

I cannot save some or any settings, I get a Cannot communicate with server Unexpected token < in JSON error message (JoomlaTools)

As of 2023-07-200, websites using any of the JoomlaTools extensions such as Docman or Logman will experience the same issues as described above for WidgetKit.

These extensions include JoomlaTools Koowa framework, usually as a Joomla system plugin. This framework unfortunately and incorrectly intercepts 4AI communication with your server, but fails with a PHP error in doing so and therefore prevents 4AI from operating.

JoomlaTools is aware of the problem but no fixed version has been release to our knowledge yet. We invite you to contact JoomlaTools directly to obtain a fixed version, or disable or uninstall these extensions when no other options exist.

Until JoomlaTools releases a fixed version, you can:

  • disable that extension if not actively using it

or

  • apply the following bug fix:

1 - Open the file /libraries/joomlatools/library/dispatcher/request/abstract.php at around line 211, you'll see:

$this->data->add($data);

2 - Replace this section so that it looks like this:

// Weeblr 2023-07-20
//$this->data->add($data);
$saferData = !is_array($data)
    ? [$data]
    : $data;
$this->data->add($saferData);
// Weeblr 2023-07-20

3 - After saving the modified file, 4AI should work normally again