Hello,

When deleting an empty forum, it deletes all previous content, even if this has been moved to a new forum. This is very frustrating and I think is a very serious bug. It has happenned to me twice, so I decided to report it.

Steps to reproduce:
1. Start with a forum system with different forums and forum topics.
2. Move all forum nodes (topics) from a forum to another one (new or old).
3. Delete the selected forum (the one is empty now).
4. All forum nodes which were in this forum before step 2 will be deleted too!

The first time it happened to me I though I had selected "Mark topic as moved", but I know for sure I it wasn't selected the second time.

I have the comment mover module installed, but I don't think this is related.

Please let me know if there is a patch or anything for this, because now I'm afraid of deleting old forums.

Thanks.

Comments

michelle’s picture

I have a fairly clean 4.7 install (just installed it a few days ago, only one non-forum related contrib module) and I can't reproduce this. My moved forum post was still there after the other forum was deleted.

Michelle

chx’s picture

Status: Active » Closed (won't fix)
EnekoAlonso-1’s picture

Well, I don't know how to "prove" this problem. I have a Drupal site which started on version 4.6.3 and was migrated to 4.7 and today to 4.7.4.

This problem has happened twice, one today after the migration and another one in the past (I don't remember which version, but I'm pretty sure it was a 4.7.x.

Let me know if you find out anything or anybody with the same problem.

Thanks.

david strauss’s picture

Version: 4.7.4 » 5.x-dev
Status: Closed (won't fix) » Active

This is completely unintuitive behavior, and this bug specifically affects sites that keep old revisions of forum nodes. You don't even have to keep around a shadow copy to encounter the issue.

This affects a common workflow on a site:
(1) Decide to retire a forum.
(2) Gradually move topics to the new destinations.
(3) Delete the retired forum.

Current Drupal 5 code:

        $results = db_query('SELECT f.nid FROM {forum} f WHERE f.tid = %d', $term['tid']);
        while ($node = db_fetch_object($results)) {
          // node_delete will also remove any association with non-forum vocabularies.
          node_delete($node->nid);
        }

Current Drupal 6 code:

        $results = db_query('SELECT tn.nid FROM {term_node} tn WHERE tn.tid = %d', $term['tid']);
        while ($node = db_fetch_object($results)) {
          // node_delete will also remove any association with non-forum vocabularies.
          node_delete($node->nid);
        }

Either will delete any nodes whose previous revisions fell into old forums.

michelle’s picture

Ah, that explains why I couldn't repro it 2 years ago. I've never had revisions on for forum topics.

Michelle

drumm’s picture

Version: 5.x-dev » 6.x-dev
beginner’s picture

Version: 6.x-dev » 7.x-dev

I confirm the existence of this bug!

Wouldn't it be present in D7, too? What's the procedure for such a critical bug? Fix head first, or D6 (and D5) first?

alexanderpas’s picture

fix head, then backport.

webchick’s picture

Title: Deleting forum deletes moved forum topics!! » Deleting forum deletes moved forum topics
catch’s picture

This almost an exact opposite of the report at #206820: Relocate or delete topics on forum deletion to avoid leaving stale data in database. (thanks beginner for bumping that issue). I just manually tested in HEAD, and deleting a forum continues to not delete any associated forum topics at all.

JamesAn’s picture

Status: Active » Fixed

I just tested this in HEAD (7.x) and can't seem to reproduce the error.

This is what I did:

  1. Create forum A.
  2. Create forum B.
  3. Create forum topic in forum A.
  4. Move forum topic from forum A to forum B (with or without a shadow copy).
  5. Delete forum A.

The forum topic doesn't get deleted. So the problem is resolved, yes?

Feel free to reopen if this problem does indeed still exist.

figaro’s picture

Apparently this only happens for forum topics to which replies have been posted. Similarly, this issue does not occur for forum topics without responses. Can we verify this first or - if I am incorrect - have a complete overview of the conditions under which this happens?

vm’s picture

Status: Fixed » Active

remarking active based on #12

tic2000’s picture

I tested this also. I even created a revision, but the topic wasn't deleted when the old forum was deleted.

vm’s picture

tic2000 when you state " you tested also" did you test with #12 's comment in mind where the threads had replies?

tic2000’s picture

Yes I did. With reply and with new revision. The topics are still in the new forum.

vm’s picture

Status: Active » Fixed

remarking as fixed per #16

JamesAn’s picture

I'm also confirming with another round of tests. With or without a shadow copy and with or without comment replies (4 combinations), deleting the old forum doesn't delete the topics that have been moved to a new forum.

figaro’s picture

Commendable effort to all involved.
@#18: Can you add those 4 combinations as test cases to the testbot for perpetual testing? Thanks in advance.

JamesAn’s picture

Status: Fixed » Needs work

Sure thing.

juan_g’s picture

Is this data-loss bug also fixed for Drupal 6.x, or only for Drupal 7.x? (See comment #7 and others).

sun.core’s picture

We absolutely need tests here.

catch’s picture

Title: Deleting forum deletes moved forum topics » Tests for deleting forums
Priority: Critical » Normal

We do, but there's no reproducable bug here, so downgrading.

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7

I couldn't find any extensive tests that deletes a forum with topics or where a forum topic has been moved, in forum.test, so I suppose this still is a valid issue.

    // Create forum inside the forum container.
    $this->forum = $this->createForum('forum', $this->container['tid']);
    // Verify the "edit forum" link exists and functions correctly.
    $this->drupalGet('admin/structure/forum');
    $this->clickLink('edit forum');
    $this->assertRaw('Edit forum', t('Followed the link to edit the forum'));
    // Navigate back to forum structure page.
    $this->drupalGet('admin/structure/forum');
    // Create second forum in container.
    $this->delete_forum = $this->createForum('forum', $this->container['tid']);
    // Save forum overview.
    $this->drupalPost('admin/structure/forum/', array(), t('Save'));
    $this->assertRaw(t('The configuration options have been saved.'));
    // Delete this second form.
    $this->deleteForum($this->delete_forum['tid']);
Tor Arne Thune’s picture

Category: bug » task
Issue tags: +Needs tests

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Needs work » Postponed

Forum is approved for removal. See #1898812: [policy] Deprecate forum module for removal in Drupal 11

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

It will be moved to the contributed extension once the Drupal 11 branch is open.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Project: Drupal core » Forum
Version: 11.x-dev » 1.0.1
Component: forum.module » Code
quietone’s picture

Status: Postponed » Needs work