finish Drupal 4.7 upgrade
deekayen - January 5, 2006 - 23:08
| Project: | Statistics filtering |
| Version: | HEAD |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
The Filter Roles checkboxes are not saving properly, but if that can be fixed, I think it's ready for release.

#1
Just installed the module from CVS and worked for me on a fresh Drupal copy installed from CVS as well. ;-)
#2
Too fast, I've been... now I'm getting "Illegal choice in Roles to ignore." when not setting any role. hmm....
#3
I believe I've been able to make it work using the following code:
$roles = user_roles();$variable_roles = variable_get('statistics_filter_roles', array());
$default_roles = array();
foreach ($roles as $key => $value) {
if (in_array($key, $variable_roles)) {
$default_roles[] = $key;
}
}
$form['statistics_filter_roles'] = array(
'#type' => 'checkboxes',
'#title' => t('Roles to ignore'),
'#default_value' => $default_roles,
'#options' => $roles,
'#description' => t("Ignore accesses by users in any of the checked roles.")
);
Do you prefer a patch? Though, it could probably be made simpler. The trick is #default values do not use a named array. See what I mean?
#4
#5
worked for me after I updated my copy of Drupal core. committed and branched for DRUPAL-4-7