Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

BUG: 1.2.3 - Keep/Delete functions in Message.pm...

Quote Reply
BUG: 1.2.3 - Keep/Delete functions in Message.pm...
Just a little note. I think I've found a bug in Message.pm.

Basically, although the "keep" function has been added, and works ok in terms of the selection ... it doesn't seem to "keep" messages when doing a multi-select, and also ticking some PM's with "keep".

I think I've found the bug in /admin/GForum/Message.pm.

FIRST OF ALL...BACKUP YOUR Message.pm FILE!

Line ~87. Find;

Code:
$num_deleted = $DB->table('Message')->delete({ to_user_id_fk => $USER->{user_id}, msg_id => \@delete }) or die $GT::SQL::error;

...and change to;

Code:
$num_deleted = $DB->table('Message')->delete({ msg_keep => 0, to_user_id_fk => $USER->{user_id}, msg_id => \@delete }) or die $GT::SQL::error;

Line 92. From;

Code:
$sent_num_deleted = $DB->table('SentMessage')->delete({ from_user_id_fk => $USER->{user_id}, msg_id => \@sent_delete }) or die $GT::SQL::error;

...to;

Code:
$sent_num_deleted = $DB->table('SentMessage')->delete({ msg_keep => 0, from_user_id_fk => $USER->{user_id}, msg_id => \@sent_delete }) or die $GT::SQL::error;

...and on line 112...Find;

Code:
my $sent_delete = $DB->table('SentMessage')->count({ from_user_id_fk => $USER->{user_id}, msg_keep => 0 });

...and change to;

Code:
my $sent_delete = $DB->table('SentMessage')->count({ msg_keep => 0, from_user_id_fk => $USER->{user_id}, msg_keep => 0 });

Line 127... From;

Code:
$deleted = 0 + $DB->table('Message')->delete({ to_user_id_fk => $USER->{user_id}, msg_keep => 0 })

...to;

Code:
$deleted = 0 + $DB->table('Message')->delete({ msg_keep => 0, to_user_id_fk => $USER->{user_id}, msg_keep => 0 })

...and that should be it Cool

I've let GT know about this too... so it should be fixed up in the next version. Just wanted to let people know, in case they are using this function, and have been having problems :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Post BUG: 1.2.3 - Keep/Delete functions in Message.pm... Andy 1352 Sep 25, 2004, 4:31 AM