Blog entry not deleting if there is no category chosen.

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
7/21/2008 2:55:05 AM
Gravatar
Total Posts 4
I'd take one Tommy Flowers over ten Alan Turings.

Blog entry not deleting if there is no category chosen.

Hello again,

When playing around with the blog module I noticed that I couldn't delete blog entries if they hadn't been assigned a category. I traced the problem to the Blog.cs business object. Basicly the code checks for the result of DBBlog.DeleteItemCategories before executing the delete of the blog item. Since DeleteItemCategories only returns true if there have been rows deleted, it skips deleting the blog item. Since there is a setting for "Show Categories" that the various pages respect I assume that this is an oversight. SVN diff is below, or I can send a patch if that is better.

  Regards,

    Cormac.

 

Index: mojoPortal.Business/Blog.cs
===================================================================
--- mojoPortal.Business/Blog.cs (revision 3918)
+++ mojoPortal.Business/Blog.cs (working copy)
@@ -410,15 +410,15 @@

public bool Delete()
{
- bool result = DBBlog.DeleteItemCategories(itemID);
+ bool result = false;
+ DBBlog.DeleteItemCategories(itemID);
DBBlog.DeleteAllCommentsForBlog(itemID);
DBBlog.UpdateCommentStats(this.moduleID);
-
-

+ result = DBBlog.DeleteBlog(this.itemID);
+
if (result)
{
- result = DBBlog.DeleteBlog(this.itemID);
DBBlog.UpdateEntryStats(this.moduleID);

 

 

 

7/21/2008 5:53:44 AM
Gravatar
Total Posts 18439

Re: Blog entry not deleting if there is no category chosen.

Hi,

Thanks for reporting this. I will make a similar fix here and check it in to svn trunk by this evening.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.