Filter by file extension doesn't work
arbinada - December 20, 2007 - 23:12
| Project: | download_count |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | by design |
Jump to:
Description
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" ;)
| Attachment | Size |
|---|---|
| download_count.module.zip | 3.19 KB |

#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
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.