Project:Terms of Use
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

If you visit the registration page before choosing a terms of service node, you get:

    * notice: Trying to get property of non-object in /Applications/MAMP/htdocs/6x2/modules/node/node.module on line 1035.
    * notice: Trying to get property of non-object in /Applications/MAMP/htdocs/6x2/modules/node/node.module on line 1035.
    * notice: Undefined property: stdClass::$body in /Applications/MAMP/htdocs/6x2/modules/node/node.module on line 1038.
    * notice: Undefined property: stdClass::$format in /Applications/MAMP/htdocs/6x2/modules/node/node.module on line 1038.

node_load actually returns FALSE if a node wasn't found, not NULL. so this:

    // Getting the node that contains the Terms of Use
    $node = node_load(variable_get('terms_of_use_node', ''));
    if (isset($node)) {

will return TRUE since FALSE counts as a defined value. Crazy, but true.

Comments

#1

Status:active» needs review

This seems to take care of it.

AttachmentSize
terms_of_use-node_load-check-263821-1.patch 1.14 KB

#2

Status:needs review» reviewed & tested by the community

Good catch.

I have déjà vu here.

Oh right... http://drupal.org/node/117630

Thanks, Angie. :-)

#3

Status:reviewed & tested by the community» fixed

#4

assigned to webchick.

#5

Status:fixed» closed (fixed)

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

nobody click here