Commit 6938e6cb authored by Dries's avatar Dries

- Patch #35320 by asimmonds: couldn't save roles in admin/filters/...

parent 98d19796
......@@ -475,7 +475,7 @@ function filter_admin_filters_save($format, $toggles) {
// We store the roles as a string for ease of use.
// we should always set all roles to true when saving a default role.
// We use leading and trailing comma's to allow easy substring matching.
$roles = isset($edit['roles']) ? $edit['roles'] : array();
$roles = isset($edit['roles']) ? array_keys($edit['roles']) : array();
$roles = ','. implode(',', ($edit['default_format'] ? user_roles() : $roles)) .',';
db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
......
......@@ -475,7 +475,7 @@ function filter_admin_filters_save($format, $toggles) {
// We store the roles as a string for ease of use.
// we should always set all roles to true when saving a default role.
// We use leading and trailing comma's to allow easy substring matching.
$roles = isset($edit['roles']) ? $edit['roles'] : array();
$roles = isset($edit['roles']) ? array_keys($edit['roles']) : array();
$roles = ','. implode(',', ($edit['default_format'] ? user_roles() : $roles)) .',';
db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment