Skip Navigation

[Résolu] Cred Edit Form Does Not Update CPT

This support ticket is created Il y a 7 années et 8 mois. 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: Pacific/Niue (GMT-11:00)

Marqué : 

This topic contains 5 réponses, has 2 voix.

Last updated by scottD-2 Il y a 7 années et 7 mois.

Assigned support staff: Vincenzo.

Auteur
Publications
#308290
edits.png

I am trying to update a custom post type using the Cred edit form.

When I visit the CPT page, the edit link displays as expected. When I click on the edit link, the edit form also displays as expected.

When I update the form with new information, it directs to the "success" message as expected. However, when I view the CPT data in the back end (or even the post on the front end) the new information isn't saved.

I have tried editing the form in both Chrome and Firefox.

Users who are using the edit form are set as Contributors to the site, although I also tried using Author, Editor, and Administrator roles and it didn't work either.

The notification email I have set to send to me whenever a listing is updated comes in with the correct subject line, using

%%POST_TITLE%% Updated Directory Listing

, but it has no body content

The body of the notification email is set only using

%%FORM_DATA%%

. This sort of makes it seem like the form isn't even submitting the data.

I have the edit link hidden on the front end to anyone except for the user who created the entry, so posting a link isn't going to show the problem.

I even tried deleting the edit form and creating a new one in case that form wasn't configured correctly for some reason, and it had the same results.

The initial content creating form works as expected. It's only the edit form that doesn't appear to be working.

#308390

Vincenzo
Supporter

Languages: Anglais (English )

Timezone: Pacific/Niue (GMT-11:00)

Hi Scott,

I would like to ask you to make the following steps:

1. Update Types plugin to the latest version
2. Try disabling all plugins but Toolset ones
3. Try with a default theme
4. Post a screen shot of your CRED form in Edit mode

Thank you

#308471

Hi Vincenzo,
Sorry, I failed to mention that I had done steps 1-3 as you suggested, and it produced the same result. The default theme I used was TwentyFifteen. The Toolset plugins installed are Types, Views, CRED, and Access. All other plugins were disabled. This is a fresh install of WordPress, which was installed 2 days ago.

I'm not sure what screenshot you're looking for - the front end edit form, or the back end where the edit form is created?

I'd be happy to provide login info if it would help so you can take a look at the configuration.

#308482

Vincenzo
Supporter

Languages: Anglais (English )

Timezone: Pacific/Niue (GMT-11:00)

I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue.
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you will enter is private which means only you and I can see and have access to it.

#309061

Vincenzo
Supporter

Languages: Anglais (English )

Timezone: Pacific/Niue (GMT-11:00)

Hi Scott,

the [wpv-if] code is creating problem there.
If you remove that, you will see the edit form working. There is a comment now on the form content.
Maybe you may place the WPV-IF block in your content template where you insert the link for edit/delete, rather than in the CRED form itself.

P.S.
The latest version of Types plugin is 1.6.6.5. Can you please update that?

#309126

Great that works!
After reading the solution you came up with, I realized that the WPV-IF block you were referring to was redundant, as I already wrapped the Edit/Delete links in the exact same conditions.
If anyone else comes across this thread with a similar issue, I wrapped the post edit and delete links in a WPV-IF like this:

[wpv-if evaluate="'[wpv-current-user info="login"]' = '[wpv-post-author format="meta" meta="user_login"]'"]
<p>[cred_link_form form="Business Edit" text="Edit %TITLE%" target="_self"] | [cred_delete_post_link class="cred-refresh-after-delete" text="Delete %TITLE%" action="trash" message="Are you sure you want to delete this post?" message_show="1"]</p>[/wpv-if]

This wasn't the problem though.

The problem is I used the exact same wpv-if on the edit form, wrapping the entire form in the same wpv-if. The wpv-if on the edit form was somehow preventing the form from saving any of the form data.

It turns out that the wpv-if on the edit form wasn't necessary at all since the edit link was already conditionally displayed. Simply removing it made it work correctly.