I use polls infrequently and want them on the sidebar when they are active. But I don't want an inactive poll displayed for weeks or months.

This patch changes the SQL that selects the latest poll to display. It simply adds the requirement that the poll be active.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Prometheus6’s picture

Should be vs. CVS instead of 4.5

Dries’s picture

  1. "JOIN poll p": should be "JOIN {poll} p" or things will break when database prefixing is used.
  2. "on p.nid=n.nid": should be "ON p.nid = n.nid". Use capital letters for SQL keywords, and put spaces around "=".

Other than that, this looks like a bug fix.

Prometheus6’s picture

Category: feature » bug
FileSize
1.19 KB

Bug fix, yes, but I figured if no one complained in so long it was intentional. Or maybe most people that use polls use them frequently.

Two corrections to formatting, and braces around the table name added.

Dries’s picture

killes@www.drop.org’s picture

patch: **** malformed patch at line 12:

Prometheus6’s picture

Priority: Minor » Normal
FileSize
968 bytes
Steven’s picture

Your last patch did not include the join. I committed a fixed one to HEAD. I also got rid of the WHERE n.type = "poll" as it is already implicitly taken into account by doing an INNER JOIN on the poll table.

Anonymous’s picture