If you set the export range to the same day, you can an empty dataset because the SELECT statement will look for a range spanning a single second of the day.

Line 128 of download_count/includes/download_count.export.inc

$from = strtotime($start['year'] . '-' . $start['month'] . '-' . $start['day']);
$to = strtotime($end['year'] . '-' . $end['month'] . '-' . $end['day']);

below this, add the following conditional:

$from = strtotime($start['year'] . '-' . $start['month'] . '-' . $start['day']);
$to = strtotime($end['year'] . '-' . $end['month'] . '-' . $end['day']);
if ($from == $to) {
$to += 86400;
}

Which means: If the start and end time stamps are the same, make the end time stamp 24 hours after the start time stamp.

I believe this provides expected behavior.

jyg

CommentFileSizeAuthor
#1 download_count.range-fix.patch911 bytesjyg

Comments

jyg’s picture

StatusFileSize
new911 bytes

Here's the patch...

WorldFallz’s picture

Status: Active » Fixed

jyg for the trifecta! Thanks again.

Committed to current dev.

http://drupalcode.org/project/download_count.git/commit/04b3cbb

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.