Menu

How delete a bug from project?

Help
2003-10-21
2013-04-16
  • Nobody/Anonymous

    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

     
    • Benjamin Curtis

      Benjamin Curtis - 2003-10-22

      There is no way to do this from the tracker -- you would have to delete them from the database directly.

       
    • Anonymous

      Anonymous - 2004-07-28

      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!

       
    • Steve Mettraux

      Steve Mettraux - 2004-08-24

      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

       
    • Nobody/Anonymous

      OK - so deletion is morally wrong. But if I *did* want to - what tables do I need to hit in the database exactly?

       
      • Benjamin Curtis

        Benjamin Curtis - 2004-11-17

        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.

         
    • Nobody/Anonymous

      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.

       
    • Jon Haynes

      Jon Haynes - 2007-04-18

      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!';
      ?>

       
    • Nobody/Anonymous

      Thanks, It works.
      but it seems that this script must be in the same directory as include.php

       
    • Nobody/Anonymous

      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?

       
    • Nobody/Anonymous

      You can rename the project from the Admin Console.

       
    • Nobody/Anonymous

      I am not able delete the created project, even though I am admin user

       
    • Nobody/Anonymous

      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!';
      ?>

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.