• Resolved gabrielhargitai

    (@gabrielhargitai)


    Hello,

    Thank you for the awesome plugin. We use the free version and have trouble making the third contact form work. The access token is the same and we have triple-checked the sheet name, columns names and the sheet name.

    Upon sending, the circle keeps spinning and the browser shows a wp-json error, with the following error log in the apache log:

    Uncaught Error: Call to a member function getWorksheets() on null in /var/sitename/wp-content/plugins/cf7-google-sheets-connector/lib/google-sheets.php:75\nStack trace:\n#0 /var/sitename/wp-content/plugins/cf7-google-sheets-connector/includes/class-gs-service.php(174): CF7GSC_googlesheet->add_row(Array)\n#1 /var/sitename/wp-includes/class-wp-hook.php(286): Gs_Connector_Service->cf7_save_to_google_sheets(Object(WPCF7_ContactForm))\n#2 /var/sitename/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)\n#3 /var/sitename/wp-includes/plugin.php(465): WP_Hook->do_action(Array)\n#4 /var/sitename/wp-content/plugins/contact-form-7/includes/submission.php(213): do_action('wpcf7_mail_sent', Object(WPCF7_ContactForm))\n#5 /var/sitename/wp-content/plugins/contact-form-7/includes/submission.php(33): WPCF7_Submission->submit()\n#6 /var/sitename/wp-content/plugins/contact-form-7/includes/contact-form.php(729): WPCF7_Submission::g in /var/sitename/wp-content/plugins/cf7-google-sheets-connector/lib/google-sheets.php on line 75, referer: https://sitename/subpage/

    Any hint on where to go from here?

    Thank you in advance!

    Cheers,
    Gabor

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author westerndeal

    (@westerndeal)

    Hi @gabrielhargitai,

    Thanks for using our plugin.

    The error “Uncaught Error: Call to a member function getWorksheets() on null” occurs if sheet is not available in the account with which you have integrated. Can you check ?

    Else again do integration with your account with fresh new authentication code and than check if that works.

    Let us know.

    Thanks
    Abdullah

    Thread Starter gabrielhargitai

    (@gabrielhargitai)

    Hi @westerndeal,

    Thanks for the prompt reply! So it’s actually the Google Sheets API that is denying write access for your plugin.

    Yep, I tried creating a new sheet with my own credentials and the same thing happens. Triple checked the column names as well, even for dangling whitespace characters!

    What is weird is that I already have two sheets that are working as expected (same user), it is the third one that I have this trouble with.

    Plugin Author westerndeal

    (@westerndeal)

    Hi @gabrielhargitai,

    Were you able to connect with your third sheet or you are still facing any issue ?

    Thanks
    Abdullah

    Thread Starter gabrielhargitai

    (@gabrielhargitai)

    Hi @westerndeal,

    Actually our client is now off for a few weeks – she will return shortly and we will look at the issue then. We do have the Sheet created with out G Suite account, but it is strange that the two previous ones work.

    Will report back once the project is continued, thanks for the stellar support!

    Cheers,
    Gabor

    Hi @gabrielhargitai,

    I am also experiencing this same error in my log. What is the fix for it? Thanks!

    Plugin Author westerndeal

    (@westerndeal)

    Hi @timnovinger,

    The error “Uncaught Error: Call to a member function getWorksheets() on null” occurs if sheet is not available in the account with which you have integrated. Did you check ?

    Even if names are incorrect the error occurs.

    Also it might happen if sheet is shared or is private or not given access permission.

    Thread Starter gabrielhargitai

    (@gabrielhargitai)

    @timnovinger
    We haven’t figured it out – went and used a different plugin for the next project to achieve the same thing.

    @westerndeal
    It is a shared sheet, yes.
    I did try it a moment ago, the form says thank you and submission is successful – however, the spreadsheet is not updated. I’ve checked the Apache error logs and there are no longer traces of the error I’ve initially posted about.
    Will try and create a new sheet, link it once again to see whether the error resolved itself in the past couple of weeks. Thanks for your support!

    Plugin Author westerndeal

    (@westerndeal)

    @gabrielhargitai

    As you are using free version you would need to add headers manually and make sure the header names don’t have capital letters, space or any special character other than hyphen(-).

    Example Your Name must be your-name, Date must be date etc.
    Don’t add mail tags( [date] ) with square braces as a header name.

    Ah, it was a shared sheet. I set it up and made sure to have full ownership of the sheet and it began to work. Thanks!

    Plugin Author westerndeal

    (@westerndeal)

    @timnovinger Fantastic..!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘PHP Fatal Uncaught Error: Call to a member function getWorksheets()’ is closed to new replies.