Skip Navigation

[Resolved] Repeating field group edit form not showing content of fields

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 14 replies, has 2 voices.

Last updated by nickH-5 1 year, 12 months ago.

Assisted by: Minesh.

Author
Posts
#2492225
rfg form.jpg

I am trying to allow users to edit the values in repeating field groups using a Toolset form. The form is linked to from a content template containing the "show" which has repeating field group "Days1"

I have followed this documentation https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups/

However, when the user clicks on the edit link and goes to the edit content template containing the form for editing Days1, the fields are not populated in the edit form. I was expecting to see the content of the repeating field group displayed, ready for the user to edit as for other post edit forms. Only the field group title is displayed, all other fields except for "show" are empty

#2492593

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I will have to review how exactly you setup the edit form and where you added the edit link.

Can you please share problem URL and admin access details that will allow me to review your current setup and after that I'll be able to guide you in the right direction.

*** 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 have set the next reply to private which means only you and I have access to it.

#2492819

Minesh
Supporter

Languages: English (English )

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

I tried to access the wp-admin but it shows me the following error message:

Your access to this site has been temporarily limited by the site owner
Your access to this service has been temporarily limited. Please try again in a few minutes. (HTTP response code 503)

If you think you have been blocked in error, contact the owner of this site for assistance.

Do you have any country or IP based restrictions, if yes, could you please remove that for now.

#2492839

There are no IP or country restrictions, but I have reset your password. Please can you enable private messaging

#2492843

Minesh
Supporter

Languages: English (English )

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

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

#2492855

Minesh
Supporter

Languages: English (English )

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

The wp-admin or wp-login.php page loaded but as soon as I try to submit the access details and try to login I can see the same blocking page with the following information:

Your access to this site has been temporarily limited by the site owner
Your access to this service has been temporarily limited. Please try again in a few minutes. (HTTP response code 503)

If you think you have been blocked in error, contact the owner of this site for assistance.

I checked with my one of the colleague and he also experience the same. Can you please make sure we can able to login to wp-admin without any blockage.

#2492933

I'm sorry about this. Your IP was blocked for 320 minutes due to an unsuccessful login attempt. I suggest you do a password reset from mix926.com/wp-admin as there is no blocking other than for incorrect usernames or passwords.

#2492935

Minesh
Supporter

Languages: English (English )

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

Well - I'm using the same username and password provided by you and and it should work and I'm not sure why its still showing me the blocked page. Even though I try to submit correct username and password it still redirect me on the IP block screen.

#2492941

I think it is best if you reset your password having waited 30 mins since your last attempt

#2493517

I have realised that you can't reset your password for the site, sorry, because you don't have a registered email address. I will reset the password again if you enable private

#2493519

Minesh
Supporter

Languages: English (English )

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

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

#2494403

Minesh
Supporter

Languages: English (English )

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

I checked on your install and indeed I can able to see the issue. I tried few things but on your install I found its not working.

Then I tried to create a sandbox site using the Day1 fields you have. You can auto-login to the site using the following link:
=> hidden link

Here you can see I've created the custom field group for "shows" post type that is having the Repeating Field Group "Days2":
=> hidden link

I've created few posts for "Shows" post type:
=> hidden link

I've created the following Edit form to Edit "Days2" posts:
- hidden link

I've created following content template as container that holds the Edit form:
- hidden link

To display the RFG I've created the following View where I've also added the Edit link to edit RFG entry:
=> hidden link

And added the above view to the Single post content template of "Shows":
=> hidden link

You can see Edit link on frontend:
hidden link

When I edit the Monday or Tuesday Entry I can see it does display the correct values with edit form.

- Do you have any server side cache or any other cache plugin?
- What if you create new edit form and new content template that holds the edit form and then try to add edit link to your view - does that works?
- What if you try on different server and check if you see it working there?
- Have you changed the dropdown field values after saving the post from custom field group for days1 RFG fields like "Start Hour" and "End Hour"?

*** Please make a FULL BACKUP of your database and website.***
Could you please try to resolve your issue by deactivating all third-party plugins as well as with the default theme to check for any possible conflicts with any of the plugins or themes?
- Do you see any difference?

#2495961

Thanks, that is a lot of work you have done. I appreciate it.

Do you have any server side cache or any other cache plugin?
Yes, hummingbird but even if it is deactivated the problem persists

- What if you create new edit form and new content template that holds the edit form and then try to add edit link to your view - does that works?
No it doesn't

- What if you try on different server and check if you see it working there?
I don't have access to another server. I could possibly copy to a new instance on the same server for testing

- Have you changed the dropdown field values after saving the post from custom field group for days1 RFG fields like "Start Hour" and "End Hour"?
I'm not sure what you mean but if I use the form to edit, it does make changes to the RFG

I have tried deactivating plugins but this seems to have no effect

Nick

#2495985

Minesh
Supporter

Languages: English (English )

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

Rather going in too much details as I'm not able to reproduce the issue on the sandbox site I shared which I already shared with your with my previous reply.

We can use the Toolset from filter: "cred_filter_field_before_add_to_form"
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_filter_field_before_add_to_form

I've added the following lines of code to "Custom Code" section offered by Toolset with code snippet "enddate":
- hidden link

add_filter('cred_filter_field_before_add_to_form', 'func_fill_values_on_rfg_edit_form', 10, 2);
function func_fill_values_on_rfg_edit_form($field, $computed_values){
  global $post;
  

  $field_slugs = array('day-of-week', 'start-hour','end-hour','presenter-names');
  
   if(is_array($field) and !in_array($field['id'],$field_slugs)) return $field;
   
  if(is_array($field) and isset($field['id']) and in_array($field['id'],$field_slugs)){
    
   $form_html_id = $field['form_html_id'];
   $form_id = 0;
   if ( isset($form_html_id) ) {
        $parts = explode( '_', $form_html_id);
        $form_id = (int) $parts[2];
    }
    
  if( $form_id == 182634 or $form_id ==182904) {
    $field['data'] = is_array($field['data']) ? $field['data'] : array();
    $edit_post_id = $_GET['cred_rfg_id'];
    
    if($field['id']=='presenter-names'){
      $default_value =  get_post_meta( $edit_post_id,'wpcf-'.$field['id'],true);
      $field['data']['user_default_value'] =   $default_value;
     
    }else{
   		$default_value =  get_post_meta( $edit_post_id,'wpcf-'.$field['id'],true);
    	$field['data']['options']['default'] = $default_value;
    }
   
    }
  }
  return $field;
}

Can you please confirm it works as expected now: hidden link

#2496153

Thanks so much for going so far to solve the problem. This now works as expected.