Skip Navigation

[Gelöst] Form returning „Form type and post type do not match“

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

I have a working form to edit a users post, linked from the users account page. I am trying to add a form to renew the post, which is very similar. However, when I try to test it, I get the error: "Form type and post type do not match"

Solution:

I assume we are talking about a Toolset form for editing post, you are going to edit the specific post depends on the URL parameter "post_ids".

If it is, you can get the URL parameter value with shortcode [wpv-search-term], for example:
[wpv-search-term param="post_ids"],

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

And pass it to Toolset form shortcode and test again, for example:
[cred_form form='my-form-slug' post='[wpv-search-term param="post_ids"]']

Relevant Documentation:

https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_form

This support ticket is created vor 4 Jahre, 4 Monate. 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 2 Antworten, has 2 Stimmen.

Last updated by daveG-7 vor 4 Jahre, 4 Monate.

Assigned support staff: Luo Yang.

Author
Artikel
#1110864

I have a working form to edit a users post, linked from the users account page. I am trying to add a form to renew the post, which is very similar. However, when I try to test it, I get the error: "Form type and post type do not match"

The form is called from within a view loop that calls the user's posts, with the link <a href="[wpv-post-url id=6848]?post_ids=[wpv-post-id]">Renew</a> which gets to the right page, and is how the edit post form is set up.

The post form is set to edit existing content from the same post type as the loop.

Any idea what could be happening?

#1111354

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

I assume we are talking about a Toolset form for editing post, you are going to edit the specific post depends on the URL parameter "post_ids".

If it is, you can get the URL parameter value with shortcode [wpv-search-term], for example:
[wpv-search-term param="post_ids"],

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

And pass it to Toolset form shortcode and test again, for example:
[cred_form form='my-form-slug' post='[wpv-search-term param="post_ids"]']

https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_form
post. Optional. The post ID to edit with this form. If form is an edit form and this is skipped, the ID of the current post in the loop will be used.

#1113257

I had forgotten to wrap the form in a view that filters by post ids. Thanks!