summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-05-19 19:41:12 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-05-19 19:41:12 +0000
commit87cdd8918148a5997e012edf81a07e5dda5b5dc2 (patch)
treedc60ba31477210cbcc18ec0c82f00fc5169937eb
parenta0de9b3ede2c9232edaacaee566c0d1e26714cb0 (diff)
downloadbrdo-87cdd8918148a5997e012edf81a07e5dda5b5dc2.tar.gz
brdo-87cdd8918148a5997e012edf81a07e5dda5b5dc2.tar.bz2
- attempting to fix tag -> tax conversion.
-rw-r--r--update.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/update.php b/update.php
index 3d2db1669..805ef5461 100644
--- a/update.php
+++ b/update.php
@@ -451,17 +451,16 @@ function update_31() {
print "Linking nodes with terms.<br />";
$result = db_query("SELECT nid,attributes FROM node WHERE attributes != ''");
while ($node = db_fetch_object($result)) {
- foreach (explode(",", $node->attributes) as $t) {
- $t = trim($t);
- if ($t) {
- if ($terms[$t]) {
- db_query("INSERT INTO term_node SET nid = '$node->nid', tid = '$terms[$t]'");
- }
- else {
- $errors[$t] = "$t";
- }
+ $tag = db_fetch_object(db_query("SELECT name FROM tag WHERE attributes = '$node->attributes'"));
+ $tag = trim($tag->name);
+ if ($tag) {
+ if ($terms[$tag]) {
+ db_query("INSERT INTO term_node SET nid = '$node->nid', tid = '$terms[$tag]'");
}
- }
+ else {
+ $errors[$tag] = "$tag";
+ }
+ }
}
if (count($errors)) {
@@ -631,7 +630,7 @@ function update_info() {
if ($op) {
include_once "includes/common.inc";
- if (!user_access(NULL)) {
+ if (user_access(NULL)) {
update_page();
}
else {