[Waiting for user feedback] Cred submission overwriting data

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.

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Related documentation:

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Cox 1 week ago. The support staff assigned to this topic is Christian Cox.

Viewing 2 posts - 1 through 2 (of 2 total)
Author
Posts
#569776

When two people open the form, they get the same _cred_cred_prefix_post_id, so when the form is submitted the content of the post of the first submitted form get replaced by the content of the second.

We try to use the cred_before_save_data hook to replace the id in the form data without success.

This is the hook code :

add_action('cred_before_save_data_288', 'valide_cred_cred_prefix_post_id',15,1);
function valide_cred_cred_prefix_post_id($form_data){

		if (isset($_REQUEST['_cred_cred_prefix_post_id']) || isset($form_data['_cred_cred_prefix_post_id'])){
				$goodid=good_id($_REQUEST['_cred_cred_prefix_post_id']);
				$_POST['_cred_cred_prefix_post_id'] = $goodid;
				$_REQUEST['_cred_cred_prefix_post_id'] = $goodid;
				$form_data['_cred_cred_prefix_post_id'] = $goodid;	
		}

	return $form_data;
}

function good_id($id){
		while (get_post_status($id)) {
			$id++;
		}
		return $id;
	}

#569824

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-04:00)

Hi, I see that your plugins are quite out of date, as well as your WordPress installation. Quite a few updates have been made to CRED, including some bug fixes in the new post creation sequence. My first recommendation is to update WordPress and all Toolset plugins and retest. Make a full backup of your site files and database before you try to update.

https://wp-types.com/download/toolset-cred/#changelog

Viewing 2 posts - 1 through 2 (of 2 total)

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Known issues and their solutions

We document known issues and their solutions in Toolset erratas. Save time by checking there first and seeing if what you are facing is a known issue. This list is kept short. We do our best to resolve all known issues with every release of Toolset plugins.

Support Policy

Toolset staff will help you use the Toolset plugins correctly, provide any information you need, help troubleshoot problems and advice on best-practices.

Please make sure to issue only one topic per each support ticket.

For more information, read our full Customer Support Policy.

Need custom programming work for your site? Check out our certified partners.