[pLog-svn] r2882 - plog/trunk/class/dao

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed Feb 1 17:53:34 GMT 2006


Author: oscar
Date: 2006-02-01 17:53:34 +0000 (Wed, 01 Feb 2006)
New Revision: 2882

Modified:
   plog/trunk/class/dao/articles.class.php
Log:
links between articles and categories are properly updated now.


Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php	2006-02-01 17:25:02 UTC (rev 2881)
+++ plog/trunk/class/dao/articles.class.php	2006-02-01 17:53:34 UTC (rev 2882)
@@ -725,12 +725,15 @@
             	// updated the category counters
             	$articleCategories = new ArticleCategories();
             	foreach( $article->getCategories() as $category ) {
+				print("deleting link between art = ".$article->getId()." and category = ".$category->getId()."<br/>");				
 					$category->setNumArticles( $category->getNumArticles() - 1 );
 					if( $article->getStatus() == POST_STATUS_PUBLISHED ) {
 						$category->setNumPublishedArticles( $category->getNumPublishedArticles() - 1 );
 					}
 					$articleCategories->updateCategory( $category );
             	}
+				// clean the cache that contains the links
+				$this->_cache->removeData( $article->getId(), CACHE_ARTICLE_CATEGORIES_LINK );				
             }
             
             return( $result );
@@ -903,6 +906,11 @@
                 !$this->updateArticleCustomFields( $article->getId(), $article->getBlog(), 
                                                    $article->getFields()) )
                 return false;*/
+				
+            if( !$this->updatePostCategoriesLink( $article )) {
+                return false;
+			}
+				
 
             // clean up the cache
 			include_once( PLOG_CLASS_PATH."class/dao/recentarticles.class.php" );



More information about the pLog-svn mailing list