AxeWP / wp-graphql-gravity-forms

GraphQL API for interacting with Gravity Forms.
GNU General Public License v3.0
164 stars 29 forks source link

Using GF forms settings causes error #248

Closed robmarshall closed 2 years ago

robmarshall commented 2 years ago

On deselecting and saving all Gravity Forms options under 'Monitor Gravity Forms Actions' on the GatsbyJS Plugin page, WordPress crashes and shows the error:

Fatal error: Uncaught Error: Call to undefined function WPGatsby\ActionMonitor\Monitors\graphql_format_field_name() in /home/customer/www/MYDOMAIN/public_html/wp-content/plugins/wp-gatsby/src/ActionMonitor/Monitors/Monitor.php:345 Stack trace: #0 /home/customer/www/MYDOMAIN/public_html/wp-content/plugins/wp-gatsby/src/ActionMonitor/Monitors/Monitor.php(168): WPGatsby\ActionMonitor\Monitors\Monitor->log_action(Array) #1 /home/customer/www/MYDOMAIN/public_html/wp-content/plugins/wp-gatsby/src/ActionMonitor/Monitors/TaxonomyMonitor.php(77): WPGatsby\ActionMonitor\Monitors\Monitor->trigger_schema_diff(Array) #2 /home/customer/www/MYDOMAIN/public_html/wp-includes/class-wp-hook.php(307): WPGatsby\ActionMonitor\Monitors\TaxonomyMonitor->check_taxonomies(Array) #3 /home/customer/www/MYDOMAIN/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #4 /home/customer/www/MYDOMAIN/public_html/wp-incl in /home/customer/www/MYDOMAIN/public_html/wp-content/plugins/wp-gatsby/src/ActionMonitor/Monitors/Monitor.php on line 345

WP version 5.9.2 WPGraphQL version: 1.8.0 WPGraphQL for Gravity Forms version: 0.11.0 WP Gatsby version 2.3.2 Gravity Forms version 2.6.1

image

justlevine commented 2 years ago

Hey @robmarshall , Can you confirm WPGraphQL is enabled when saving those settings, and whether you get the message with WPGraphQL for GF disabled under similar circumstances?

The error message points to WPGatsby trying to call a WPGraphQL core function

robmarshall commented 2 years ago

@justlevine

WpGraphQL is enabled.

I removed WPGraphQL for GF, and can see WpGraphQL is enabled. However on re-enabling WPGraphQL for GF I get the following error:

Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, string given in C:\projects\DOMAIN\wp-content\plugins\wp-graphql-gravity-forms\src\Extensions\WPGatsby\Settings.php:110 Stack trace: #0 C:\projects\DOMAIN\wp-content\plugins\wp-graphql-gravity-forms\src\Extensions\WPGatsby\Settings.php(110): array_keys('') #1 C:\projects\DOMAIN\wp-content\plugins\wp-graphql-gravity-forms\src\Extensions\WPGatsby\GravityFormsMonitor.php(37): WPGraphQL\GF\Extensions\WPGatsby\Settings::get_enabled_actions() #2 C:\projects\DOMAIN\wp-content\plugins\wp-graphql-gravity-forms\src\Extensions\WPGatsby\WPGatsby.php(42): WPGraphQL\GF\Extensions\WPGatsby\GravityFormsMonitor->__construct(Object(WPGatsby\ActionMonitor\ActionMonitor)) #3 C:\projects\DOMAIN\wp-includes\class-wp-hook.php(307): WPGraphQL\GF\Extensions\WPGatsby\WPGatsby::register_monitors(Array, Object(WPGatsby\ActionMonitor\ActionMonitor)) #4 C:\projects\DOMAIN\wp-includes\plugin.php(189): WP_Hook->apply_filters(Array, Array) #5 C:\projects\DOMAIN\wp-content\plugins\wp-gatsby\src\ActionMonitor\ActionMonitor.php(418): apply_filters('gatsby_action_m...', Array, Object(WPGatsby\ActionMonitor\ActionMonitor)) #6 C:\projects\DOMAIN\wp-includes\class-wp-hook.php(307): WPGatsby\ActionMonitor\ActionMonitor->init_action_monitors('') #7 C:\projects\DOMAIN\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #8 C:\projects\DOMAIN\wp-includes\plugin.php(474): WP_Hook->do_action(Array) #9 C:\projects\DOMAIN\wp-settings.php(609): do_action('wp_loaded') #10 C:\projects\DOMAIN\wp-config.php(103): require_once('C:\\projects\\run...') #11 C:\projects\DOMAIN\wp-load.php(50): require_once('C:\\projects\\run...') #12 C:\projects\DOMAIN\wp-admin\admin.php(34): require_once('C:\\projects\\run...') #13 C:\projects\DOMAIN\wp-admin\plugins.php(10): require_once('C:\\projects\\run...') #14 C:\Users\rober\AppData\Roaming\Composer\vendor\cretueusebiu\valet-windows\server.php(225): require('C:\\projects\\run...') #15 {main} thrown in C:\projects\DOMAIN\wp-content\plugins\wp-graphql-gravity-forms\src\Extensions\WPGatsby\Settings.php on line 110

edit: clean up URLs