summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--database/database.pgsql6
-rw-r--r--database/updates.inc38
-rw-r--r--modules/statistics.module2
-rw-r--r--modules/statistics/statistics.module2
-rw-r--r--modules/taxonomy.module5
-rw-r--r--modules/taxonomy/taxonomy.module5
6 files changed, 35 insertions, 23 deletions
diff --git a/database/database.pgsql b/database/database.pgsql
index 92f5dc0b7..54a1426fb 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -573,7 +573,7 @@ CREATE INDEX search_index_word_idx ON search_index(word);
CREATE TABLE search_total (
word varchar(50) NOT NULL default '',
- count integer default NULL
+ count float default NULL
);
CREATE INDEX search_total_word_idx ON search_total(word);
@@ -794,10 +794,10 @@ INSERT INTO variable(name,value) VALUES('theme_default','s:10:"bluemarine";');
INSERT INTO users(uid,name,mail) VALUES(0,'','');
INSERT INTO users_roles(uid,rid) VALUES(0, 1);
-INSERT INTO role (rid, name) VALUES (1, 'anonymous user');
+INSERT INTO role (name) VALUES ('anonymous user');
INSERT INTO permission VALUES (1,'access content',0);
-INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
+INSERT INTO role (name) VALUES ('authenticated user');
INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
INSERT INTO blocks(module,delta,status) VALUES('user', 0, 1);
diff --git a/database/updates.inc b/database/updates.inc
index bc7785905..4aed4ee69 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -107,7 +107,8 @@ $sql_updates = array(
"2005-03-21" => "update_128",
"2005-04-08: first update since Drupal 4.6.0 release" => "update_129",
"2005-04-10" => "update_130",
- "2005-04-11" => "update_131"
+ "2005-04-11" => "update_131",
+ "2005-04-14" => "update_132"
);
function update_32() {
@@ -2329,17 +2330,6 @@ function update_127() {
return $ret;
}
-function update_sql($sql) {
- $edit = $_POST["edit"];
- $result = db_query($sql);
- if ($result) {
- return array('1', nl2br(htmlentities($sql)) ." ", "<div style=\"color: green;\">OK</div>\n");
- }
- else {
- return array('0', nl2br(htmlentities($sql)) ." ", "<div style=\"color: red;\">FAILED</div>\n");
- }
-}
-
function update_128() {
$ret = array();
@@ -2391,4 +2381,28 @@ function update_131() {
return $ret;
}
+
+function update_132() {
+ /**
+ * PostgreSQL only update.
+ */
+ $ret = array();
+
+ if ($GLOBALS['db_type'] == 'pgsql') {
+ $ret[] = update_sql('DROP TABLE {search_total}');
+ $ret[] = update_sql("CREATE TABLE {search_total} (
+ word varchar(50) NOT NULL default '',
+ count float default NULL)");
+ $ret[] = update_sql('CREATE INDEX {search_total}_word_idx ON {search_total}(word)');
+
+ /**
+ * Wipe the search index
+ */
+ include_once('modules/search.module');
+ search_wipe();
+ }
+
+ return $ret;
+}
+
?>
diff --git a/modules/statistics.module b/modules/statistics.module
index 8261758bc..158d9f8fa 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -283,7 +283,7 @@ function statistics_top_users() {
array('data' => t('User'), 'field' => 'u.name'),
);
- $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.uid". tablesort_sql($header);
+ $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.uid, u.name". tablesort_sql($header);
$sql_cnt = "SELECT COUNT(DISTINCT(uid)) FROM {accesslog}";
$result = pager_query($sql, 30, 0, $sql_cnt);
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 8261758bc..158d9f8fa 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -283,7 +283,7 @@ function statistics_top_users() {
array('data' => t('User'), 'field' => 'u.name'),
);
- $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.uid". tablesort_sql($header);
+ $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.uid, u.name". tablesort_sql($header);
$sql_cnt = "SELECT COUNT(DISTINCT(uid)) FROM {accesslog}";
$result = pager_query($sql, 30, 0, $sql_cnt);
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index 19528d167..355877d6f 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -130,9 +130,8 @@ function taxonomy_form_vocabulary($edit = array()) {
}
function taxonomy_save_vocabulary($edit) {
- if (!$edit['nodes']) {
- $edit['nodes'] = array();
- }
+ $edit['nodes'] = ($edit['nodes']) ? $edit['nodes'] : array();
+ $edit['weight'] = ($edit['weight']) ? $edit['weight'] : 0;
$data = array('name' => $edit['name'], 'description' => $edit['description'], 'help' => $edit['help'], 'multiple' => $edit['multiple'], 'required' => $edit['required'], 'hierarchy' => $edit['hierarchy'], 'relations' => $edit['relations'], 'tags' => $edit['tags'], 'weight' => $edit['weight'], 'module' => isset($edit['module']) ? $edit['module'] : 'taxonomy');
if ($edit['vid'] && $edit['name']) {
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 19528d167..355877d6f 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -130,9 +130,8 @@ function taxonomy_form_vocabulary($edit = array()) {
}
function taxonomy_save_vocabulary($edit) {
- if (!$edit['nodes']) {
- $edit['nodes'] = array();
- }
+ $edit['nodes'] = ($edit['nodes']) ? $edit['nodes'] : array();
+ $edit['weight'] = ($edit['weight']) ? $edit['weight'] : 0;
$data = array('name' => $edit['name'], 'description' => $edit['description'], 'help' => $edit['help'], 'multiple' => $edit['multiple'], 'required' => $edit['required'], 'hierarchy' => $edit['hierarchy'], 'relations' => $edit['relations'], 'tags' => $edit['tags'], 'weight' => $edit['weight'], 'module' => isset($edit['module']) ? $edit['module'] : 'taxonomy');
if ($edit['vid'] && $edit['name']) {