YAFLogo

soltys
  • soltys
  • 62.6% (Friendly)
  • YAF Forumling Topic Starter
15 years ago
I've noticed this error when i was sending private message

Cannot insert the value NULL into column 'IsRead', table 'ITMWB_Forum.dbo.yaf_UserPMessage'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Line 324:					messageFlags.IsBBCode = _editor.UsesBBCode;
Line 325:
Line 326:					DB.pmessage_save( PageContext.PageUserID, recipientID [i], Subject.Text, body, messageFlags.BitValue );
Line 327:
Line 328:					if ( PageContext.BoardSettings.AllowPMEmailNotification )
Sponsor

Jesterking
15 years ago
I get the same error message when I allow PMs.
I have searched for the answer but have been unsuccessful.
Is there something that I'm missing?
soltys
  • soltys
  • 62.6% (Friendly)
  • YAF Forumling Topic Starter
15 years ago
I've solved it modyfying deafult values in db tables.

But another error is that when you send pm..and then another user recieves it..message is still unread..
soltys
  • soltys
  • 62.6% (Friendly)
  • YAF Forumling Topic Starter
15 years ago
Does any one have the same problem?
soltys
  • soltys
  • 62.6% (Friendly)
  • YAF Forumling Topic Starter
15 years ago
Nevermind 🙂
I've made changes to procedure to update isread column.
billyboy
15 years ago
can y'all post your modifications or push a patch through svn, or,or...

Thanks,

soltys
  • soltys
  • 62.6% (Friendly)
  • YAF Forumling Topic Starter
15 years ago
As a solution to null values in DB. I don't remember what tables shuold you modify...anyway check tables related with pmmessages and chcek wchich coulmns don't have default values..

For marking read messages:

modify "yaf_pmessage_markread" add " isread = 1" after update on flags.

For message archive:

modify "yaf_pmessage_archive" add " isarchived = 1" after update on flags.

That's all. Should work now 🙂
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
15 years ago
Something didn't upgrade correctly here. IsRead is a calculated field in v1.9.3.

Run this sql:


update yaf_UserPMessage set Flags = IsRead where Flags IS NULL
update yaf_UserPMessage set Flags = 1 where Flags IS NULL
GO
alter table yaf_UserPMessage drop column IsRead
GO
alter table yaf_UserPMessage ADD [IsRead] AS (CONVERT([bit],sign([Flags]&(1)),(0)))
GO
soltys
  • soltys
  • 62.6% (Friendly)
  • YAF Forumling Topic Starter
15 years ago
And same solution with archive pms?

Does my solution posted above has any sence? I mean..will it work in a long term 😃
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
15 years ago
The problem is that your DB didn't convert properly. I'm not modifying the code because your version of the DB is incorrect.
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button