Problem/Motivation

When calling the function nodejs_get_content_channel_users() in the module file, the response returns empty arrays.

    [uids] => Array
        (
        )

    [authTokens] => Array
        (
        )

I have logged the return from the nodejs application and it comes back as an object with arrays. The current return is trying to access an object of objects.

Steps to reproduce

Add user to a token channel and then call the function nodejs_get_content_channel_users().

Proposed resolution

Patch the return from

        return array(
        'uids' => !empty($node_response->users->uids) ? $node_response->users->uids : array(),
        'authTokens' => !empty($node_response->users->authTokens) ? $node_response->users->authTokens : array(),
      );

to

      return array(
        'uids' => !empty($node_response->users['uids']) ? $node_response->users['uids'] : array(),
        'authTokens' => !empty($node_response->users['authTokens']) ? $node_response->users['authTokens'] : array(),
      );

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork nodejs-3203778

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

2dtw created an issue. See original summary.

2dtw’s picture

.

imclean’s picture

Status: Active » Needs review