Hello

there is a problem with advpoll and sqlite. Namely in the function advpoll_get_poll_info_blocks($blocks) on line 955.

for the module to be compatible the query should be split up or date("Y-m-s H:i:s", time()) would have to be used.

PDOException: SQLSTATE[HY000]: General error: 1 no such function: NOW: SELECT n.title, n.nid FROM {node} n LEFT JOIN {field_data_advpoll_dates} d ON d.revision_id = n.vid LEFT JOIN {field_data_advpoll_closed} c ON c.revision_id = n.vid LEFT JOIN {field_data_advpoll_options} o ON o.revision_id = n.vid WHERE n.type = 'advpoll' AND o.advpoll_options_value = 'block' AND n.status = 1 AND c.advpoll_closed_value = 'open' AND d.advpoll_dates_value < NOW() AND d.advpoll_dates_value2 > NOW() ORDER BY n.created DESC; Array ( ) in advpoll_get_poll_info_blocks() (line 969 of [...]\modules\advpoll\advpoll.module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tassoman’s picture

Issue summary: View changes

Looks like anyone isn't interested on sqlite. Shall we vote for it? :)

tripper54’s picture

Patches welcome!

dagmar’s picture

Status: Active » Needs review
FileSize
2.41 KB

Here is the patch.

heykarthikwithu’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
1.95 KB

This can be achieved through date('now') or date("Y-m-d H:i:s"), reference https://www.sqlite.org/lang_datefunc.html.
so moving to RTBC.

tripper54’s picture

Status: Reviewed & tested by the community » Needs review

The patch in #4 is wrong. @heykethikwithu , the date() function here is php's date() function , not sqlite's. So php's dates parses date('now') as 'show me the current date in the format now , ie monthYearmonth'. Which isn't what we're looking for.

I'll test the patch in #3 when time permits.

tripper54’s picture

Status: Needs review » Needs work

#3 needs re-rolling.