When an anonymous is trying to access an unpublished node like: node/234, he gets "You are not authorized to access this page." and the following messages:

Notice: Trying to get property of non-object in event_log_node_init() (line 84 of /home/openglos/evolvingmap.com/sites/all/modules/event_log/event_log_node/event_log_node.module).
Notice: Trying to get property of non-object in event_log_node_init() (line 85 of /home/openglos/evolvingmap.com/sites/all/modules/event_log/event_log_node/event_log_node.module).

Comments

porchlight’s picture

Title: Errors when accessing an unauthorized node » Errors when accessing an unauthorized node / user logout page
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.15 KB

Discovered a similar error in the event_log_user.module when I visited user/logout. Found a fix that applies to both this issue in event_log_node.module and a similar error in the event_log_user.module. Also removed arg() functions which makes things a little cleaner.

porchlight’s picture

StatusFileSize
new2.15 KB
new498 bytes

Removing extra closing parenthesis.

star-szr’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new29.92 KB
new29.96 KB

Patch looks like a great improvement, using menu_get_object() is much cleaner here.

I tested with 7.x-1.1 and was able to reproduce the notices on the user and node views:

Node:

User:

With the patch applied there are no notices.

bvanmeurs’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Thanks guys. Committed to dev, 7.x-1.2 update coming out today.