Log Message

Clean up history code.
Log:
Submitted by:   
Reviewed by:    
PR:

Modified Files

AxKit-XSP-Wiki/lib/AxKit/XSP




Index: Wiki.pm
===================================================================
RCS file: /home/cvs/AxKit-XSP-Wiki/lib/AxKit/XSP/Wiki.pm,v
retrieving revision 1.21
retrieving revision 1.22
diff -Llib/AxKit/XSP/Wiki.pm -Llib/AxKit/XSP/Wiki.pm -u -d -r1.21 -r1.22
--- lib/AxKit/XSP/Wiki.pm
+++ lib/AxKit/XSP/Wiki.pm
@@ -369,18 +369,14 @@
     # NB fix hard coded formatterid
     my $last_modified = time;
     local $db->{AutoCommit} = 0;
-    my (@row) = $db->selectrow_array("SELECT * FROM Page WHERE name = ?", {}, 
$page);
-    if (@row) {
-        # store history
-        shift @row; # Remove id
-        $db->do('INSERT INTO History (name, formatterid, content, modified, 
ip_address)
-                 VALUES (?, ?, ?, ?, ?)', {}, @row);
-    }
-    my $sth = $db->prepare(<<'EOT');
+    $db->do(<<'EOT', {}, $page, $texttype, $contents, $last_modified, $ip);
   INSERT OR REPLACE INTO Page ( name, formatterid, content, last_modified, 
ip_address )
   VALUES ( ?, ?, ?, ?, ? )
 EOT
-    $sth->execute($page, $texttype, $contents, $last_modified, $ip);
+    $db->do(<<'EOT', {}, $page, $texttype, $contents, $last_modified, $ip);
+  INSERT INTO History ( name, formatterid, content, modified, ip_address )
+  VALUES ( ?, ?, ?, ?, ? )
+EOT
     $db->commit;
     _index_page($db, $page);
 }

Reply via email to