The nodejs_requirements() function calls Nodejs::sendMessage(), and process the result as if it was the object returned by drupal_http_request. This is not the case anymore, as we process http_requests through Nodejs::httpRequest() method.

Right now, if there's not an error, but the Node server is not running, Nodejs::httpRequest() will return FALSE, which will make the following code to run the "else" clause:

    if (isset($response->error)) {
      $result = array(
        'value' => check_plain($response->error),
        'severity' => REQUIREMENT_ERROR,
      );
    }
    else {
      $result = array(
        'value' => check_plain($response->status_message),
        'severity' => REQUIREMENT_OK,
      );
    }

There, it will try to access $response->status_message, but since $response is a boolean, it will cause a WSOD, as it tries to access a property on a non-object variable.

The patch attached fixes that, by adapting the response to the new way of processing requests / responses to / from the Nodejs server.

CommentFileSizeAuthor
nodejs_requirements_request_fix.patch1.32 KBslv_

Comments

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

this looks good to go to me.

as an aside, we could do a lot more here, by trying to do the whole loop.

basically, pushing some JS to this page as well, and throwing some errors if we can't open an authenticated socket, but this can be a follow up issue.

slv_’s picture

That makes sense to me. Happy to look into it when time allows! ;D.

Will commit this then.

slv_’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit e5fda7c on 7.x-1.x, 8.x-1.x, 8.x-1.x-head by slv_:
    #1997162: fixed minor bug in nodejs.install, hook_requirementsm that...