As described in title. Problem exists when forum attachments are stored in linked files (vs. database)
Something should be done also for case where forum topic or thread is deleted. function remove_comment($threadId) does not do this either.
Problem is that the following function in commentslib.php does not delete linked file
function remove_thread_attachment($attId) {
232 $query = "delete from `tiki_forum_attachments` where `attId`=?";
233
234 $this->query($query,array($attId));
235 }
Possible solution:
function remove_thread_attachment($attId) {
$path = $this->getOne("select `path` from `tiki_forum_attachments` where `attId`=$attId");
$dir = $this->getOne("select `dir` from `tiki_forum_attachments` where `attId`=$attId");
if ($path) {
@unlink ($dir . $path);
}
$query = "delete from `tiki_forum_attachments` where `attId`=?";
$this->query($query,array($attId));
}
Tested on 2008-10-11 on tiki 3.0. Fixed
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |