logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: phpwiki/lib/WikiDB/backend PearDB.php, 1.106, 1.107 ADODB.php, 1.97, 1: msg#00046

Subject: CVS: phpwiki/lib/WikiDB/backend PearDB.php, 1.106, 1.107 ADODB.php, 1.97, 1.98
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19187/WikiDB/backend

Modified Files:
        PearDB.php ADODB.php 
Log Message:
Overwrite all attributes at once at page->save to delete dangling meta

Index: PearDB.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB.php,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -2 -b -p -d -r1.106 -r1.107
--- PearDB.php  4 Jan 2007 16:57:32 -0000       1.106
+++ PearDB.php  28 May 2007 20:13:46 -0000      1.107
@@ -514,8 +514,11 @@ extends WikiDB_backend
 
         $dbh->query("DELETE FROM $link_tbl WHERE linkfrom=$pageid");
-
        if ($links) {
+           $linkseen = array();
             foreach ($links as $link) {
                 $linkto = $link['linkto'];
+                if ($linkto === "") { // ignore attributes
+                    continue;
+                }
                 if ($link['relation'])
                     $relation = $this->_get_pageid($link['relation'], true);
@@ -528,8 +531,14 @@ extends WikiDB_backend
                     $linkseen[$linkto] = true;
                 $linkid = $this->_get_pageid($linkto, true);
+               if (!$linkid) {
+                           echo("No link for $linkto on page $pagename");
+                           //printSimpleTrace(debug_backtrace());
+                           trigger_error("No link for $linkto on page 
$pagename");
+                }
                 assert($linkid);
                 $dbh->query("INSERT INTO $link_tbl (linkfrom, linkto, 
relation)"
                             . " VALUES ($pageid, $linkid, $relation)");
             }
+           unset($linkseen);
        }
         $this->unlock();
@@ -1244,4 +1253,7 @@ class WikiDB_backend_PearDB_search exten
 
 // $Log$
+// Revision 1.107  2007/05/28 20:13:46  rurban
+// Overwrite all attributes at once at page->save to delete dangling meta
+//
 // Revision 1.106  2007/01/04 16:57:32  rurban
 // Clarify API: sortby,limit and exclude are strings. fix upgrade test 
connection

Index: ADODB.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/ADODB.php,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -2 -b -p -d -r1.97 -r1.98
--- ADODB.php   28 Jan 2007 22:53:23 -0000      1.97
+++ ADODB.php   28 May 2007 20:13:46 -0000      1.98
@@ -601,4 +601,7 @@ extends WikiDB_backend
                 else 
                     $relation = 0;
+                if ($linkto === "") { // ignore attributes
+                    continue;
+                }
                 // avoid duplicates
                 if (isset($linkseen[$linkto]) and !$relation) {
@@ -1546,4 +1549,7 @@ class WikiDB_backend_ADODB_search extend
 
 // $Log$
+// Revision 1.98  2007/05/28 20:13:46  rurban
+// Overwrite all attributes at once at page->save to delete dangling meta
+//
 // Revision 1.97  2007/01/28 22:53:23  rurban
 // protect against $oldlinks warning


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


<Prev in Thread] Current Thread [Next in Thread>