Skip Navigation

[Resolved] Cannot make functional post form for custom post type

This support ticket is created 6 years, 9 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nigel 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#627567
Screen Shot 2018-03-22 at 5.07.22 PM.png
Screen Shot 2018-03-22 at 5.06.54 PM.png

I am trying to: Create a post form for a custom post type

Link to a page where the issue can be seen:
hidden link
(let me know if you need credentials)

Instead, I got:
a spinning icon next to the "add post fields" button and a console error that reads "POST hidden link 500 ()"
Attempting to use the "Autogenerate Form" button creates an error reading: "Form Type or Post Type is not set!"
Though you can save the form, it's pretty much unusable, and strips most content out of the page it's included on: hidden link
Using any other post type works fine, but we need this specific one to work with form submissions.
Any ideas? Thanks!

#627695

Nigel
Supporter

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

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

Hi Lana

The error you report from the developer console shows that for the ajax request that retrieves the list of fields for the post type used in the form there is a fatal PHP error (the 500 code).

It would be useful to know what that is. I couldn't get the FTP credentials you provided to work to check your logs myself.

Make sure you have debugging turned on in your wp-config.php file and inspect the logs for errors.

If you haven't already, 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);
ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

That will create a debug log called error_log.txt in your root directory (the same location as wp-config.php) which you can examine in any text editor. Edit the form again which should trigger that 500 error, and you can then find the details of the error in the logs.

I note that you are using the betas, so it is expected that you might run into problems.

So it would also be helpful to know if you switch to the stable releases (you would need to do that for each of the Toolset betas, not just CRED forms) whether you see the same error.

Let me know what you find and I can see how to proceed.

#627764

Hi Nigel,
Thank you for your response. The WP debug log doesn't appear to be creating or editing log files as the errors are thrown. Is this a permissions issue I can easily change somewhere? I've fixed the ftp credential issue if there is a way to securely send those to you again.

#627777

Nigel
Supporter

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

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

Hi Lana

Let me set up a private reply for you now.

#627778
#628348

Nigel
Supporter

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

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

Hi Lana

Thanks for that. Debug logging is not working. There is no error_log.txt file being generated in the root directory. I added a plugin (Code Snippets) to add a quick line of PHP to send messages to the log to force its creation, but the file is not being produced. I changed the settings in wp-config.php to create a different debug file (debug.log in wp-content/) but that is not being created either.

I need to see the log to know what the error is being generated.

Can you please contact your hosting to find out why it is not possible to enable the debug logs? It's a standard WordPress feature.