Hi,
I just reproduced this problem on my local machine. However what I found is that in spite of the message shown it did unsubscribe me from the forum as verified by the changed subscribe link on the forum page.
Looking further I found that the bug was that the method forum.UnSubscribe was returning false. The bug was in the data layer:
public static bool Unsubscribe(int forumId, int userId)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Forumsubscriptions_UnSubscribe", 2);
sph.DefineSqlParameter("@ForumID", SqlDbType.Int, ParameterDirection.Input, forumId);
sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
int rowsAffected = Convert.ToInt32(sph.ExecuteScalar());
return (rowsAffected > 0);
}
The .ExecuteScalar needed to be changed to .ExecuteNonQuery since the update was not selecting anything. This is now fixed in our source code repository so it will be fixed in the next release.
As a workaround you could edit the stored procedures mp_ForumSubscriptions_Unsubscribe and mp_ForumSubscriptions_UnsubscribeAll (the bug existed in 2 places, another one much like the one above)
If you put
SELECT 1
after the update statement it will make the method return true so the correct unsubscribed message will be shown. If you do that you should keep a note about it and change it back after the next upgrade.
Possibly we will get to the issue about needing to be authenticated to unsubscribe in time for the next release.
Thanks for letting me know about this. I had never seen/noticed it because this site is using MySql and this bug was specific to the MS SQL data layer.
Joe