The install script should be using the {announcements} in the install SQL and is not.
Currently is:
function announcements_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$created = db_query("CREATE TABLE announcements (
nid int(10) unsigned NOT NULL default '0',
abstract varchar(255) default '',
publish_date integer NOT NULL default '0',
expiration_date integer NOT NULL default '0',
PRIMARY KEY (nid));");
break;
case 'pgsql':
$created = db_query("CREATE TABLE announcements (
nid integer unsigned NOT NULL default '0',
abstract varchar(255) default '',
publish_date integer NOT NULL default '0',
expiration_date integer NOT NULL default '0',
PRIMARY KEY (nid));");
break;
}
if (!$created) {
drupal_set_message(t('Table installation for the Announcement module was unsuccessful.'), 'error');
}
}
and should be
function announcements_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$created = db_query("CREATE TABLE {announcements} (
nid int(10) unsigned NOT NULL default '0',
abstract varchar(255) default '',
publish_date integer NOT NULL default '0',
expiration_date integer NOT NULL default '0',
PRIMARY KEY (nid));");
break;
case 'pgsql':
$created = db_query("CREATE TABLE {announcements} (
nid integer unsigned NOT NULL default '0',
abstract varchar(255) default '',
publish_date integer NOT NULL default '0',
expiration_date integer NOT NULL default '0',
PRIMARY KEY (nid));");
break;
}
if (!$created) {
drupal_set_message(t('Table installation for the Announcement module was unsuccessful.'), 'error');
}
}
I also wonder if the message at the end should be updated to indicate successful completion of the database and not just when an error occurrs?
Anyway attached is the updated install file.
| Comment | File | Size | Author |
|---|---|---|---|
| announcements.txt | 1.54 KB | TheGorf |
Comments
Comment #1
nancydruFix committed to -dev.
Comment #2
nancydru