Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#6 | check_if_key_exists-2815289-6.patch | 539 bytes | abarpetia |
Comments
Comment #2
botrisI can confirm this issue, this is when no (ifly) authentication details are entered.
Attached is a patch that display's the correct error message.
Comment #3
botrisThis time with patch
Comment #4
AnybodyI 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
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThe 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
Comment #6
abarpetia CreditAttribution: abarpetia as a volunteer commentedHaving same issue. Re-rolled patch against dev version.
Please review this new patch.
Comment #7
As If CreditAttribution: As If commentedApplying 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?