Skip Navigation

[Resolved] cred delete link for repeatable group is deleting parent post

This support ticket is created 5 years, 11 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Minesh 5 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1176753

I am trying to:

Add, Edit and Delete Repeatable field groups from front-end. Add and Edit functionality is working fine as mentioned in toolset documentation.

I created a view to show repeatable field groups, and added shortcodes to Edit and Delete RPG via cred.

I inserted [cred_delete_post_link] shortcode in the view that is showing repeatable groups. But the link produced by shortcode is pointing to delete the parent post.

This is the standard short code I used in my view to generate the link.

[cred_delete_post_link action='trash' text='Delete %TITLE%' message='Are you sure you want to delete this post?' message_show='1' class='cred-refresh-after-delete']

Please suggest resolution.

Thanks.

#1176775

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - After checking to debug information you shared with us, I found that you are using outdated Toolset plugins. We always recommend running your site with latest stable release plugin version.

*** Please make a FULL BACKUP of your database and website.***
Could you please update ALL Toolset plugins to it's latest official released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/

After upgrading Toolset plugins to the latest version, if your issue still persists, could you please send me Edit screenshot of your view (full page screenshot) where you added the delete post link.

In addition to this, I also see you are using an outdated WordPress version. Could you please update WordPress version to 5.0.2.

#1176820

Hi Minesh,

I updated Types and Views plugins. I see that updates were published yesterday and were not pushed or received by my local install.

Here is my view code;

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<wpv-loop wrap="1" pad="true">
		[wpv-post-body view_template="loop-item-in-rules-in-rop-view"]
	</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

And here is the code of content template;

<h3>[types field="ruler-number"][/types] [types field="rule-title"][/types]</h3>
[wpv-conditional if="(('[wpv-current-user info='role']' eq 'administrator' ) OR ('[wpv-current-user info='role']' eq 'editor' ))"]
[toolset-edit-post-link content_template_slug='rules-of-rop-edit-ct' target='self']<span class="glyphicon glyphicon-edit adminicon"></span><span class="adminlink">Edit</span>[/toolset-edit-post-link]
[wpml-conditional lang="en"] | [cred_delete_post_link action='trash' text='Delete %TITLE%' message='Are you sure you want to delete this post?' message_show='1' class='cred-refresh-after-delete'] [/wpml-conditional] [/wpv-conditional]

[wpv-autop][types field="rule-text"][/types][/wpv-autop]


I found out that [wpml-conditional lang="en"] is creating issue. If I remove [wmpl-conditional] short cod, then the delete link for Repeatable Groups is working fine. If I include this tag than the delete link is deleting Parent Post.

#1176830

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I check the WPML Docs and I see there is no such shortcode available like [wpml-conditional lang="en"].

Is that shortcode is custom shortcode you created? If yes, as you already acknowledge that if you remove that the delete post link works just fine.

If [wpml-conditional lang="en"] is custom shortcode, I need to check if we can do anything with this issue and for that I need problem URL where I can see delete post link as well as access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1176856
image 2.png
image1.png

Hi Minesh,

This shortcode is wpml shortcode and you can found this inside selection pop-up visible by clicking "Fields and Views" button above any editor in Page, Posts, Views etc. I am attaching screenshots for your reference.

Regards,
Khurram

#1176880

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Doh, on my test install WPML is not installed.

Is it possible for you to send me access details so I can try to setup a test case exactly like yours and I will check what we can do further? I need to check how you setup repeatable groups etc..etc.. and please share problem URL as well.

I have set the next reply to private which means only you and I have access to it.

#1176932

Hi Minesh,

My wordpress is on local install that's why I can't share URL. I found another way for language based conditional logic, based on other tickets on toolset.

I created a short code in functions.php to check current language, register that function and shortcode in views and used the same in views.

Following is code for functions.php.

add_shortcode( 'current-lang-code', 'current_lang_code' );
function current_lang_code( $atts, $content ) {
            return ICL_LANGUAGE_CODE;
}

Following is Toolset Views Code.

[wpv-conditional if="(current_lang_code() eq 'en')"]
  [cred_delete_post_link action='trash' text="<span class='glyphicon glyphicon-trash adminicon'></span><span class='adminlink'>Delete</span>" message='Are you sure you want to delete this post?' message_show='1' class='cred-refresh-after-delete'] 
[/wpv-conditional]

Delete link for repeatable group is working fine now and my issue is resolved. You can close this ticket.

Thanks.

#1176942

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

exactly, I should be going to apply the same solution but I was planning to use [wpml-conditional] shortcode with [wpv-conditional] shortcode first.

For example:

[wpv-conditional if="( '[wpml-conditional lang='en']'  eq 'en')"]
  [cred_delete_post_link action='trash' text="<span class='glyphicon glyphicon-trash adminicon'></span><span class='adminlink'>Delete</span>" message='Are you sure you want to delete this post?' message_show='1' class='cred-refresh-after-delete'] 
[/wpv-conditional]

You can check if the above code works for you otherwise continue with the solution you shared and feel free to resolve this ticket.