Skip Navigation

[Resolved] Error with layouts

This support ticket is created 6 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 3 voices.

Last updated by Beda 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#600939

I noticed a bug in the layouts class.

wpddl.layouts-templates-settings.class.php
LINE 80: list( $type, $my_class ) = explode( '|', $context );

But in my particular case, there is an issue
Notice: Undefined offset: 1 in /wp-content/plugins/layouts/classes-auto/wpddl.layouts-templates-settings.class.php on line 80

Because you need to place your
if ( ! $context ) { return null; }

above your LIST, in my opinion.

What you have:
// Get type {post types, taxonomies, wordpress archives slugs, 404} and class {page, archive}
list( $type, $my_class ) = explode( '|', $context );

$menu_title = $toolsetAdminBar->get_title( 'layouts', true, $type, $my_class, null );
$post_id = null;

if ( ! $context ) {
return null;
}

it SHOULD be:
if ( ! $context ) {
return null;
}

// Get type {post types, taxonomies, wordpress archives slugs, 404} and class {page, archive}
list( $type, $my_class ) = explode( '|', $context );

$menu_title = $toolsetAdminBar->get_title( 'layouts', true, $type, $my_class, null );
$post_id = null;

#601060

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Justin

Your suggestion makes sense to me, but I've passed it to my colleagues for comment and I'll get back to you with their response.

#601168

Great thanks!

#606698

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Justin

The developers reviewed this and made changes based on your comments.

It will be included in the next version of Layouts, but in the meantime if you need to you can apply the fix by unzipping the archive available here hidden link and replacing the same file in the /classes-auto/ directory of the Layouts plugin.

Thanks again for your feedback.

#611853