When I click on the App settings tab under Configuration --> DrupalChat --> App Settings, I receive this error

Fatal error: Cannot use object of type stdClass as array in drupalchat.admin.inc on line 15

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

g33kg1rl created an issue. See original summary.

botris’s picture

Status: Active » Needs review

I can confirm this issue, this is when no (ifly) authentication details are entered.
Attached is a patch that display's the correct error message.

botris’s picture

FileSize
537 bytes

This time with patch

Anybody’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

I can confirm the issue. I just tested 7.x-2.1 and 7.x-2.x (dev) on simplytestme with this error.
It should NOT be necessary to enter api keys because the module might be used in secure intranet environments for example.

Increasing priority because it makes the module unusable.

The patch from above works for me. RTBC +1

SocialNicheGuru’s picture

The patch no longer applies to the dev version:

git apply 2815289.2.patch
2815289.2.patch:10: trailing whitespace.
if (array_key_exists('key', $json)) {
2815289.2.patch:11: trailing whitespace.
$token = $json['key'];
2815289.2.patch:12: trailing whitespace.
} else {
2815289.2.patch:13: trailing whitespace.
return drupal_set_message($json->data, 'warning');
2815289.2.patch:14: trailing whitespace.
}
fatal: corrupt patch at line 16
aegir@insitehost:~/p/7/m/all/drupalchat$ patch -p1 < 2815289.2.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file drupalchat.admin.inc
Hunk #1 FAILED at 12 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file drupalchat.admin.inc.rej

abarpetia’s picture

Version: 7.x-2.1 » 7.x-2.x-dev
Status: Reviewed & tested by the community » Needs review
FileSize
539 bytes

Having same issue. Re-rolled patch against dev version.

Please review this new patch.

As If’s picture

Applying patch #3 to DrupalChat 7.x-2.8 allows me to click the "App Settings" tab without getting the fatal error (so that's a step in the right direction), but when I do it says "API key is invalid."

Do I really need an API key to use the AJAX polling method?