Download & Extend

Filter by file extension doesn't work

Project:Download Count
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (works as designed)

Issue Summary

There are two problems:
1. If you don't save parameters after installing module, "download_counter_view_page_header" is empty string
2. No check in download_count_view_page()

I attached file that have bug 2 fixed.
The first is "a feature" ;)

AttachmentSize
download_count.module.zip3.19 KB

Comments

#1

Let me expand upon this bug. When download_counter.module is installed, the default variables are not written to the database. admin/settings/download_count shows that "download_count_excluded_file_extensions" is set, when in reality it is not. A work-around at this point is to submit the form with the default values, but the default values really should be entered at installation.

However, IMO there does not need to be a check for excluded extensions in download_count_view_page(). If files with the excluded extensions are not counted, then they will not show up on this list.

#2

Status:active» closed (works as designed)

The Drupal function variable_get() has a default value for 2nd parameter, to account for cases where a value has not been saved (no one has saved the configuration on the setttings page). There's no bug.

The default value for the 'header' (just markup that appears before the table, not a HTTP header) is an empty string, as it should be.