Skip Navigation

[Resolved] Is the maximum number of values for repeating fields 100?

This support ticket is created 2 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.

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
- 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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by shomariM 2 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2442689

Tell us what you are trying to do?
I am trying to insert 100+ values into a repeating field that stores images. I am getting the information from an API. I noticed that any record with more than 100 images does not store any of the images. I am trying to figure out if there is a bug with those particular records or if there is a limit in Toolset. I would expect that if there is a limit, it would stop at 100 instead of not storing anything. I am using add_post_meta to add the images.

if($c == "media") {
$photos_array = $this->handleMedia($prop->media);

if (is_array($photos_array)) { //sanity test to make sure you didn't blow up the array above
// delete existing values
delete_post_meta($post_id, 'wpcf-' . $c);

foreach($photos_array as $single_url) { // break the array down into single entries
// add
add_post_meta($post_id, 'wpcf-' . $c, $single_url, false);
echo " $c - " . $single_url . "\n";
/*
need to rework. see: https://stackoverflow.com/questions/47720297/how-to-update-post-meta-data-with-multiple-values
if($newp) {
add_post_meta($post_id, 'wpcf-' . $c, $single_url, false);
} else {
update_post_meta($post_id, 'wpcf-' . $c, $single_url, false);
}
*/
}
}
}

#2443063

Hi,

Thank you for contacting us and I'd be happy to assist.

There is no hard limit set from Toolset or WordPress over the number of repeating custom field entries that can be saved with a post.

Do you see any error or warning in the server's error logs, when the images are not saved? I'll also recommend checking:

- is there any rate limiting involved from the API that you're using to get those images
- your code is not hitting any time-out or max execution time limits set by your hosting server

regards,
Waqar

#2444327

Thank you. I figure it out. The field in the database that was storing the json data was set to TEXT. With 100+ images, this string was too long for that field type. As a result, when it came time to read the field and add the images to WordPress, the script could not properly parse the incomplete JSON string. Thanks for your help!

#2444659

Thank you for sharing this and glad that this is sorted out.

You're welcome to mark this ticket as resolved and start a new one for each new question or concern.

#2444701

My issue is resolved now. Thank you!