Skip Navigation

[Resolved] Recursive error loop looking for "dd-layouts-cells"

This support ticket is created 7 years, 10 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
- 9:00 – 10:00 - - - - -
- - - - - - -

Supporter timezone: Africa/Cairo (GMT+02:00)

This topic contains 7 replies, has 3 voices.

Last updated by mikes-23 7 years, 9 months ago.

Assisted by: Mohammed.

Author
Posts
#425034

I created this thread before and marked it resolved but it's happening again:
https://toolset.com/forums/topic/toolset-starter-theme-generates-thousands-of-errors-filling-up-server/

When I activate a child theme it goes into a recursive loop looking for directory "dd-layouts-cells" as you can see below:

hidden link

Same happens with xdebug disabled:

hidden link

The debug log fills up the servers storage im minutes. The "dd-layouts-cells" folder is just an empty folder.

I am not sure if this is a permissions error, I am not exactly sure the purpose of this directory and what is meant to be here and why it is recursively looking for it and failing to find it. I also do not know why it just starts happening.

I did a "sudo chown -R www-data:www-data themes/" to ensure all had write permission and the directory permission is set to 775 anyway so I can upload from my ftp user.

Why is this happening? I have never had this problem before with any wordpress theme.

#425055

It seems to happen when I upload from phpstorm.

If I upload the plugin using filezilla then it works fine.

If I upload the plugin from phpstorm then I get this error loop.

If I upload the plugin from my phpstorm project directory using filezilla the error comes still.

I guess phpstorm is changing some line break or something maybe? I have never had this issue with any other code. I use phpstorm to develop in and it auto uploads when I make a change so I really need this to work. The weir thing is that this issue only seems to happen on activation.

I can upload, activate then re-upload with phpstorm fine but if I deactivate then reactivate ill get this error.

#425074

I deleted this code and the errors go away:

if ( defined('WPDDL_VERSION') && !function_exists( 'include_ddl_layouts' ) ) {

	function include_ddl_layouts( $tpls_dir = '' ) {
		$dir_str = dirname( __FILE__ ) . $tpls_dir;
		$dir     = opendir( $dir_str );

		while ( ( $currentFile = readdir( $dir ) ) !== false ) {
			if ( is_file( $dir_str . $currentFile ) ) {
				include $dir_str . $currentFile;
			}
		}
		closedir( $dir );
	}

	include_ddl_layouts( '/dd-layouts-cells/' );
}

I assume this code is needed for something. Can anyone help me?

#425090

OK, I figured out what is going on. PHPStorm does not upload empty directories so "dd-layouts-cells' is not uploaded but it does get uploaded by filezilla which is why it worked then.

At some point my local project got synced with server so these folder got completely deleted from my local file system.

The loop in the functions php file is badly coded. It literally brings my entire server down if the directory is not present. I feel this should be refactored to test directory exists, then count the files and iterate over the exact number of files so this kind of this doesn't happen.

What is this directory for anyway?

#425216

Hello,

I'm sorry for the big delay, we are out of people today. This directory should be used to store custom Layouts Cells, so if you decide to create custom cells for Layouts you can store the files inside of this folder and they will be automatically included into functions.php. I do agree that it is badly coded, we shouldn't open the folders before checking the existence of it.

https://toolset.com/documentation/user-guides/creating-custom-cells-unique-functionality/

Please let me know if you are satisfied with my reply and any other questions you may have.

Regards,

Adriano Ferreira

#425277

I updated code to this:

	if ( file_exists( __FILE__ . 'dd-layouts-cells/'))
	{
		include_ddl_layouts( '/dd-layouts-cells/' );
	}

Not sure if you reference it in other places?

Custom cells look interesting. Is there any marketplace where I can get premade toolset addons?

#427896

Hello,

I’m Mohammed: the Toolset support team leader. I’ll give my best to help you to achieve your needs through Toolset components.

We only host our products on our downloads page : wp-types.com/account/downloads/ and the WordPress repository: https://wordpress.org/plugins/

There you will find all our plugins.

Thanks.

#428101

ok

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.