Home › Toolset Professional Support › [Resolved] Split: Repeatable regions loop is adding empty items
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.
This topic is split from https://toolset.com/forums/topic/repeatable-regions-loop-is-adding-empty-items/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
Tagged: Views plugin
This topic contains 22 replies, has 2 voices.
Last updated by Shane 5 years, 4 months ago.
Assisted by: Shane.
Ok, brilliant, that fixed it. As I said, this is the first time I am using Repeatable Groups.
I have another issue where I added a second repeatable group to a Post Fields Group when I realised I'd better create a 2nd Fields Group for that new repeatable group, so I deleted that repeatable group from the first Fields Group, created a second Group and inserted the repeatable group again, but the system now says that that slug for the repeatable group has already been used, even though I cannot find that group anywhere.
It is also visible in my View, where "voorgerechten" is the old repeatable group and "voorgerechten2" is the new one. How do I delete the old one?
Hi Kristof,
It seems your RFG has become orphaned.
Could you try deleting the current one with the similar name and see if this causes the old one to disappear?
I did a small test on my end with deleting the RFG and it caused my RFG test to be removed from the view.
Thanks,
Shane
I removed the current RFG and saved the Fields Group. The old RFG is still visible in the View Content Selection.
Hi Kristof,
Could you try using this plugin below to see if will allow you to clear up the orphaned post type ?
https://wordpress.org/plugins/custom-post-type-cleanup/
Thanks
Shane
the plugin did not find any items.
However, via the Custom Fields > Post Field Control, I was able to assign my 4 orphaned fields (as I had to delete the newly created RFB "voorgerechten-new") and now that RFG is visible again in the CFG "Voorgerechten" but they are not inside a repeatable group. When I create "voorgerechten" as RFG, it still says that slug is already taken. That old "ghost" RFB slug "voorgerechten" is still around 'somewhere'.
Hi Kristof,
Perhaps you need to do a manual query of the database for the post type "voorgerechten" and see if any results are returned.
Then delete it from there.
Thanks,
Shane
I must have deleted something critical in the database, because now my Post Field Group is gone 🙁
I recreated the PFG "Voorgerechten" and linked it to "Menus", so far so good.
The I tried to create the Repeatable Group "voorgerechten" but that slug is still already in use, then I tried with "voorgerecht" which was the last one I used and now that one is also already in use.
I'd rather not start using "voorgerechten-2" and so on.
I have found some leftover "voorgerechten" inside the _options table in the wpcf-custom-types option, but that is far too complex to just delete it there.
Hi Kristof,
Could you provide a copy of the site so that I can help better?
This way I can help with the investigation on this issue locally here.
https://toolset.com/faq/provide-supporters-copy-site/
Thanks,
Shane
Hi Kristof,
I've managed to delete it through the database in the wpom_options table under the column wpcf-custom-types.
You can replace the data with this, however you views will lose assignment of their Post Types as well as some data loss may occur that i haven't seen as yet.
a:9:{s:4:"menu";a:27:{s:4:"icon";s:9:"list-view";s:6:"labels";a:13:{s:4:"name";s:5:"Menus";s:13:"singular_name";s:4:"Menu";s:7:"add_new";s:7:"Add New";s:12:"add_new_item";s:10:"Add New %s";s:9:"edit_item";s:7:"Edit %s";s:8:"new_item";s:6:"New %s";s:9:"view_item";s:7:"View %s";s:12:"search_items";s:9:"Search %s";s:9:"not_found";s:11:"No %s found";s:18:"not_found_in_trash";s:20:"No %s found in Trash";s:17:"parent_item_colon";s:11:"Parent text";s:9:"all_items";s:9:"All items";s:16:"enter_title_here";s:16:"Enter title here";}s:4:"slug";s:4:"menu";s:6:"editor";s:7:"classic";s:11:"description";s:0:"";s:6:"public";s:6:"public";s:13:"menu_position";s:0:"";s:8:"supports";a:2:{s:5:"title";s:1:"1";s:6:"editor";s:1:"1";}s:7:"rewrite";a:6:{s:7:"enabled";s:1:"1";s:6:"custom";s:6:"normal";s:4:"slug";s:0:"";s:10:"with_front";s:1:"1";s:5:"feeds";s:1:"1";s:5:"pages";s:1:"1";}s:11:"has_archive";s:1:"1";s:16:"has_archive_slug";s:0:"";s:12:"show_in_menu";s:1:"1";s:17:"show_in_menu_page";s:0:"";s:7:"show_ui";s:1:"1";s:18:"publicly_queryable";s:1:"1";s:10:"can_export";s:1:"1";s:17:"show_in_nav_menus";s:1:"1";s:17:"query_var_enabled";s:1:"1";s:9:"query_var";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:9:"rest_base";s:0:"";s:14:"wpcf-post-type";N;s:8:"_builtin";b:0;s:18:"_toolset_edit_last";i:1562005088;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:0;s:25:"is_intermediary_post_type";b:0;}s:9:"aperitief";a:29:{s:6:"labels";a:13:{s:4:"name";s:9:"Aperitief";s:13:"singular_name";s:9:"Aperitief";s:7:"add_new";s:7:"Add New";s:12:"add_new_item";s:10:"Add New %s";s:9:"edit_item";s:7:"Edit %s";s:8:"new_item";s:6:"New %s";s:9:"view_item";s:7:"View %s";s:12:"search_items";s:9:"Search %s";s:9:"not_found";s:11:"No %s found";s:18:"not_found_in_trash";s:20:"No %s found in Trash";s:17:"parent_item_colon";s:9:"Parent %s";s:9:"menu_name";s:2:"%s";s:9:"all_items";s:2:"%s";}s:4:"slug";s:9:"aperitief";s:11:"description";s:0:"";s:6:"public";b:0;s:12:"capabilities";a:0:{}s:13:"menu_position";N;s:9:"menu_icon";s:0:"";s:10:"taxonomies";a:0:{}s:8:"supports";a:3:{s:10:"post_title";i:1;s:6:"author";i:1;s:13:"custom-fields";i:1;}s:7:"rewrite";a:5:{s:7:"enabled";b:1;s:4:"slug";s:0:"";s:10:"with_front";b:1;s:5:"feeds";b:1;s:5:"pages";b:1;}s:11:"has_archive";b:1;s:7:"show_ui";b:0;s:12:"show_in_menu";b:1;s:17:"show_in_menu_page";s:0:"";s:18:"publicly_queryable";b:0;s:19:"exclude_from_search";b:1;s:12:"hierarchical";b:0;s:17:"query_var_enabled";b:1;s:9:"query_var";s:0:"";s:10:"can_export";b:1;s:12:"show_in_rest";b:0;s:9:"rest_base";s:0:"";s:17:"show_in_nav_menus";b:0;s:20:"register_meta_box_cb";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:6:"update";b:0;s:18:"_toolset_edit_last";i:1562005219;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:1;}{s:7:"enabled";b:1;s:4:"slug";s:0:"";s:10:"with_front";b:1;s:5:"feeds";b:1;s:5:"pages";b:1;}s:11:"has_archive";b:1;s:7:"show_ui";b:0;s:12:"show_in_menu";b:1;s:17:"show_in_menu_page";s:0:"";s:18:"publicly_queryable";b:0;s:19:"exclude_from_search";b:1;s:12:"hierarchical";b:0;s:17:"query_var_enabled";b:1;s:9:"query_var";s:0:"";s:10:"can_export";b:1;s:12:"show_in_rest";b:0;s:9:"rest_base";s:0:"";s:17:"show_in_nav_menus";b:0;s:20:"register_meta_box_cb";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:6:"update";b:0;s:18:"_toolset_edit_last";i:1562157660;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:1;}s:15:"hoofdingredient";a:29:{s:6:"labels";a:13:{s:4:"name";s:16:"Hoofdingrediënt";s:13:"singular_name";s:16:"Hoofdingrediënt";s:7:"add_new";s:7:"Add New";s:12:"add_new_item";s:10:"Add New %s";s:9:"edit_item";s:7:"Edit %s";s:8:"new_item";s:6:"New %s";s:9:"view_item";s:7:"View %s";s:12:"search_items";s:9:"Search %s";s:9:"not_found";s:11:"No %s found";s:18:"not_found_in_trash";s:20:"No %s found in Trash";s:17:"parent_item_colon";s:9:"Parent %s";s:9:"menu_name";s:2:"%s";s:9:"all_items";s:2:"%s";}s:4:"slug";s:15:"hoofdingredient";s:11:"description";s:0:"";s:6:"public";b:0;s:12:"capabilities";a:0:{}s:13:"menu_position";N;s:9:"menu_icon";s:0:"";s:10:"taxonomies";a:0:{}s:8:"supports";a:3:{s:10:"post_title";i:1;s:6:"author";i:1;s:13:"custom-fields";i:1;}s:7:"rewrite";a:5:{s:7:"enabled";b:1;s:4:"slug";s:0:"";s:10:"with_front";b:1;s:5:"feeds";b:1;s:5:"pages";b:1;}s:11:"has_archive";b:1;s:7:"show_ui";b:0;s:12:"show_in_menu";b:1;s:17:"show_in_menu_page";s:0:"";s:18:"publicly_queryable";b:0;s:19:"exclude_from_search";b:1;s:12:"hierarchical";b:0;s:17:"query_var_enabled";b:1;s:9:"query_var";s:0:"";s:10:"can_export";b:1;s:12:"show_in_rest";b:0;s:9:"rest_base";s:0:"";s:17:"show_in_nav_menus";b:0;s:20:"register_meta_box_cb";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:6:"update";b:0;s:18:"_toolset_edit_last";i:1562166504;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:1;}s:12:"bijgerechten";a:29:{s:6:"labels";a:13:{s:4:"name";s:12:"Bijgerechten";s:13:"singular_name";s:12:"Bijgerechten";s:7:"add_new";s:7:"Add New";s:12:"add_new_item";s:10:"Add New %s";s:9:"edit_item";s:7:"Edit %s";s:8:"new_item";s:6:"New %s";s:9:"view_item";s:7:"View %s";s:12:"search_items";s:9:"Search %s";s:9:"not_found";s:11:"No %s found";s:18:"not_found_in_trash";s:20:"No %s found in Trash";s:17:"parent_item_colon";s:9:"Parent %s";s:9:"menu_name";s:2:"%s";s:9:"all_items";s:2:"%s";}s:4:"slug";s:12:"bijgerechten";s:11:"description";s:0:"";s:6:"public";b:0;s:12:"capabilities";a:0:{}s:13:"menu_position";N;s:9:"menu_icon";s:0:"";s:10:"taxonomies";a:0:{}s:8:"supports";a:3:{s:10:"post_title";i:1;s:6:"author";i:1;s:13:"custom-fields";i:1;}s:7:"rewrite";a:5:{s:7:"enabled";b:1;s:4:"slug";s:0:"";s:10:"with_front";b:1;s:5:"feeds";b:1;s:5:"pages";b:1;}s:11:"has_archive";b:1;s:7:"show_ui";b:0;s:12:"show_in_menu";b:1;s:17:"show_in_menu_page";s:0:"";s:18:"publicly_queryable";b:0;s:19:"exclude_from_search";b:1;s:12:"hierarchical";b:0;s:17:"query_var_enabled";b:1;s:9:"query_var";s:0:"";s:10:"can_export";b:1;s:12:"show_in_rest";b:0;s:9:"rest_base";s:0:"";s:17:"show_in_nav_menus";b:0;s:20:"register_meta_box_cb";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:6:"update";b:0;s:18:"_toolset_edit_last";i:1562166599;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:1;}s:7:"dessert";a:29:{s:6:"labels";a:13:{s:4:"name";s:7:"Dessert";s:13:"singular_name";s:7:"Dessert";s:7:"add_new";s:7:"Add New";s:12:"add_new_item";s:10:"Add New %s";s:9:"edit_item";s:7:"Edit %s";s:8:"new_item";s:6:"New %s";s:9:"view_item";s:7:"View %s";s:12:"search_items";s:9:"Search %s";s:9:"not_found";s:11:"No %s found";s:18:"not_found_in_trash";s:20:"No %s found in Trash";s:17:"parent_item_colon";s:9:"Parent %s";s:9:"menu_name";s:2:"%s";s:9:"all_items";s:2:"%s";}s:4:"slug";s:7:"dessert";s:11:"description";s:0:"";s:6:"public";b:0;s:12:"capabilities";a:0:{}s:13:"menu_position";N;s:9:"menu_icon";s:0:"";s:10:"taxonomies";a:0:{}s:8:"supports";a:3:{s:10:"post_title";i:1;s:6:"author";i:1;s:13:"custom-fields";i:1;}s:7:"rewrite";a:5:{s:7:"enabled";b:1;s:4:"slug";s:0:"";s:10:"with_front";b:1;s:5:"feeds";b:1;s:5:"pages";b:1;}s:11:"has_archive";b:1;s:7:"show_ui";b:0;s:12:"show_in_menu";b:1;s:17:"show_in_menu_page";s:0:"";s:18:"publicly_queryable";b:0;s:19:"exclude_from_search";b:1;s:12:"hierarchical";b:0;s:17:"query_var_enabled";b:1;s:9:"query_var";s:0:"";s:10:"can_export";b:1;s:12:"show_in_rest";b:0;s:9:"rest_base";s:0:"";s:17:"show_in_nav_menus";b:0;s:20:"register_meta_box_cb";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:6:"update";b:0;s:18:"_toolset_edit_last";i:1562180372;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:1;}s:11:"voorgerecht";a:29:{s:6:"labels";a:13:{s:4:"name";s:7:"add_new";s:7:"Add New";s:12:"add_new_item";s:10:"Add New %s";s:9:"edit_item";s:7:"Edit %s";s:8:"new_item";s:6:"New %s";s:9:"view_item";s:7:"View %s";s:12:"search_items";s:9:"Search %s";s:9:"not_found";s:11:"No %s found";s:18:"not_found_in_trash";s:20:"No %s found in Trash";s:17:"parent_item_colon";s:9:"Parent %s";s:9:"menu_name";s:2:"%s";s:9:"all_items";s:2:"%s";}s:4:"slug";s:11:"voorgerecht";s:11:"description";s:0:"";s:6:"public";b:0;s:12:"capabilities";a:0:{}s:13:"menu_position";N;s:9:"menu_icon";s:0:"";s:10:"taxonomies";a:0:{}s:8:"supports";a:3:{s:10:"post_title";i:1;s:6:"author";i:1;s:13:"custom-fields";i:1;}s:7:"rewrite";a:5:{s:7:"enabled";b:1;s:4:"slug";s:0:"";s:10:"with_front";b:1;s:5:"feeds";b:1;s:5:"pages";b:1;}s:11:"has_archive";b:1;s:7:"show_ui";b:0;s:12:"show_in_menu";b:1;s:17:"show_in_menu_page";s:0:"";s:18:"publicly_queryable";b:0;s:19:"exclude_from_search";b:1;s:12:"hierarchical";b:0;s:17:"query_var_enabled";b:1;s:9:"query_var";s:0:"";s:10:"can_export";b:1;s:12:"show_in_rest";b:0;s:9:"rest_base";s:0:"";s:17:"show_in_nav_menus";b:0;s:20:"register_meta_box_cb";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:6:"update";b:0;s:18:"_toolset_edit_last";i:1562588875;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:1;}s:18:"voorgerechten-raam";a:29:{s:6:"labels";a:13:{s:4:"name";s:18:"Voorgerechten RAAM";s:13:"singular_name";s:18:"Voorgerechten RAAM";s:7:"add_new";s:7:"Add New";s:12:"add_new_item";s:10:"Add New %s";s:9:"edit_item";s:7:"Edit %s";s:8:"new_item";s:6:"New %s";s:9:"view_item";s:7:"View %s";s:12:"search_items";s:9:"Search %s";s:9:"not_found";s:11:"No %s found";s:18:"not_found_in_trash";s:20:"No %s found in Trash";s:17:"parent_item_colon";s:9:"Parent %s";s:9:"menu_name";s:2:"%s";s:9:"all_items";s:2:"%s";}s:4:"slug";s:18:"voorgerechten-raam";s:11:"description";s:0:"";s:6:"public";b:0;s:12:"capabilities";a:0:{}s:13:"menu_position";N;s:9:"menu_icon";s:0:"";s:10:"taxonomies";a:0:{}s:8:"supports";a:3:{s:10:"post_title";i:1;s:6:"author";i:1;s:13:"custom-fields";i:1;}s:7:"rewrite";a:5:{s:7:"enabled";b:1;s:4:"slug";s:0:"";s:10:"with_front";b:1;s:5:"feeds";b:1;s:5:"pages";b:1;}s:11:"has_archive";b:1;s:7:"show_ui";b:0;s:12:"show_in_menu";b:1;s:17:"show_in_menu_page";s:0:"";s:18:"publicly_queryable";b:0;s:19:"exclude_from_search";b:1;s:12:"hierarchical";b:0;s:17:"query_var_enabled";b:1;s:9:"query_var";s:0:"";s:10:"can_export";b:1;s:12:"show_in_rest";b:0;s:9:"rest_base";s:0:"";s:17:"show_in_nav_menus";b:0;s:20:"register_meta_box_cb";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:6:"update";b:0;s:18:"_toolset_edit_last";i:1562594992;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:1;}s:5:"lunch";a:27:{s:4:"icon";s:9:"list-view";s:6:"labels";a:13:{s:4:"name";s:7:"Lunches";s:13:"singular_name";s:5:"Lunch";s:7:"add_new";s:7:"Add New";s:12:"add_new_item";s:10:"Add New %s";s:9:"edit_item";s:7:"Edit %s";s:8:"new_item";s:6:"New %s";s:9:"view_item";s:7:"View %s";s:12:"search_items";s:9:"Search %s";s:9:"not_found";s:11:"No %s found";s:18:"not_found_in_trash";s:20:"No %s found in Trash";s:17:"parent_item_colon";s:11:"Parent text";s:9:"all_items";s:9:"All items";s:16:"enter_title_here";s:16:"Enter title here";}s:4:"slug";s:5:"lunch";s:6:"editor";s:7:"classic";s:11:"description";s:0:"";s:6:"public";s:6:"public";s:13:"menu_position";s:48:"25--wpcf-add-menu-after--edit.php?post_type=menu";s:8:"supports";a:2:{s:5:"title";s:1:"1";s:6:"editor";s:1:"1";}s:7:"rewrite";a:6:{s:7:"enabled";s:1:"1";s:6:"custom";s:6:"normal";s:4:"slug";s:0:"";s:10:"with_front";s:1:"1";s:5:"feeds";s:1:"1";s:5:"pages";s:1:"1";}s:11:"has_archive";s:1:"1";s:16:"has_archive_slug";s:0:"";s:12:"show_in_menu";s:1:"1";s:17:"show_in_menu_page";s:0:"";s:7:"show_ui";s:1:"1";s:18:"publicly_queryable";s:1:"1";s:10:"can_export";s:1:"1";s:17:"show_in_nav_menus";s:1:"1";s:17:"query_var_enabled";s:1:"1";s:9:"query_var";s:0:"";s:16:"permalink_epmask";s:12:"EP_PERMALINK";s:9:"rest_base";s:0:"";s:14:"wpcf-post-type";N;s:8:"_builtin";b:0;s:18:"_toolset_edit_last";i:1562595971;s:15:"_wpcf_author_id";i:1;s:24:"is_repeating_field_group";b:0;s:25:"is_intermediary_post_type";b:0;}}
Thanks,
Shane
Hi, I tried your code above but now my 2 Custom Post Types are gone and at the top of the admin, I get these errors
Warning: Invalid argument supplied for foreach() in /home/puregrap/public_html/dev/wp-content/plugins/types/application/controllers/utils/post_type_option.php on line 160
Warning: Invalid argument supplied for foreach() in /home/puregrap/public_html/dev/wp-content/plugins/types/application/controllers/utils/post_type_option.php on line 160
Warning: Invalid argument supplied for foreach() in /home/puregrap/public_html/dev/wp-content/plugins/types/application/controllers/utils/post_type_option.php on line 160
Warning: Invalid argument supplied for foreach() in /home/puregrap/public_html/dev/wp-content/plugins/types/application/controllers/utils/post_type_option.php on line 160
Warning: Invalid argument supplied for foreach() in /home/puregrap/public_html/dev/wp-content/plugins/types/application/controllers/utils/post_type_option.php on line 160
Warning: Cannot modify header information - headers already sent by (output started at /home/puregrap/public_html/dev/wp-content/plugins/types/application/controllers/utils/post_type_option.php:160) in /home/puregrap/public_html/dev/wp-admin/includes/misc.php on line 1196
Hi Kristoff,
Did you backup the database before doing this ? Also a mentioned previously some dataloss will occur and you will essentially need to go back and re-assign your views to the correct CPT, same for your custom fields.
Thanks,
Shane
The reason why you are getting these errors is because we deleted the entries in an unsafe manor.
Normally database entries are not deleted like this but because this is a massive array it makes it hard to identify and delete the correct information cleanly.
So there is no safe way to delete these leftover repeatable field group slugs?
Then this is surely a bug in the code when deleting RFG the slug is not removed from the DB.
Hi Kristof,
It could be a one off case, because when I deleted it on my end on a test site it works fine for me. The items are removed correctly.
What I can do for you is to escalate the thread so that our 2nd tier supporters so they can have a look at it for you.
Thanks,
Shane