[Closed] 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Related documentation:

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Cox 2 months 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-05: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)

The topic ‘[Closed] Cred submission overwriting data’ is closed to new replies.