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.
When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:
Hi. joe
when delete a post in a forum, error occurs.
error in mojoPortal.Features.Data.SqlCe\Forums\DBForum.cs
public static bool UpdateUserStats(int userId){StringBuilder sqlCommand = new StringBuilder();sqlCommand.Append("UPDATE mp_Users ");sqlCommand.Append("SET ");sqlCommand.Append("TotalPosts = (SELECT COUNT(*) FROM mp_ForumPosts WHERE mp_ForumPosts.UserID = mp_Users.UserID) ");....
}
above bold sql is invalid in sqlce.
thanks!
version: 2.3.7.5
db: sqlce
os: windows 7
Hi,
Thanks for the bug report.
I just implemented a fix and pushed it to the source code repository, but I have not tested it. Are you working from the source code repository? Can you pull the latest code and verify the fix?
Thanks,
Joe
Hi, joe
Delete a post is ok!
But if delete a form, error occurs.
/////////////////////////////////////////////////////////////////////////////////////////
public static bool UpdateUserStats(int userId){if (userId > -1) //updating a single user{int postCount = UserGetUserPostCount(userId);return UpdateSingleUserStats(userId, postCount);
StringBuilder sqlCommand = new StringBuilder();sqlCommand.Append("SELECT ");sqlCommand.Append("UserID, ");sqlCommand.Append("COUNT(*) As Count ");sqlCommand.Append("FROM mp_ForumPosts "); // Change to FROM mp_ForumPosts GROUP BY UserID will be ok!sqlCommand.Append(";");
DataTable dataTable = new DataTable(); ;
using (IDataReader reader = SqlHelper.ExecuteReader(GetConnectionString(),CommandType.Text,sqlCommand.ToString(),null)){dataTable.Load(reader);}
///////////////////////////////////////////////////////////
Above bold code errors!
Thanks!
Thanks! This is now fixed in the source code repository.
Best,
in sqlce's DBModule.UpdatePage has the same problem.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static bool UpdatePage(int oldPageId, int newPageId, int moduleId){StringBuilder sqlCommand = new StringBuilder();sqlCommand.Append("UPDATE mp_PageModules ");sqlCommand.Append("SET ");sqlCommand.Append("PageID = @NewPageID, ");sqlCommand.Append("PageGuid = (SELECT TOP 1 PageGuid FROM mp_Pages WHERE PageID = @NewPageID) ");
when update a module's belong page, the error occurs!
Thanks again! This is now fixed in the source code repository.