Skip Navigation

[Resolved] Unable to insert CRED Edit Form Button into View

This support ticket is created 6 years, 3 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

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

Author
Posts
#1078575

J S
Screen Shot 2018-08-09 at 11.40.42 AM.png
Screen Shot 2018-08-09 at 11.45.31 AM.png

I am trying to: Allow a CPT submission's author to make edits to their submission.

Link to a page where the issue can be seen: hidden link

I expected to see: An edit button on the page that will appear conditionally if the author is logged in.

Instead, I got: Not there yet. Trying to follow the instructions on this page: https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/

I've done the following:

1. Created the Edit Submission CRED Form
2. Created the Content Template with the Edit CRED Form shortcode
3. When I go to the single view ("Submission View") and try to add the field (see screenshot), I get an error message (see other screenshot).

So I am unable to insert the link on the single view that links to the "Edit Submission" form, as this message is not allowing any shortcode to be submitted. I definitely have create the Content Template with the Edit Submission Shortcode inserted as described in the documentation. Its just that I cannot insert the link.

#1078610

2. Created the Content Template with the Edit CRED Form shortcode
Actually when you have Toolset Layouts active, you must create an unassigned Layout with the Edit Form shortcode. The Content Template isn't sufficient. Please try creating a Layout instead of a Content Template and let me know if you continue to have trouble.

#1078735

J S
Screen Shot 2018-08-09 at 4.19.02 PM.png

I tried that too, same problem.

See screenshot.

Then try to go to this page: hidden link

and add the CRED Edit Form field. You'll see the error message.

#1078790

A CRED / Form cell is best in the Layout. When you insert the shortcode in a Visual Editor cell, it seems to have trouble recognizing the Layout contains the Form. I have modified that in the Layout and added the edit post link in the View. Can you verify it's working more like expected?

#1079681

J S

Ok, thanks, it is now working but I am not able to get the conditional working properly yet.

The below is a modification to your code with the goal of the submitting user or admins being the only people that can see the
Edit %%POST_TITLE%% link

To do this I attempted to add a conditional so that only the submitting author or the admin can see the Edit %%POST_TITLE%% link, as described here: https://toolset.com/forums/topic/conditional-cred-edit-link-for-post-author-or-site-admin/

However, the conditional loads the text "Hola, it works...!!" for the submitting author but not the Edit %%POST_TITLE%% link

The conditional code does seem to do what is expected for the admin (sees text and edit link), and non-logged in users (see neither text nor edit link). What needs to change on the following code to accomplish goal stated above?

[wpv-conditional if="( '[wpv-current-user info="login"]' eq '[wpv-post-author format="meta" meta="user_login"]' ) OR ( '[wpv-current-user info="role"]' eq 'administrator' )"]
  Hola, it works...!!  [toolset-edit-post-link layout_slug="layout-template-for-submission-edits"]Edit %%POST_TITLE%%[/toolset-edit-post-link]
[/wpv-conditiona]

Feel free to login again to make any adjustments.

I intentionally left a copy of your Edit %%POST_TITLE%% code below the conditional unaltered as a reference until this is solved.

Thanks!!

#1080655

Okay so the conditional part is working as expected, but the edit post link is not appearing. This could indicate a permissions configuration problem in Access. Please confirm the following settings:
- In Toolset > Access Control > Forms tab, the post author's User Role should have the permission to "Edit Own Custom Post with CRED 'Form Edit Submission Form'". Without this permission, the link to edit the post will not appear. Right now, only a few roles have this permission, so if the testing post author is not one of these roles that could be the problem.
- In the Toolset > Access Control > Post types tab, the post author's User Role should have the permission to "Edit Own" under the Submissions post type. Again, right now only a few roles have this permission.