From 376e71f1f8f82cc9cc5959f7f15f5fb53871df25 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Tue, 22 May 2001 21:40:54 +0000 Subject: (Hopefully) a fix for the "n.active" watchdog error... forgot that node_get_XXXX() only queries node properties. --- modules/poll/poll.module | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'modules/poll/poll.module') diff --git a/modules/poll/poll.module b/modules/poll/poll.module index a786a820d..eefa9740c 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -228,10 +228,13 @@ function poll_save($edit) { } function poll_block() { - $poll = node_get_object(array("type" => "poll", "active" => 1)); - if ($poll) { - $poll = poll_view($poll, 0, 1); - $output = "" . $poll[title] . "
" . $poll[content]; + $result = _node_get(array("type" => "poll")); + while ($poll = db_fetch_array($result)) { + if ($poll[active]) { + $poll = poll_view($poll, 0, 1); + $output = "" . $poll[title] . "
" . $poll[content]; + break; + } } $blocks[0][subject] = "Latest poll"; $blocks[0][content] = $output ? $output : "No active polls."; -- cgit v1.2.3