Skip Navigation

[Resolved] CRED forms throwing database error without form submission

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 6 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#918619

On any page with a cred form, the following shows up in debugging:

WordPress database error: [Column 'post_content' cannot be null]
INSERT INTO `wp_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`, `menu_order`, `post_mime_type`, `guid`) VALUES (3, '2018-06-28 01:34:46', '0000-00-00 00:00:00', NULL, '', 'CRED Auto Draft cd19147e73dce1c52dbbde1f2ea328e2', '', 'auto-draft', 'inquiry', 'closed', 'closed', '', '', '', '', '2018-06-28 01:34:46', '0000-00-00 00:00:00', 0, 0, '', '') /* From [charmcat.net/contact/] in [/nas/content/live/charmcat/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/common/functions.php:96] */

It shows up once per form on every page. No submit button has been clicked. It seems like it's trying to save an empty post to the database every time a cred form loads.

#918747

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ashleigh

Toolset Forms save auto-drafts (much like WP in the back-end) so that if your form includes an image field, for example, where the image gets uploaded before the form is submitted, there is a post (albeit a draft) to attach the image to.

It looks like it is trying to create draft posts without post content.

I looked at your site and see that your forms contain neither a title nor post content.

I set up a similar form on a local test site to see if it generated the log errors, but it didn't.

I may need to take a copy of your site for testing, but I think you have some custom code on your site and I would first want to confirm that there isn't a conflict responsible for this.

Do you have a staging site for some simple testing?

Can you switch theme and disable all non-Toolset plugins and then re-visit your pages containing forms to see if the log contains further errors?

If not then it should be possible to identify the source of the issue by a process of elimination, re-activating your normal theme and other plugins.

Let me know what you find so I can see how to proceed.

#921517

The login information I provided should be for the staging site. There isn't a way for me to review it, but that's what I always send you guys!

#921608

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

What did you find switching theme and disabling other plugins? Do you still get the debug errors?