PHP Notice thrown for option – Add "first" and "last" classes to menu items

Tagged: 

Author Posts

quasel

Hi,
If i enable – Add “first” and “last” classes to menu items i get the following notice:

Trying to get property ‘slug’ of non-object

Site runs on php 7.3.18
Call Stack from Query Monitor

    wp-content/plugins/microthemer/tvr-microthemer.php:12134
    tvr_microthemer_frontend->add_first_and_last_classes()
    wp-includes/class-wp-hook.php:289
    apply_filters('nav_menu_css_class')
    wp-content/plugins/bb-plugin/modules/menu/menu.php:640
    FL_Menu_Module_Walker->start_el()
    wp-includes/class-wp-walker.php:144
    Walker->display_element()
    wp-content/plugins/bb-plugin/modules/menu/menu.php:672
    FL_Menu_Module_Walker->display_element()
    wp-includes/class-wp-walker.php:244
    Walker->walk()
    wp-includes/nav-menu-template.php:584
    walk_nav_menu_tree()
    wp-includes/nav-menu-template.php:218
    wp_nav_menu()
    wp-content/plugins/bb-plugin/modules/menu/includes/frontend.php:47
    FLBuilder::render_module()
    wp-content/plugins/bb-plugin/classes/class-fl-builder.php:2460
    FLBuilder::render_modules()
    wp-content/plugins/bb-plugin/includes/column.php:4
    FLBuilder::render_column()
    wp-content/plugins/bb-plugin/includes/column-group.php:7
    FLBuilder::render_column_group()
    wp-content/plugins/bb-plugin/classes/class-fl-builder.php:2462
    FLBuilder::render_modules()
    wp-content/plugins/bb-plugin/includes/column.php:4
    FLBuilder::render_column()
    wp-content/plugins/bb-plugin/includes/column-group.php:7
    FLBuilder::render_column_group()
    wp-content/plugins/bb-plugin/includes/row.php:10
    FLBuilder::render_row()
    wp-content/plugins/bb-plugin/classes/class-fl-builder.php:2048
    FLBuilder::render_rows()
    wp-content/plugins/bb-plugin/classes/class-fl-builder.php:1847
    FLBuilder::render_nodes()
    wp-content/plugins/bb-plugin/classes/class-fl-builder.php:1704
    FLBuilder::render_content_by_id()
    wp-content/plugins/bb-theme-builder/classes/class-fl-theme-builder-layout-renderer.php:381
    FLThemeBuilderLayoutRenderer::render_header()
    wp-includes/class-wp-hook.php:287
    do_action('astra_header')
    wp-content/themes/astra/inc/core/theme-hooks.php:145
    astra_header()
    wp-content/themes/astra/header.php:49
    load_template('wp-content/themes/astra/header.php')
    wp-includes/template.php:672
    locate_template()
    wp-includes/general-template.php:41
    get_header()
    wp-content/themes/astra/page.php:20

Sebastian

Hey,

Thanks for reporting this. I just checked at my end, and didn’t get the same error ($args->menu is a valid object). Would you mind providing me with access to the site via our secure contact form so I can troubleshoot this further? If that’s a problem, I could send you an updated version of Microthemer that I think will handle this without generating an error, it just might involve a bit more toing and froing.

Cheers,
Sebastian

You must login or register to reply to this topic.