When viewing a node with an attached voting field, I get the following notices:
(With vote_up_down 1.x-dev and votingapi 2.x-dev)

Notice: Use of undefined constant NODE_BUILD_PREVIEW - assumed 'NODE_BUILD_PREVIEW' in vud_node_node_view() (line 147 of [...]/modules/contrib/vote_up_down/vud_node/vud_node.module).
Notice: Use of undefined constant NODE_BUILD_SEARCH_INDEX - assumed 'NODE_BUILD_SEARCH_INDEX' in vud_node_node_view() (line 148 of [...]/modules/contrib/vote_up_down/vud_node/vud_node.module).
Notice: Use of undefined constant NODE_BUILD_SEARCH_RESULT - assumed 'NODE_BUILD_SEARCH_RESULT' in vud_node_node_view() (line 149 of [...]/modules/contrib/vote_up_down/vud_node/vud_node.module).
Notice: Use of undefined constant NODE_BUILD_RSS - assumed 'NODE_BUILD_RSS' in vud_node_node_view() (line 150 of [...]/modules/contrib/vote_up_down/vud_node/vud_node.module).
Notice: Undefined property: stdClass::$build_mode in vud_node_node_view() (line 152 of [...]/modules/contrib/vote_up_down/vud_node/vud_node.module).
Notice: Undefined variable: a3 in vud_node_node_view() (line 161 of [...]/modules/contrib/vote_up_down/vud_node/vud_node.module).

CommentFileSizeAuthor
#1 node_view_notices-1933046-1.patch1.33 KBitamar

Comments

itamar’s picture

Status: Needs work » Needs review
StatusFileSize
new1.33 KB

Suggesting the following fix;
1. Check that constants are defined before adding them to $exclude_modes.
2. Check that the node has the build_mode property before comparing it to the array.
3. 'return' instead of 'break'.

marvil07’s picture

Status: Needs review » Closed (won't fix)

vud_node will be removed soon from D7 version. Details on #1295574: Remove vud_{node,comment,term} modules in favour of vud_field and #1360572: Roadmap for D7 of Vote up/down

You probably want to use vud_field instead of vud_node ;-)