Support » Plugin: WP Job Manager » Error: "Post_content cannot be null"

  • Resolved 99pluginsbuthellodollyaintone

    (@99pluginsbuthellodollyaintone)


    Hi, facing an issue with WP job manager forcing content for the job description section for job listing submissions through the front end.

    Users who don’t enter something into the job description section of the front end submit listing form are faced with the error code ‘post_content cannot be null’ plus some further error details and the culprit as line 438 of class-wp-job-manager-form-submit-job.php

    Is there a way to avoid the front end requirement for post_content?

    WP = 4.5.2
    Theme= Listify

    Any help greatly appreciated!

    Best wishes,

    99pluginsbuthellodollyaintone

    https://wordpress.org/plugins/wp-job-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
  • How is line 438 the “culprit”? It just saves the job data.

    WP Job Manager does not generate a “post_content cannot be null” error nor does it require the job description to have text – check Listify theme support or another plugin on your site. Use a plugin like “String Locator” to search all your files for that error string.

    99pluginsbuthellodollyaintone

    (@99pluginsbuthellodollyaintone)

    Thanks for the feedback MrBrian. Apologies if I’ve offended anyone with word choice there. My meaning was that 438 is the line identified in the debug notice. This is the error which appears when job_description is unfilled from the front end submission form:

    Notice: Undefined index: job_description in /public_html/website/wp-content/plugins/wp-job-manager/includes/forms/class-wp-job-manager-form-submit-job.php on line 438
    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 (***values replaced by this text to deidentify user***)

    Hmm.. undefined index would imply you’ve removed the job_description field from your form rather than the user leaving it blank. If you don’t plan on using the description field at all you need to make it hidden, so that the value is a blank string rather than undefined and null.

    99pluginsbuthellodollyaintone

    (@99pluginsbuthellodollyaintone)

    Thank you for the solve @mrbrian much appreciated 🙏 😊

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error: "Post_content cannot be null"’ is closed to new replies.