The categories didn't get saved when posting a new BLOG entry under postgresql. You have to go back and edit the post and recheck the categories so they would stay. This was a bug in dbportal.cs. I've attached the procedure that fixes the issue. Changes are Underlined bellow.
Let me know if it works as advertised.
Phil
public static int Blog_AddBlog(
int ModuleID,
string UserName,
string Title,
string Excerpt,
string Description,
DateTime StartDate,
bool IsInNewsletter,
bool IncludeInFeed)
{
NpgsqlConnection Connection = GetConnection();
NpgsqlParameter[] arParams = new NpgsqlParameter[9];
if(ConfigurationSettings.AppSettings.Get("CachePostgreSQLParameters").ToLower() == "true")
{
arParams = NpgsqlHelperParameterCache.GetSpParameterSet(ConfigurationSettings.AppSettings.Get("PostgreSQLConnectionString"),
"mp_blog_insert(:moduleid,:username,:title,:excerpt,:description,:startdate,:isinnewsletter,:includeinfeed,:category)");
arParams[0].Value = ModuleID;
arParams[1].Value = UserName;
arParams[2].Value = Title;
arParams[3].Value = Excerpt;
arParams[4].Value = Description;
arParams[5].Value = StartDate;
arParams[6].Value = IsInNewsletter;
arParams[7].Value = IncludeInFeed;
arParams[8].Value = string.Empty;
}
else
{
arParams[0] = new NpgsqlParameter("moduleid", NpgsqlTypes.NpgsqlDbType.Integer);
arParams[0].Direction = ParameterDirection.Input;
arParams[0].Value = ModuleID;
arParams[1] = new NpgsqlParameter("username", NpgsqlTypes.NpgsqlDbType.Text,100);
arParams[1].Direction = ParameterDirection.Input;
arParams[1].Value = UserName;
arParams[2] = new NpgsqlParameter("title", NpgsqlTypes.NpgsqlDbType.Text,100);
arParams[2].Direction = ParameterDirection.Input;
arParams[2].Value = Title;
arParams[3] = new NpgsqlParameter("excerpt", NpgsqlTypes.NpgsqlDbType.Text,512);
arParams[3].Direction = ParameterDirection.Input;
arParams[3].Value = Excerpt;
arParams[4] = new NpgsqlParameter("description", NpgsqlTypes.NpgsqlDbType.Text);
arParams[4].Direction = ParameterDirection.Input;
arParams[4].Value = Description;
arParams[5] = new NpgsqlParameter("startdate", NpgsqlTypes.NpgsqlDbType.Timestamp);
arParams[5].Direction = ParameterDirection.Input;
arParams[5].Value = StartDate;
arParams[6] = new NpgsqlParameter("isinnewsletter", NpgsqlTypes.NpgsqlDbType.Boolean);
arParams[6].Direction = ParameterDirection.Input;
arParams[6].Value = IsInNewsletter;
arParams[7] = new NpgsqlParameter("includeinfeed", NpgsqlTypes.NpgsqlDbType.Boolean);
arParams[7].Direction = ParameterDirection.Input;
arParams[7].Value = IncludeInFeed;
arParams[8] = new NpgsqlParameter("category", NpgsqlTypes.NpgsqlDbType.Text, 50);
arParams[8].Direction = ParameterDirection.Input;
arParams[8].Value = string.Empty;
}
try
{
int newID =
Convert.ToInt16(NpgsqlHelper.ExecuteScalar(Connection,
CommandType.StoredProcedure,
"mp_blog_insert(:moduleid,:username,:title,:excerpt,:description,:startdate,:isinnewsletter,:includeinfeed,:category)",
arParams));
Connection.Close();
return newID;
}
catch(Exception ex)
{
Connection.Close();
throw ex;
}
}