Hello,
I have added some "Test" bugs to my project.
I find nothing to delete a bug.
Where can I do this?
Have I to do this direct in ther database?
regards
Hans
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We have to understand that there are no possibility to delete a bug entry.
Only real superusers (able to delete in the database) will delete wrong entries.
If any phpbt "admin" users can delete any entry, it will induce that the bug tracking process will not be serious enough (some dev will simply delete bugs that they dont want to solve).
I made the same test entries and I also looked around to find a find to delete. But now, I really think that a delete function is not needed. Users must think twice before to submit a bug.
Phpbt is cool :)
steve
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is what we use to permanently delete bugs. Obviously change the paths and table prefixes accordingly, hard-code the $bug_id and put somewhere safe from unwanted user perusal :)
<?
# php bug tracker permanently delete bug script
# add bug_id below and then run from browser
$bug_id = 4;
$script_path = '/home/bugs';
include_once($script_path . '/include.php');
$attachments = $db->getAll('select * from TABLEPREFIX_attachment where bug_id = ' . $bug_id);
Which line and where we have to add below in Include.php
<?
# php bug tracker permanently delete bug script
# add bug_id below and then run from browser
$bug_id = 4;
$script_path = '/home/bugs';
include_once($script_path . '/include.php');
$attachments = $db->getAll('select * from TABLEPREFIX_attachment where bug_id = ' . $bug_id);
Hello,
I have added some "Test" bugs to my project.
I find nothing to delete a bug.
Where can I do this?
Have I to do this direct in ther database?
regards
Hans
There is no way to do this from the tracker -- you would have to delete them from the database directly.
Why there isn't a "delete" button? Is there a reason?
How about projects? I am also having problems to delete them..do i delete them from the database also?
Please make this nightmare stop!
We have to understand that there are no possibility to delete a bug entry.
Only real superusers (able to delete in the database) will delete wrong entries.
If any phpbt "admin" users can delete any entry, it will induce that the bug tracking process will not be serious enough (some dev will simply delete bugs that they dont want to solve).
I made the same test entries and I also looked around to find a find to delete. But now, I really think that a delete function is not needed. Users must think twice before to submit a bug.
Phpbt is cool :)
steve
OK - so deletion is morally wrong. But if I *did* want to - what tables do I need to hit in the database exactly?
Well, if you don't mind abandoned data hanging around (bug history, etc.), just delete the row from the bug table and you're done.
I needed to do this in testing, but of course, all you have to do is restore the database to a state prior to bugs being entered. Easy.
This is what we use to permanently delete bugs. Obviously change the paths and table prefixes accordingly, hard-code the $bug_id and put somewhere safe from unwanted user perusal :)
<?
# php bug tracker permanently delete bug script
# add bug_id below and then run from browser
$bug_id = 4;
$script_path = '/home/bugs';
include_once($script_path . '/include.php');
$attachments = $db->getAll('select * from TABLEPREFIX_attachment where bug_id = ' . $bug_id);
$i = 0;
$num_rows = count($attachments);
while($i < $num_rows)
{
echo '<li>Deleting attachment file: ' . $attachments[$i]['file_name'] . '</li>';
unlink($script_path . '/attachments/' . $attachments[$i]['created_by'] . '/' . $bug_id . '-' . $attachments[$i]['file_name']);
++$i;
}
$del = array('TABLEPREFIX_attachment'=>'bug_id',
'TABLEPREFIX_bug'=>'bug_id',
'TABLEPREFIX_bug_cc'=>'bug_id',
'TABLEPREFIX_bug_dependency'=>'bug_id',
'TABLEPREFIX_bug_dependency'=>'depends_on',
'TABLEPREFIX_bug_group'=>'bug_id',
'TABLEPREFIX_bug_history'=>'bug_id',
'TABLEPREFIX_bug_vote'=>'bug_id',
'TABLEPREFIX_comment'=>'bug_id');
foreach($del as $table=>$field)
{
echo '<li>Deleting bug ' . $bug_id . ' from the ' . $table . ' table</li>';
$db->query('delete from ' . $table . ' where ' . $field . ' = ' . $bug_id);
}
echo 'Done!';
?>
Thanks, It works.
but it seems that this script must be in the same directory as include.php
Can I delete 'Project'?
I have created testProject and then add several test bugs to this testProject.
How to delete bugs we know now, thanks Jon.
But how to delete testProject from phpbt and testUser?
You can rename the project from the Admin Console.
I am not able delete the created project, even though I am admin user
Which line and where we have to add below in Include.php
<?
# php bug tracker permanently delete bug script
# add bug_id below and then run from browser
$bug_id = 4;
$script_path = '/home/bugs';
include_once($script_path . '/include.php');
$attachments = $db->getAll('select * from TABLEPREFIX_attachment where bug_id = ' . $bug_id);
$i = 0;
$num_rows = count($attachments);
while($i < $num_rows)
{
echo '<li>Deleting attachment file: ' . $attachments[$i]['file_name'] . '</li>';
unlink($script_path . '/attachments/' . $attachments[$i]['created_by'] . '/' . $bug_id . '-' . $attachments[$i]['file_name']);
++$i;
}
$del = array('TABLEPREFIX_attachment'=>'bug_id',
'TABLEPREFIX_bug'=>'bug_id',
'TABLEPREFIX_bug_cc'=>'bug_id',
'TABLEPREFIX_bug_dependency'=>'bug_id',
'TABLEPREFIX_bug_dependency'=>'depends_on',
'TABLEPREFIX_bug_group'=>'bug_id',
'TABLEPREFIX_bug_history'=>'bug_id',
'TABLEPREFIX_bug_vote'=>'bug_id',
'TABLEPREFIX_comment'=>'bug_id');
foreach($del as $table=>$field)
{
echo '<li>Deleting bug ' . $bug_id . ' from the ' . $table . ' table</li>';
$db->query('delete from ' . $table . ' where ' . $field . ' = ' . $bug_id);
}
echo 'Done!';
?>