From: <am...@us...> - 2012-09-20 18:03:25
|
Revision: 43063 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=43063&view=rev Author: amette Date: 2012-09-20 18:03:19 +0000 (Thu, 20 Sep 2012) Log Message: ----------- [FIX] Delete associated attachments properly (from filesystem) when deleting a post Modified Paths: -------------- branches/9.x/lib/comments/commentslib.php Modified: branches/9.x/lib/comments/commentslib.php =================================================================== --- branches/9.x/lib/comments/commentslib.php 2012-09-20 15:28:01 UTC (rev 43062) +++ branches/9.x/lib/comments/commentslib.php 2012-09-20 18:03:19 UTC (rev 43063) @@ -2593,8 +2593,12 @@ //TODO in a forum, when the reply to a post (not a topic) id deletd, the replies to this post are not deleted $this->remove_reported($threadId); - $this->table('tiki_forum_attachments')->deleteMultiple(array('threadId' => (int) $threadId)); + $atts = $this->table('tiki_forum_attachments')->fetchAll(array('attId'),array('threadId' => $threadId)); + foreach ( $atts as $att ) { + $this->remove_thread_attachment($att['attId']); + } + // Update search index after deletion is done foreach ($result as $res) { $this->update_index($res['objectType'], $res['threadId']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |