Skip Navigation

[Resolved] Adding a Post Form To a Page

This support ticket is created 2 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 10 replies, has 3 voices.

Last updated by Anthony 2 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2528199

Tell us what you are trying to do?
I created a Post Form and am trying to add that to a blank page. When I add it I keep getting this generic WordPress error:
There has been a critical error on this website. Please check your site admin email inbox for instructions.

Learn more about troubleshooting WordPress.

Is there any documentation that you are following?
I'm going through this lesson: https://toolset.com/lesson-placement/lesson-placements-1621521-1612071/

Is there a similar example that we can see?

What is the link to your site?
Here's the page that I can't edit: hidden link

Is there a way to see a more detailed error in the logs somewhere?

Thanks,
Anthony

#2528325

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Anthony

Simply inserting the form in the page provokes the error?

You can see details of the error if you enable logging of errors.

Turn on the debug log by editing your wp-config.php file and change the line with WP_DEBUG like so:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DISABLE_FATAL_ERROR_HANDLER',true);

That will create a debug.log file in your /wp-content/ directory which you can examine in any text editor. But you need to generate errors for them to appear there, so repeat the steps that generated the error previously, then inspect the log.

Please share what you find.

Can you also share your Toolset debug info (not the same thing, rather, basic details about your site such as what plugins you are using) in your next reply. See hidden link

Thanks

#2528903
Screenshot 2023-01-06 at 7.38.22 PM.png
CleanShot 2023-01-06 at 19.41.27.jpg

I added those lines to wp-config.php and navigated to the "List Your Property" page which was causing the error before but it just loads a white page and doesn't do anything now. When I go to the wp-content folder I don't see the debug.log file.

So I trashed the "List Your Property" page and started a new "List Your Property 2" from scratch.

Here are my steps.
1. Created a new page "List Your Property 2" and added a new Toolset Form to it.
2. Selected the view I created "Add New Resort Rental". Right away I get this message in red at the top "Updating failed. The response is not a valid JSON response."
3. When I try and Publish the page I get "Publishing failed. The response is not a valid JSON response."
4. I've gone into the wp-content folder and I still don't see a debug.log file for some reason.

Let me know what Ideas you have. Thanks for your help!

Best Regards,
Anthony

#2528921
CleanShot 2023-01-06 at 19.46.01.jpg

Another update. I tried to create a Content Template with the form and right after I add it to the page I get that error: "Updating failed. The response is not a valid JSON response."

Here's a screenshot. So it happens if I try to add the form to a page or a Content Template. Figured this may help troubleshoot.

Thanks Again,
Anthony

#2530055

Hello,

There should be some JS/PHP errors in your website, please try to follow our document to get the JS/PHP debug logs:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#php-debugging
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#javascript-debugging

If you need more assistance for it, please try these:
1) Backup your website first
2) Provide your website credentials and FTP access in below private detail box,

I might need to deactivate plugins/theme in your website

#2530441
CleanShot 2023-01-09 at 08.56.50.jpg
CleanShot 2023-01-09 at 10.38.55.jpg

Good morning and than you so much for the links.

I was able to get the debug.log to work this morning and also take a screenshot of the error from the front-end.

Here's some information that I get from debug.log:
[09-Jan-2023 02:48:04 UTC] PHP Deprecated: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 63
[09-Jan-2023 02:48:04 UTC] PHP Deprecated: Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 73
[09-Jan-2023 02:48:04 UTC] PHP Deprecated: Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 89
[09-Jan-2023 02:48:04 UTC] PHP Deprecated: Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 102
[09-Jan-2023 02:48:04 UTC] PHP Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 111
[09-Jan-2023 02:48:04 UTC] PHP Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Transport/cURL.php on line 345
[09-Jan-2023 02:48:05 UTC] PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 40
[09-Jan-2023 02:48:05 UTC] PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 51
[09-Jan-2023 02:48:05 UTC] PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 68
[09-Jan-2023 02:48:05 UTC] PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 82
[09-Jan-2023 02:48:05 UTC] PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 91
[09-Jan-2023 02:48:05 UTC] PHP Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/rmccue/requests/library/Requests/Transport/cURL.php on line 345

Also, I'm attaching a screenshot of what I'm seeing on the backend and frontend. This also may explain why the map wasn't working for me in the past that I posted in another ticket. Looks like a Chrome extension may be blocking it but would love your help troubleshooting that error too. I checked and popper.min.js.map and tippy-bundle.umd.min.js.map are both present in those folders.

Thank you so much for your help! Let me know what else I can send you to help.

Best Regards,
Anthony

#2530675

In your screenshot:
https://toolset.com/wp-content/uploads/2023/01/2530441-CleanShot_2023_01_09_at_08.56.50.jpg
There are lots of 500 errors in the Chrome console window, but there are only PHP Deprecated message in your debug logs.
It seems you did not get the full PHP debug logs, you can also ask your server provider to get the debug logs. Please let me know if you need assistance to get the full PHP debug logs, private message enabled again:
1) Backup your website first
2) Provide your website credentials and FTP access in below private detail box,

I might need to deactivate plugins/theme in your website

#2531597

Thanks for the details, I have tried these in your website:
1) Edit the file wp-config.php
replace line from:
define('WP_DEBUG_DISPLAY', false);

To
define('WP_DEBUG_DISPLAY', true);

Open URL
hidden link

I see below PHP errors:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function PWH_DCFH\App\Frontend\DiviContactForm\PWH_DCFH_Filter_Contact_Form::maybe_add_custom_mimetypes(), 1 passed in /home/clubserv/public_html/2023.thevacationadvantage.com/wp-includes/class-wp-hook.php on line 308 and exactly 2 expected in /home/clubserv/public_html/2023.thevacationadvantage.com/wp-content/plugins/divi-contact-form-helper/app/Frontend/DiviContactForm/PWH_DCFH_Filter_Contact_Form.php:4800 

It is a PHP error from another plugin: Divi Contact Form Helper

2) Deactivate plugin "Divi Contact Form Helper"

It works fine in both frontend and admin side.

Can you confirm it in your website, if it is fixed, you can restore the wp-config.php file

And it is a problem of other plugin, which is out the range of Toolset support, you might need to check their support.

#2532097

Thank you so much for looking into it! I've reached out to the developers of the other plugin and will keep you updated.

By disabling the plugin it does appear to let you edit and save the Post Form :).

Best Regards,
Anthony

#2532483

I have marked this thread as "Waiting for feedback" status, you can update here if need more assistance.

#2535117

My issue is resolved now. Thank you!