Skip Navigation

[Resolved] Cannot create new front end form

This thread is resolved. Here is a description of the problem and solution.

Problem:
I created a new post type, added custom fields but when I try to create a new form I get a Critical site error. I can open/edit existing forms, but cannot create new forms.
Solution:
This issue has been fixed now with the Types version 3.4.20, please update it by going to Plugins -> Add New -> Commercial tab. Alternatively, you can download it from here: https://toolset.com/account/downloads/, and upload directly into your Plugins -> Add New page.

This support ticket is created 2 years, 1 month 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 20 replies, has 2 voices.

Last updated by Mateus Getulio 1 year, 10 months ago.

Assisted by: Mateus Getulio.

Author
Posts
#2608467

I’m still having issues with timeouts. Dreamhost has been looking at things from their end and asked me to try php 7.4.
Yesterday a member received a “potentially unsafe operation “ error on submitting a form that has previously worked with no issues:
hidden link
I’m getting stressed about having to redo the site and come up with a new plan in the next week due to events that need a functioning site. Can you advise what could have caused this? Do I need to move back to pho 8.0?
Thank you for your help

#2608913

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks for your reply.

We have just tested the mentioned form and the submission worked fine: hidden link. If you're still facing problems in this matter, I kindly ask you to open a new ticket for it, since it is a different issue and we need to focus in just one issue per ticket.

Now, regarding the main issue related to the time out in the forms creation, our team is already investigating it and as soon as possible we'll provide you with updates. What I can share with you now is that it's not specific to your installation - if we create a clean WP install and install Toolset there, the 'create form' button won't work as well.

Please stay tuned for our contact. Thank you.

#2609325

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks for your patience.

Upon further inspection, we have found a workaround for you. Please follow these steps:

- Make sure to have a complete backup
- Get access to the website files
- Go to this folder: wp-content/plugins/types/application/models/helper/create
- Open the 'form.php' file
- Replace these lines:

	private function validate_name( $name, $id = 1 ) {
		$name_exists = $this->get_object_by_title(
			html_entity_decode( $name ),
			defined( 'CRED_FORMS_CUSTOM_POST_NAME' ) ? CRED_FORMS_CUSTOM_POST_NAME : 'cred-form'
		);

		if ( $name_exists !== null ) {
			$name = $id > 1 ? rtrim( rtrim( $name, (string) ( $id - 1 ) ) ) : $name;

			return $this->validate_name( $name . ' ' . $id, $id + 1 );
		}

		return $name;
	}

- With these ones:

private function validate_name( $name, $id = 1 ) {
		$name_exists = $this->get_object_by_title(
			html_entity_decode( $name ),
			defined( 'CRED_FORMS_CUSTOM_POST_NAME' ) ? CRED_FORMS_CUSTOM_POST_NAME : 'cred-form'
		);

		if ( $name_exists ) {
			$name = $id > 1 ? rtrim( rtrim( $name, (string) ( $id - 1 ) ) ) : $name;

			return $this->validate_name( $name . ' ' . $id, $id + 1 );
		}

		return $name;
	}

Ensure to not remove the last "}' at the end of the file, otherwise it won't work. Just save it and then it should be solved.

Please give it a try and let us know how it goes. Thank you.

#2609847

thank you for all your work on this issue. I'm more comfortable continuing to access new forms from the other location than adding this code. Hopefully this will be something resolved in your next release.

#2610247

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thanks for your patience and understanding.

I will set the current ticket status as escalated to our developers team, and I will get back to you as soon as I get any feedback from them.

Kind regards,
Mateus.

#2631425

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks a lot for your patience.

This issue has been fixed now with the Types version 3.4.20, please update it by going to Plugins -> Add New -> Commercial tab. Alternatively, you can download it from here: https://toolset.com/account/downloads/, and upload directly into your Plugins -> Add New page.

Looking forward to your reply and confirmation. Thank you.

#2631447

the update seems to have resolved the issue. Thank you