dotherightthing / wpdtrt-form

A WordPress plugin to author simple, accessible forms.
0 stars 1 forks source link

Error adding to DTRT #17

Closed dotherightthing closed 3 years ago

dotherightthing commented 3 years ago

When seeking help with this issue, you may be asked for some of the following information: WordPress version 5.5.4 Current theme: Twenty Twenty (version 1.7) Current plugin: DTRT Form (version 0.3.5) PHP version 7.2.14

Error Details

An error of type E_ERROR was caused in line 925 of the file /container/application/public/wp-content/plugins/release/vendor/dotherightthing/wpdtrt-plugin-boilerplate/src/Plugin.php. Error message: Uncaught TypeError: Argument 1 passed to DoTheRightThing\WPDTRT_Plugin_Boilerplate\r_1_7_16\Plugin::set_plugin_data() must be of the type array, string given, called in /container/application/public/wp-content/plugins/release/vendor/dotherightthing/wpdtrt-plugin-boilerplate/src/Plugin.php on line 1166 and defined in /container/application/public/wp-content/plugins/release/vendor/dotherightthing/wpdtrt-plugin-boilerplate/src/Plugin.php:925 Stack trace:

0 /container/application/public/wp-content/plugins/release/vendor/dotherightthing/wpdtrt-plugin-boilerplate/src/Plugin.php(1166): DoTheRightThing\WPDTRT_Plugin_Boilerplate\r_1_7_16\Plugin->set_plugin_data('No data was ...')

1 /container/application/public/wp-content/plugins/release/src/class-wpdtrt-form-plugin.php(380): DoTheRightThing\WPDTRT_Plugin_Boilerplate\r_1_7_16\Plugin->get_api_data()

2 /container/application/public/wp-content/plugins/release/src/class-wpdtrt-form-plugin.php(356): WPDTRT_Form_Plugin->helper_sendmail('contact-form', 'Contact', Array

dotherightthing commented 3 years ago

It might be that you can't set the form content (in WP Admin) until the plugin is activated, and you can't activate the plugin until there is content?

I changed the string to an array in the plugin's copy of the boilerplate but now there's no logged error.

There is a hardcoded setting for the template name. I can't see why it isn't being recognised.

Need to set up a local dev server to troubleshoot

dotherightthing commented 3 years ago
Screen Shot 2021-05-06 at 6 36 11 PM
dotherightthing commented 3 years ago

Fixed in https://github.com/dotherightthing/wpdtrt-plugin-boilerplate/commit/b6184ce1493d68a9203a2171345f5c9d6a23f06b