The ability to move forum topics and leave a "shadow copy" is great. However, I've noticed that after a while, shadow copies can kind of clog up a forum.

What I'd like to do is delete some shadow copies that have been around for a long time (people know by now where the post is), but without deleting the original post (that has been moved).

Even better, I'd like to set something up in a custom module to automatically delete shadow copies after a certain period of time.

Can anyone point me in the right direction?


Michelle’s picture

Well, the shadow copy is just an extra taxonomy term, not an actual copy of the post. Sorry, it's been a very long time since I've used this and I don't remember if the term is visible in the UI. If it's not, it doesn't seem like it would be hard to write something to expose it... That would make this a feature request, though.

JordanMagnuson’s picture

Thank you for the quick and helpful reply, Michelle.

I'm a little confused with exactly how this taxonomy deal works, though. Using devel I took a look inside a forum node that has been moved from one forum to another, and shows a shadow copy in the old forum. The node only had one taxonomy term attached: that of the new forum. The old forum's term was nowhere to be found.

See screenshot:

So I guess my question is, where is the old forum taxonomy info being stored?

Michelle’s picture

I'm really fuzzy on this so may not be 100% accurate... What I remember is that there was two tables. I think "forum" and "taxonomy something". If the term shows up in both places, that's the primary forum for the post where you can actually read it. If it's in the taxonomy one and not in the forum one, then it's a shadow post. So, in theory, getting rid of the shadow post would mean deleting it from taxonomy.


JordanMagnuson’s picture

Thanks for the info... I'll take a look. I was looking for an advanced_forum table, but didn't think of the fact that the module is using Drupal's built-in forum table...

Michelle’s picture

Yeah, shadow posts are core forum, not AF. AF just makes them a bit more useful. :)

Channel Islander’s picture

Issue summary: View changes

In case anyone else comes to this thread, here's how I made it work. Thanks Michelle for your not-so fuzzy recall.

1) Get the node number from the forum page that the post is now in. I got it by running the mouse over the reply button.

2) Go to the database and search the table 'taxonomy_index' for 'nid = [your_node_number]'. This will give two rows if there is a shadow copy, each with the same nid, the same created time, but different values for 'tid' - this represents the forum sections. Example if the node is 15153:

mysql> select * from taxonomy_index where nid = '15153';
| nid | tid | sticky | created |
| 15153 | 96 | 0 | 1404233167 |
| 15153 | 78 | 0 | 1404233167 |

3) Look up the 'tid' to see which is in which forum:

mysql> select * from taxonomy_term_data where tid = '78';
| tid | vid | name | description | format | weight |
| 78 | 6 | Technical Discussion | | plain_text | 4 |

4) Delete one or the other depending on which one is the shadow copy.

mysql> delete from taxonomy_index where nid = '15153' and tid = '78';
Query OK, 1 row affected (0.00 sec)

Hope this helps somebody.

- nick

ExTexan’s picture

@Channel Islander,

I know this is a year after your post, but it helped immensely.

Thanks for the clear, step-by-step instructions.