Skip Navigation

[Resolved] Post edit forms relationship selector stopped working

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

Problem:
An older site uses the cred_link_form shortcode to link to an edit form, and after an update the related post selector on the form stopped working.

Solution:
This was unintended and we will look at updating this to maintain backwards compatibility, but in the meantime you can update how the Edit Forms are linked to to match current usage, as described in the linked documentation.

Relevant Documentation:
https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/

This support ticket is created 5 years, 7 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+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by nickH-5 5 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#1113884
audio clip - show 1.png
podcast - show.png

I am trying to: use forms which have worked in the past to edit a post's relationship with another

I expected to see: the dropdown populate or allow me to search for a relationship

Instead, I got: no matches

I have tried amending one form to the new format for relationships but this had no effect.

Post creation forms for the same CPTs and relationships work fine.

The uploaded images show the two forms as examples and here are the two shortcodes used:

Related to which show?
</label>
[cred_field field='@show_podcast.parent' class='form-control' output='bootstrap' select_text='--- not set ---']

Related to Show
</label>
[cred_field field='_wpcf_belongs_show_id' value='']

Thanks

#1114291

Nigel
Supporter

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

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

Hi Nick

Is this an older site where the relationships were created in Types 2?

Have you run the migration to convert the relationships to the new Types 3 relationships?

field='_wpcf_belongs_show_id' is the older format.

field='@show_podcast.parent' is the new format, except(!) the attribute would be item and not field.

In such a situation I would auto-generate the form markup and it should create the correct field in the correct format. (If you don't want to lose your current form markup, create a new one that you can copy markup from and then discard.)

#1114349

Thanks.

Yes this is a site migrated from Types 2 and I believe I did run the migration.

I have created a new edit form but have the same problem. The code used is now:

[cred_field field="@show_podcast.parent" class="form-control" output="bootstrap" select_text="--- not set ---"]

The issue appears to be that I have a view which includes the link to the edit form as follows

[cred_link_form form='102108' form_name='Edit podcast 2' text='Edit' target='_self']

If I don't do that but I insert in a separate page a form with a specified post (e.g. [cred_form form='edit-podcast-2' post='102081']) it works fine.

Do I need to rethink how I am listing posts with an edit link?

Nick.

#1114968

Nigel
Supporter

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

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

Hi Nick

I wouldn't expect this to break, but maybe upgrading to Types 3 and running the migration has.

The way edit forms are handled changed some time ago (before Types 3 was released if I recall correctly).

The current requirements for displaying edit forms are detailed here: https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/

You need to add the edit form to a content template, and then generate an edit link to the post using that template.

Could you try updating how you use your edit forms to match the current methodology?

As I say, I wouldn't have expected it to break, but that seems the most likely cause.

#1115840

My issue is resolved now. Thank you!

It does seem a bit odd that a different layout is needed for each edit form for each CPT but it is a solution which works.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.