logo       

CVS: phpwiki/lib/WikiDB/backend PearDB.php,1.85,1.86 ADODB.php,1.71,1.72: msg#00177

web.wiki.phpwiki.checkins

Subject: CVS: phpwiki/lib/WikiDB/backend PearDB.php,1.85,1.86 ADODB.php,1.71,1.72

Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26628/WikiDB/backend

Modified Files:
PearDB.php ADODB.php
Log Message:
Bugs item #1077769 fixed by frugal.
Deleted the wrong page. Fix all other tables also.


Index: PearDB.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB.php,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -2 -b -p -d -r1.85 -r1.86
--- PearDB.php 25 Jan 2005 08:03:35 -0000 1.85
+++ PearDB.php 29 Jan 2005 19:51:02 -0000 1.86
@@ -872,10 +872,16 @@ extends WikiDB_backend

$this->lock();
- if ( ($id = $this->_get_pageid($pagename, false)) ) {
+ if (($id = $this->_get_pageid($pagename, false)) ) {
if ($new = $this->_get_pageid($to, false)) {
- //cludge alert!
- //this page does not exist (already verified before), but
exists in the page table.
- //so we delete this page.
- $dbh->query("DELETE FROM $page_tbl WHERE id=$id");
+ // Cludge Alert!
+ // This page does not exist (already verified before), but
exists in the page table.
+ // So we delete this page.
+ $dbh->query("DELETE FROM $page_tbl WHERE id=$new");
+ $dbh->query("DELETE FROM $version_tbl WHERE id=$new");
+ $dbh->query("DELETE FROM $recent_tbl WHERE id=$new");
+ $dbh->query("DELETE FROM $nonempty_tbl WHERE id=$new");
+ // We have to fix all referring tables to the old id
+ $dbh->query("UPDATE $link_tbl SET linkfrom=$id WHERE
linkfrom=$new");
+ $dbh->query("UPDATE $link_tbl SET linkto=$id WHERE
linkto=$new");
}
$dbh->query(sprintf("UPDATE $page_tbl SET pagename='%s' WHERE
id=$id",
@@ -1222,4 +1228,8 @@ extends WikiDB_backend_search

// $Log$
+// Revision 1.86 2005/01/29 19:51:02 rurban
+// Bugs item #1077769 fixed by frugal.
+// Deleted the wrong page. Fix all other tables also.
+//
// Revision 1.85 2005/01/25 08:03:35 rurban
// support DATABASE_PERSISTENT besides dsn database?persistent=false; move
lock_count up (per Charles Corrigan)

Index: ADODB.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/ADODB.php,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -2 -b -p -d -r1.71 -r1.72
--- ADODB.php 25 Jan 2005 08:01:00 -0000 1.71
+++ ADODB.php 29 Jan 2005 19:51:03 -0000 1.72
@@ -966,12 +966,17 @@ extends WikiDB_backend
extract($this->_table_names);

- $this->lock(array('page'));
+ $this->lock(array('page','version','recent','nonempty','link'));
if ( ($id = $this->_get_pageid($pagename, false)) ) {
if ($new = $this->_get_pageid($to, false)) {
- //cludge alert!
- //this page does not exist (already verified before), but
exists in the page table.
- //so we delete this page.
- $dbh->query(sprintf("DELETE FROM $page_tbl WHERE id=$id",
- $dbh->qstr($to)));
+ // Cludge Alert!
+ // This page does not exist (already verified before), but
exists in the page table.
+ // So we delete this page.
+ $dbh->query("DELETE FROM $page_tbl WHERE id=$new");
+ $dbh->query("DELETE FROM $version_tbl WHERE id=$new");
+ $dbh->query("DELETE FROM $recent_tbl WHERE id=$new");
+ $dbh->query("DELETE FROM $nonempty_tbl WHERE id=$new");
+ // We have to fix all referring tables to the old id
+ $dbh->query("UPDATE $link_tbl SET linkfrom=$id WHERE
linkfrom=$new");
+ $dbh->query("UPDATE $link_tbl SET linkto=$id WHERE
linkto=$new");
}
$dbh->query(sprintf("UPDATE $page_tbl SET pagename=%s WHERE
id=$id",
@@ -1414,4 +1419,8 @@ extends WikiDB_backend_search

// $Log$
+// Revision 1.72 2005/01/29 19:51:03 rurban
+// Bugs item #1077769 fixed by frugal.
+// Deleted the wrong page. Fix all other tables also.
+//
// Revision 1.71 2005/01/25 08:01:00 rurban
// fix listOfFields with different database



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise