Skip Navigation

[Resolved] Slow loading

This thread is resolved. Here is a description of the problem and solution.

Problem: Looping over repeating image field generates n^2 calls to Toolset_Utils::get_attachment_id_by_url

Solution: Update to the latest version of Types.

This support ticket is created 6 years, 4 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.

Our next available supporter will start replying to tickets in about 0.88 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 19 replies, has 4 voices.

Last updated by Timothy 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1129249

Nothing to share at this time, I'll update the ticket to note that multiple Users have commented about the same issue.

#1132065

Just FYI.... We made a quickfix/work around with a shortcode, instead of the [wpv-for-each field] solution:

add_shortcode("show_toolset_images", "get_toolset_images");
function get_toolset_images() {
	$smallImages = explode("<em><u>hidden link</u></em>", types_render_field("woning-galerijfotos", array("size" => "thumbnail", "url" => true)));
	$largeImages = explode("<em><u>hidden link</u></em>", types_render_field("woning-galerijfotos", array("size" => "large", "url" => true)));

	array_shift($smallImages);
	array_shift($largeImages);

	$gallery = "";

	foreach($smallImages as $key => $imageUrl) {
		$gallery .= "<a href='<em><u>hidden link</u></em>".$largeImages[$key]."' data-fancybox='images' data-caption='".get_the_title()." ".types_render_field("woning-adres")."'>
			<img src='<em><u>hidden link</u></em>".$imageUrl."' class='imgGallery'>
		</a>";
	}

	return $gallery;
}
#1144469

My developers have assured me this problem will be resolved in Types 3.2. I'll keep you posted here as I receive more information.

#1155510

Types 3.2 has been released, and contains a fix for this issue. Please update to the latest versions of all Toolset plugins and let me know if the problem is not resolved. Thanks!

#1166210

This works, thanks so much!