• Raul P.

    (@alignak)


    Hi,

    I have a simple form like this:

    <div class="advertising tg-bshadow">
    [text your-name placeholder "Name"]
    [tel your-phone placeholder "Phone"]
    [email* your-email placeholder "Email*"]
    [radio your-subject use_label_element default:1 "Advertising" "Digital Marketing"]
    [textarea your-message placeholder "Message"]
    [submit "Send Enquiry"]
    </div>

    It’s triggering a fatal error on submission, please fix:
    PHP Fatal error: Uncaught Error: Call to a member function get_status() on null in /home/sites/example.com/www/wp-content/plugins/contact-form-7/includes/contact-form.php:768\nStack trace:\n#0 /home/sites/example.com/www/wp-content/plugins/contact-form-7/includes/controller.php(25): WPCF7_ContactForm->submit()\n#1 /home/sites/example.com/www/wp-includes/class-wp-hook.php(285): wpcf7_control_init()\n#2 /home/sites/example.com/www/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)\n#3 /home/sites/example.com/www/wp-includes/plugin.php(551): WP_Hook->do_action(Array)\n#4 /home/sites/example.com/www/wp-includes/class-wp.php(388): do_action_ref_array('parse_request', Array)\n#5 /home/sites/example.com/www/wp-includes/class-wp.php(745): WP->parse_request('')\n#6 /home/sites/example.com/www/wp-includes/functions.php(1291): WP->main('')\n#7 /home/sites/example.com/www/wp-blog-header.php(16): wp()\n#8 /home/sites/example.com/www/index.php(17): require('/home/sites/the...')\n#9 {main}\n thrown in /home/sites/example.com/www/wp-content/plugins/contact-form-7/includes/contact-form.php on line 768, referer: https://example.com/advertise

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

    (@takayukister)

    Where can we see the website in question?

    Thread Starter Raul P.

    (@alignak)

    @takayukister it’s a client multisite so I would prefer not to disclose it… though it should not matter, as the fatal error trace is provided above.

    You have to check if it’s an object, before actually calling get_status() on it.
    And you could also use try, catch https://www.php.net/manual/en/language.exceptions.php

    Plugin Author Takayuki Miyoshi

    (@takayukister)

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

    Thread Starter Raul P.

    (@alignak)

    Here is a list, but some are custom made so I don’t think it can help.

    Accelerated Mobile Pages	Version 1.0.76.8 by Ahmed Kaludi, Mohammed Kaludi
    Ad Inserter	Version 2.6.23 by Igor Funa
    Advanced Custom Fields	Version 5.9.5 by Elliot Condon
    Advanced Editor Tools (previously TinyMCE Advanced)	Version 5.6.0 by Automattic
    Allow Multiple Accounts	Version 3.0.4 by Scott Reilly
    AMPforWP Plugin Manager	Version 1.3 by Ahmed Kaludi, Mohammed Kaludi
    Classic Editor	Version 1.6 by WordPress Contributors
    Contact Form 7	Version 5.4 by Takayuki Miyoshi
    CoVid-19 Stats	Version 1.0 by paulieweb
    Custom Permalinks	Version 1.7.1 by Sami Ahmed Siddiqui
    Default featured image	Version 1.6.4 by Jan Willem Oostendorp
    Disable All WordPress Updates	Version 1.6.7 by Oliver Schlöbe
    FAQ Schema For Pages And Posts	Version 2.3.0 by Krystian Szastok (SEO Consultant)
    Feeds with Summary Or Full Text	No version or author information is available.
    Flamingo	Version 2.2.1 by Takayuki Miyoshi
    Google Analytics Dashboard for WP (GADWP)	Version 5.3.10 by ExactMetrics
    Join My Multisite	Version 1.9.0 by Mika Epstein (Ipstenu)
    Mentionable	Version 0.4.3 by Jonathan Bardo, Topher, X-Team
    MobiLoud Extension	Version 1.0 by MobiLoud
    MobiLoud News	Version 4.3.1.1 by MobiLoud
    MVP Themes Social Buttons	Version 1.0 by MVP Themes
    OneSignal Push Notifications	Version 2.1.7 by OneSignal
    Popup Maker	Version 1.16.1 by Popup Maker
    Publish to Apple News	Version 2.1.2 by Alley
    Remove Category URL	Version 1.1.6 by Valerio Souza, Сreativemotion
    Resize Image After Upload	Version 1.8.6 by ShortPixel
    Scheduled Post Trigger	Version 3.0 by Jennifer Moss - Moss Web Works
    Schema & Structured Data for WP & AMP	Version 1.9.69 by Magazine3
    Social Media Auto Publish	Version 2.4.1 by xyzscripts.com
    Theia Sticky Sidebar	Version 1.7.0 by WeCodePixels
    Unconfirmed	Version 1.3.5 by Boone B Gorges
    WP-Polls	Version 2.75.6 by Lester 'GaMerZ' Chan
    WPBakery Visual Composer	Version 5.2.1 by Michael M - WPBakery.com
    WP Mail SMTP	Version 2.7.0 by WPForms
    WP Raiser	Version 4.3.7 by Raul Peixoto
    WPS Hide Login	Version 1.8.5 by WPServeur, NicolasKulka, wpformation
    WP User Avatar	Version 2.2.15 by ProfilePress
    Yoast Duplicate Post	Version 4.1.2 by Enrico Battocchi & Team Yoast
    Yoast SEO Premium	Version 15.9 by

    Server:

    Server architecture	Linux 5.4.0-67-generic x86_64
    Web server	Apache
    PHP version	7.4.15 (Supports 64bit values)
    PHP SAPI	apache2handler
    PHP max input variables	6000
    PHP time limit	45
    PHP memory limit	512M
    Max input time	2000
    Upload max filesize	1G
    PHP post max size	256M
    cURL version	7.68.0 OpenSSL/1.1.1j
    Is SUHOSIN installed?	No
    Is the Imagick library available?	Yes
    Are pretty permalinks supported?	Yes
    .htaccess rules	Custom rules have been added to your .htaccess file.

    Theme:

    Name	Zox News (zox-news)
    Version	1.06.0
    Author	MVP Themes
    Author website	https://themeforest.net/user/mvpthemes/portfolio

    WP 5.7 running.

    You can solve this by checking if it’s an object earlier.
    /contact-form-7/includes/contact-form.php:768

    Here is what I did:

    View post on imgur.com

    This will ensure the code exits earlier, and never reach the $submission->get_status() because, it’s not an object.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Try switching to the default theme and deactivating all plugins excluding Contact Form 7, Classic Editor, Flamingo, and WP Mail SMTP.

    Why you are advised to deactivate plugins and switch to the default theme.

    Thread Starter Raul P.

    (@alignak)

    I’m sorry but I cannot do that on production. The site is over 100GB and would take a long time to clone it just for this.

    Some forms work fine, only that one doesn’t.
    Either way, you should check if an object is an object before calling it.
    It’s best practice to check your data before calling it and it prevents the error.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Fatal Error’ is closed to new replies.