Commit 650f22bc authored by Dries's avatar Dries
Browse files

- Patch #52265 by Zen: converted filter.module to file API:

    * Converts filter.module to the fapi model (besides filter_admin_overview which has already been done.)
    * On the format edit screen, updates to the roles fieldset were being mangled with the previous code. The previous code relied on only checked checkboxes being returned. Fapi for some reason decides to insert non-checked items as well with values 0.
    * Makes the name field a UNIQUE field. DB and update patches included. Having a duplicate format name completely b0rks things.
    * Adds check_plain to the format name in admin_overview.
    * Removes unnecessary #type => 'markup'.
    * Moves hook_menu to below hook_help.
    * drupal_goto -> return.
parent 1f39ad14
......@@ -308,7 +308,8 @@ CREATE TABLE filter_formats (
name varchar(255) NOT NULL default '',
roles varchar(255) NOT NULL default '',
cache tinyint(2) NOT NULL default '0',
PRIMARY KEY (format)
PRIMARY KEY (format),
UNIQUE KEY (name)
)
/*!40100 DEFAULT CHARACTER SET utf8 */ ;
......
......@@ -293,7 +293,8 @@ CREATE TABLE filter_formats (
name varchar(255) NOT NULL default '',
roles varchar(255) NOT NULL default '',
cache smallint NOT NULL default '0',
PRIMARY KEY (format)
PRIMARY KEY (format),
UNIQUE (name)
);
--
......
......@@ -1669,3 +1669,8 @@ function system_update_175() {
}
return array();
}
function system_update_176() {
$ret[] = update_sql('ALTER TABLE {filter_formats} ADD UNIQUE KEY (name)');
return $ret;
}
This diff is collapsed.
This diff is collapsed.
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