• Resolved Oleksandr

    (@track77)


    Contact form latest version doesn’t show a message about success sending a message
    6The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateas` value and it is preloaded intentionally.
    index.js:formatted:660 {code: ‘invalid_json’, message: ‘The response is not a valid JSON response.’}code: “invalid_json”message: “The response is not a valid JSON response.”Prototype: Objectconstructor: ? Object()hasOwnProperty: ? hasOwnProperty()isPrototypeOf: ? isPrototypeOf()propertyIsEnumerable: ? propertyIsEnumerable()toLocaleString: ? toLocaleString()toString: ? toString()valueOf: ? valueOf()__defineGetter__: ? __defineGetter__()__defineSetter__: ? __defineSetter__()__lookupGetter__: ? __lookupGetter__()__lookupSetter__: ? __lookupSetter__()__proto__: (…)get __proto__: ? __proto__()set __proto__: ? __proto__()
    (anonymous) @ index.js:formatted:660
    Promise.catch (async)
    $ @ index.js:formatted:660
    (anonymous) @ index.js:formatted:893`

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    What other plugins and theme do you use on the site?

    Thread Starter Oleksandr

    (@track77)

    I found a reason for this bug.
    I use the plugin for saving letters to the database

    Part of code.

    add_action( 'wpcf7_submit', array( $this, 'wpcf7_contact_form_submit'), 10, 2 );
    wpcf7_contact_form_submit( $contact_form, $result ) {
    ...
    // This line is a reason for bug
    $postId = wp_insert_post( $args );
    ...
    }
    

    So saving the post after submitting it is a reason for this.
    It all works if I comment this line.
    I can send the whole plugin to you

    Thread Starter Oleksandr

    (@track77)

    I fix this by changing the function
    wp_insert_post() to $wpdb->insert()

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The response is not a valid JSON response’ is closed to new replies.