Cannot insert the value NULL into column 'PublicKey'

Topics: Customizing Orchard
Apr 15, 2014 at 7:49 AM
Hi Gents,

Orchard 1.7

I'm adding anti-spam to a Custom form for a content type.

The trace is as follows:

2014-04-15 16:32:26,451 [40] NHibernate.Util.ADOExceptionReporter - Cannot insert the value NULL into column 'PublicKey', table 'maitlandbusiness.dbo.maitlandbusiness_Orchard_Captcha_CaptchaSettingsPartRecord'; column does not allow nulls. INSERT fails.
The statement has been terminated.
2014-04-15 16:32:26,451 [40] NHibernate.Event.Default.AbstractFlushingEventListener - Could not synchronize database state with session
NHibernate.Exceptions.GenericADOException: could not execute batch command.[SQL: SQL not available] ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'PublicKey', table 'maitlandbusiness.dbo.maitlandbusiness_Orchard_Captcha_CaptchaSettingsPartRecord'; column does not allow nulls. INSERT fails.
The statement has been terminated.

I can see the profiler on the SQL server passing the id, however all other fields are Null.

What have I missed?

Paul
Apr 15, 2014 at 2:23 PM
Maybe you need to set values here first: /Admin/Settings/Spam
Apr 15, 2014 at 2:37 PM
Thanks urbanit,

However this seems to be part of the problem. The admin/settings/spam area doesn't insert the key record values. I've added the record in manually, without success.

PK
Apr 16, 2014 at 4:08 AM
Edited Apr 16, 2014 at 4:15 AM
I resolved this by manually updating the

Orchard_AntiSpam_ReCaptchaSettingsPartRecord

table.

I also update this table as well:

Orchard_Captcha_CaptchaSettingsPartRecord

however I had to run a trace on the DB to obtain the id.

I'm not sure what the ContentItemRecord_id field is used for?

PK