Skip Navigation

[Resolved] Repeatable field input via CRED seems won't publish

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

This topic contains 2 replies, has 2 voices.

Last updated by roulartaM 5 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1394609
7-partner-with-video.png
6-parent-post.png
5-no-video.png
4-one-video.png
3-one-video.png
2-add-video.png
1-no-videos.png

Hi there!

Here's another issue on my Communie website. I'll copy the intro from this topic: https://toolset.com/forums/topic/cred-edit-and-delete-link-not-showing-when-not-logged-in-as-administrator/

On my website, I have a CRED admin panel for users (custom role = "partner") who can change different shop data and data related to their shops. This is what they can change:

1) Shop data
- Post Form to add: "Klanteninterface: winkel (bewerken)"
- CRED fields: name, description, opening hours, address, phone, ...

2) Shop brands
- Relation Form to add: "Klanteninterface: winkel merk (toevoegen)"
- CRED fields: brand

3) Shop photos
- Post Form to add: "Klanteninterface: foto per winkel (toevoegen)"
- Post Form to edit: "Klanteninterface: foto per winkel (bewerken)"
- CRED fields: title, photo, alt text, title text

4) Shop videos
- Post Form to add: "Klanteninterface: video per winkel (toevoegen)"
- Post Form to edit: "Klanteninterface: video per winkel (bewerken)"
- CRED fields: video-youtube, video-mp4, video-webm, poster

Here's some additional relationship information:

- A shop can have multiple brands and a brand can be linked to multiple shops (many to many)
- A shop can have multiple photo's (repeatable field)
- A shop can have multiple videos (repeatable field)

STEPS TO REACH THE PROBLEM

When you log in as a partner ( see other topic for the credentials => https://toolset.com/forums/topic/cred-edit-and-delete-link-not-showing-when-not-logged-in-as-administrator/), you can add a video to a shop via a CRED form (see '1-no-videos.png'). This CRED post form is called 'klanteninterface-video-per-winkel-toevoegen'. It's sufficent to only fill in the YouTube link and then save the form (see '2-add-video.png')

After you added a video, it's visible in the video overview (see '3-one-video.png' and '4-one-video.png).

THE PROBLEM

On the front-end, the video doesn't appear in the video loop (see '5-no-video.png'). It should appear in the view called 'videos-per-winkel-of-per-merk'.

There's a simple way to make it appear in the front-end video list: by clicking the 'update' button of the parent partner where the video is located (see '6-parent-post.png). So it looks like the video isn't published until the admin saves the partner. And then it looks like '7-partner-with-video.png'.

Can you point me to the reason of this behavior so I can fix it? The video should be visible on the front-end immediately when it's uploaded ofcourse 🙂

#1395105

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I checked the issue you reported and it seems there is indeed some issue. Your site is really complex to debug the issue as its using number of nested views and inside views, there is number of conditional statements.

There's a simple way to make it appear in the front-end video list: by clicking the 'update' button of the parent partner where the video is located (see '6-parent-post.png).
==>
Yes - I can confirm that it works when you save the partner from backend. Actually, It was required deeper troubleshooting and finally, I found the solution but this looks like a bug to me which I'll report it to our next level support.

The issue is when you update the partner page from the backend - it saved the post with the meta key toolset-post-sortorder and when you add the video from the front-end using the following form:
=> hidden link

When you submit above form it does not add the toolset-post-sortorder metakey with the new video entry you submit.

Now, the reason why the newly submited video entry is not displayed on the related partner page:
=> hidden link

Because you are displaying the view that queries the Repeating Field Group videos where you also set this view's ordering to order by toolset-post-sortorder (see screenshot: hidden link) and with new video entry you add using Toolset form 'klanteninterface-video-per-winkel-toevoegen' as I acknowledged do not add the meta key toolset-post-sortorder .
View that queries related videos => hidden link

As a workaround, I've added the following code to "Custom Code" section offered by Toolset:
=> hidden link

add_action( 'cred_save_data', 'func_connect_rfg_shopvideos_entry', 10, 2 );
function func_connect_rfg_shopvideos_entry( $post_id, $form_data ){
    
    if ( 27258 == $form_data['id'] ) {
    
         update_post_meta( $post_id,'toolset-post-sortorder', 1 );
      
    }
}

Thanks to above code, now when you submit a new video entry using Toolset form 'klanteninterface-video-per-winkel-toevoegen' - it will add the "toolset-post-sortorder" metakey and the newly added video entry using Tooset form will also now appear/display with your partner page:
=> hidden link

Can you please confirm it works at your end as well 🙂

#1397255

My issue is resolved now. Thank you!