Skip Navigation

[Resolved] [toolset-edit-post-link] link only visible to Admins (recent creations only)

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

Problem:

I have a problem using toolset-edit-post-link: the link is visible for Administrator but invisible for an Editor.

Solution:

The problem you mentioned above is abnormal, please check these:

https://toolset.com/forums/topic/toolset-edit-post-link-link-only-visible-to-admins-recent-creations-only/#post-1185710

Relevant Documentation:

https://toolset.com/documentation/user-guides/setting-access-control/

This support ticket is created 3 years, 10 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
- 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)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by tony 3 years, 10 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#1185403

I have a problem using toolset-edit-post-link.

Previously, I have used this link method to display an edit page and it worked fine:
[toolset-edit-post-link content_template_slug="event-edit"]<span class="glyphicon glyphicon-pencil"></span>[/toolset-edit-post-link]

My latest uses are failing even though I have replicated things (example link)
[toolset-edit-post-link content_template_slug="person-edit-template" target='self'] <span class="glyphicon glyphicon-pencil"></span>[/toolset-edit-post-link]

The problem is that the link is visible for Administrator but invisible for an Editor.

I have removed all Access controls (cleared the database) and even deactivated Access so that I know that is not a cause.

I have simplified the problem by adding a link on a selected post page (generated by Toolset):

[toolset-edit-post-link content_template_slug='person-edit-template' target='self']Edit %%POST_TITLE%%[/toolset-edit-post-link]

and the link is not visible for Editor.

I have constructed the same link manually using the page slug:

<a href="hidden link">hidden link;

and the link is visible and works fine.

I have no idea where to look for the solution and don't understand why the link appears only for Administrators on my new templates but appears to work fine on the old post pages/templates and yet the code is almost identical.

Please can you provide some guidance as to where I might look for the problem?

Thanks
Tony

Added notes:
When I deacivated Access, the links for the Administrator did not display on the new pages and I had to re-activate it and login again before they reappeared.

#1185710

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

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

Hello,

The problem you mentioned above is abnormal, please check these:
1) You are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) Follow our document to setup the access setting for editor and administrator:
https://toolset.com/documentation/user-guides/setting-access-control/

3) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2019, and test again

Also check if there is any PHP errors in your website.
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#php-debugging

#1185725

This is all very strange.

I am now finding that simple forms that can be completed without the user being logged inare not displaying (permission denied) so something has gone wrong somewhere.

I will do more testing and checking but everything is 100% up to date - plugins and WP.

I have another website that I can take a look at as well.

I will report back when I have more information.

Thanks
Tony

#1185815

Hi Luo

I have finally managed to track down the problem.

I was doing everything as per the instructions and only replicating what had worked before (or so I thought).

There was one key difference though and that was to do with the template content.

Normally the edit template used had just the Edit form and a few other bits of information, which works fine.

In this case, I had gone further and added a second form to Add a Post. It appears that this works fine for an Administrator but not for anyone else.

My code for the template is below but includes

- edit form [cred_form form='edit-person']
- add form [cred_form form="add-person"]
- view [wpv-view name="list-people-view"]

As soon as I removed [cred_form form="add-person"] things worked fine.

So, is this a bug?

I can use a hack to get round the problem, but it would be nice if the [toolset-edit-post-link content_template_slug="person-edit-template" target='self'] shortcode could work with multiple Cred forms in the template.

Tony

<div class="left-right-margin">
<center>
<p class="post-title-new">
Edit/Add Person
</p>
<div style="max-width: 700px; text-align: center;">
<p>
<a href="hidden link">Membership Management</a>
</p>
<br />
</div>
</center>
</div>

<div class="row">

<div class="col-sm-6">
<h3>Edit: [wpv-post-link]</h3>
 <br />
[cred_form form='edit-person']
</div>
<div class="col-sm-6" style="background-color: lightblue;">
<h3>Add a Person</h3>
 <br />
[cred_form form="add-person"]
 <br />
</div>
</div>
 <br />
 <br />
<h3>TDSWC List of all People</h3>
[wpv-view name="list-people-view"]
 <br />

#1186024

A solution:

If you want to put more than 1 Cred form on the Edit landing page, I left the Edit form visible in the destination template and put my Add form in a separate body template, thus hiding it until it needs to be displayed. Works really well.

Tony

#1186286

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

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

If you have confirmed there isn't any other compatibility problem, please provide your website database dump file, also point out the problem page URL and form URL, I need to test and debug it in my localhost.
https://toolset.com/faq/provide-supporters-copy-site/

#1186582

My issue is resolved now. Thank you!

I am happy with the solution outlined and so do not need any further assistance with this. It is working fine.

Tony