diff options
Diffstat (limited to 'modules/poll/poll.module')
-rw-r--r-- | modules/poll/poll.module | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 373ee0d03..56e3d75c4 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -436,7 +436,12 @@ function poll_load($nodes) { $poll = db_query("SELECT runtime, active FROM {poll} WHERE nid = :nid", array(':nid' => $node->nid))->fetchObject(); // Load the appropriate choices into the $poll object. - $poll->choice = db_query("SELECT chid, chtext, chvotes, weight FROM {poll_choice} WHERE nid = :nid ORDER BY weight", array(':nid' => $node->nid))->fetchAllAssoc('chid', PDO::FETCH_ASSOC); + $poll->choice = db_select('poll_choice', 'c') + ->addTag('translatable') + ->fields('c', array('chid', 'chtext', 'chvotes', 'weight')) + ->condition('c', 'nid', $node->nid) + ->orderBy('weight') + ->fetchAllAssoc('chid', PDO::FETCH_ASSOC); // Determine whether or not this user is allowed to vote. $poll->allowvotes = FALSE; |