[pLog-svn] r7176 - plog/branches/lifetype-1.2/class/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Mon Apr 2 10:09:33 EDT 2012


Author: jondaley
Date: 2012-04-02 10:09:33 -0400 (Mon, 02 Apr 2012)
New Revision: 7176

Modified:
   plog/branches/lifetype-1.2/class/dao/articlenotifications.class.php
   plog/branches/lifetype-1.2/class/dao/articles.class.php
Log:
delete custom field values and notifications when deleting an article.  fixes http://bugs.lifetype.net/view.php?id=1675 thanks raciloni!

Modified: plog/branches/lifetype-1.2/class/dao/articlenotifications.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articlenotifications.class.php	2012-03-01 17:24:55 UTC (rev 7175)
+++ plog/branches/lifetype-1.2/class/dao/articlenotifications.class.php	2012-04-02 14:09:33 UTC (rev 7176)
@@ -179,6 +179,19 @@
 
             return $result;
          }
+		 
+             /**
+              * Removes article notifications from the database.
+              *
+              * @param artId Article
+              * @return True if all correct or false otherwise.
+              */
+         function deleteArticleNotifications( $artId )
+         {
+             $query = "DELETE FROM ".$this->getPrefix()."articles_notifications WHERE article_id = ".$artId.";";
+             $result = $this->Execute( $query );
+             return $result;
+         }
          
 
          /**

Modified: plog/branches/lifetype-1.2/class/dao/articles.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articles.class.php	2012-03-01 17:24:55 UTC (rev 7175)
+++ plog/branches/lifetype-1.2/class/dao/articles.class.php	2012-04-02 14:09:33 UTC (rev 7176)
@@ -1143,7 +1143,15 @@
             	return false;
 
             if( $forever ) {
-				// delete the text
+                    //remove custom fields Values that belong to that article
+                $customFieldsValues=new CustomFieldsValues();
+                $customFieldsValues->removeArticleCustomFields($artId);
+				
+                    //remove notifications that belong to that article
+                $articleNotifications=new ArticleNotifications();
+                $articleNotifications->deleteArticleNotifications($artId);
+
+                    // delete the text
 				$this->deleteArticleText( $artId );
 				
 				// update the links with article categories



More information about the pLog-svn mailing list