Hello,

the drupalchat does not work with the actual nodejs 7.x-1.1 server intergrateion.
I get this output:

admin@myserver:/.../sites/all/modules/nodejs# node server.js
Extension loaded: drupalchat_nodejs.server.extension.js
Started http server.
   info  - socket.io started
publishMessageToContentChannel: The channel "watchdog_dblog" doesn't exist.
Auth - 1

/.../sites/all/modules/nodejs/drupalchat_nodejs.server.extension.js:26
      publishMessageToClient(sessionId, {type: 'createChannel', data: 'create'
      ^
TypeError: undefined is not a function
    at process.<anonymous> (/.../sites/all/modules/nodejs/drupalchat_nodejs.server.extension.js:26:7)
    at process.EventEmitter.emit (events.js:99:17)
    at setupClientConnection (/.../sites/all/modules/nodejs/server.js:1082:11)
    at Request.authenticateClientCallback [as _callback] (/.../wcity/sites/all/modules/nodejs/server.js:240:5)
    at Request.init.self.callback (/.../sites/all/modules/nodejs/node_modules/request/main.js:120:22)
    at Request.EventEmitter.emit (events.js:99:17)
    at Request.<anonymous> (/.../sites/all/modules/nodejs/node_modules/request/main.js:555:16)
    at Request.EventEmitter.emit (events.js:96:17)
    at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/.../sites/all/modules/nodejs/node_modules/request/main.js:517:14)
    at IncomingMessage.EventEmitter.emit (events.js:126:20)
admin@myserver:/.../sites/all/modules/nodejs# 

Thanks for any help!
Frank

Comments

fraweg’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta14
plessas’s picture

It seems that there was a problem with drupal nodejs integration 7.x-1.1 and a new version was released immediately:

http://drupal.org/node/1043568/release

I don't know if this is going to fix the problem anyway, since the old 7.x-1.0 version of nodejs was released almost 8 months ago, so new changes may require also changes in drupalchat.

fraweg’s picture

Hello,

thanks for your post!

With the version 1.2 the issue is the same :-(

Best regards
Frank

fraweg’s picture

Title: Drupalchat does not work with nodejs 1.1 » Drupalchat does not work with nodejs 1.1 (1.2)
SocialNicheGuru’s picture

I am having the same issue

fraweg’s picture

Why is there no support in this issue? Thats really frustrating.....

darklrd’s picture

So, did it earlier use to work?

fraweg’s picture

Hello darklrd,

So, did it earlier use to work?

Did you mean that the drupal chat work with earlier versions of nodejs integration?

With nodejs 1.0 the chat works. Only the Opera logout issue that is describe here:

http://drupal.org/node/1546212 #12

is a problem with this version.

Best regards
Frank

dstorozhuk’s picture

Hi guys, I've figured out what the problem is.
The anonymous functions accessible only after if was defined.
In our case, the configuration object was defined early that the needed functions was assigned to the variables.

So, the solution is to move configuration object in file server.js just above the call of invokeExtensions('setup', extensionsConfig);
In final version if should be something like this:
file nodejs/server.js

...
/**
 * Define a configuration object to pass to all server extensions at
 * initialization. The extensions do not have access to this namespace,
 * so we provide them with references.
 */
var extensionsConfig = {
  'publishMessageToChannel': publishMessageToChannel,
  'publishMessageToClient': publishMessageToClient,
  'addClientToChannel': addClientToChannel,
  'settings': settings,
  'channels': channels,
  'io': io,
  'tokenChannels': tokenChannels,
  'authenticatedClients': authenticatedClients,
  'request': request,
  'sendMessageToBackend': sendMessageToBackend
};

invokeExtensions('setup', extensionsConfig);

...
plessas’s picture

I can confirm that the change that dstorozhuk proposes results in a working solution with nodejs integration module v.1.2.

However, in my case, i am still facing problems with the number of users that appear in chat lists and with logged out users remaining present in the lists (http://drupal.org/node/1980258).

@dstorozhuk: do you face the same problems? If not can you post your configuration file?

delta’s picture

The solutions proposed by dstorozhuk works for me too. i had the same issue described in the summary;

delta’s picture

for the follow up in nodejs module on this issue, it's commited in the dev version :
https://drupal.org/node/2035159

giorgio79’s picture

Status: Active » Closed (fixed)

Closing old issue