• Hi! I encountered fatal error – plugin conflict between Avada theme and Ultimate member – when you go to the menu section it says: critical issue has occured.

    Here’s info from Query Monitor about the exact error:
    Fatal error: Uncaught Error: Too few arguments to function um\admin\core\Admin_Navmenu::wp_nav_menu_item_custom_fields(), 4 passed in /home/admin/public_html/wp-includes/class-wp-hook.php on line 287 and exactly 5 expected
    in /home/admin/public_html/wp-content/plugins/ultimate-member/includes/admin/core/class-admin-navmenu.php on line 58

    Стек вызовов:

    um\a\c\Admin_Navmenu::wp_nav_menu_item_custom_fields()
    wp-includes/class-wp-hook.php:287
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:478
    do_action()
    wp-content/themes/Avada/includes/class-avada-nav-walker-megamenu.php:215
    Avada_Nav_Walker_Megamenu::start_el()
    wp-includes/class-wp-walker.php:144
    Walker::display_element()
    wp-includes/class-wp-walker.php:244
    Walker::walk()
    wp-includes/nav-menu-template.php:584
    walk_nav_menu_tree()
    wp-admin/includes/nav-menu.php:1077
    wp_get_nav_menu_to_edit()
    wp-admin/nav-menus.php:512
    Query Monitor

Viewing 15 replies - 1 through 15 (of 36 total)
  • Thread Starter bobotton

    (@bobotton)

    Deactivating plugin brings things back to normal – I can go to the Edit menu page and it displays correctly

    • This reply was modified 4 years, 9 months ago by bobotton.

    Have the same issue!

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi guys,

    Please check this line in your theme
    wp-content/themes/Avada/includes/class-avada-nav-walker-megamenu.php:215

    There is the same issue with Enfold theme and all themes which use MegaMenu PHP library. WP native hook contains 5 arguments here:

    wp-admin/includes/class-walker-nav-menu-edit.php

    do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args, $id );

    But MegaMenu library uses the same hook 'wp_nav_menu_item_custom_fields' but with 4 arguments only.

    do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );

    It looks as a conflict of MegaMenu and WP >= 5.4

    There is $current_object_id argument in start_el() function, please add it to this line:

    do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args, $current_object_id );

    To make your MegaMenu themes compatible

    Let me know how it works,
    Thanks!

    Thread Starter bobotton

    (@bobotton)

    Hi!

    Tried to edit the file wp-admin/includes/class-walker-nav-menu-edit.php
    and added the argument $current_object_id as suggested (see screenshot).

    However, after I activate the plugin the fatal error is displayed.

    I’ve submitted support ticket # 338254 to Avada Theme Fusion support and referenced this thread in the ticket. I’ll report back if they respond.

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @larrydaniele @bobotton @gooddane

    For the Avada theme you could try $id instead of $current_object_id. It looks that the megamenu class is different for different themes. My answer above was about the Enfold theme.

    Let me know how it works,
    Best Regards

    I can verify that adding “$id” as described above works around the problem with the current Avada 6.2.3 theme.

    Also, just for documentation, here’s the WordPress Code Reference information about the wp_nav_menu_item_custom_fields action.

    • This reply was modified 4 years, 8 months ago by Larry Daniele.

    I got this response from Avada Support:

    Thanks for letting us know, I have opened a to-do list item for this in our log and our developers will look into this. This will probably be fixed in the Avada 7.0 version that is under development phase right now. However there is no exact date of release at the moment. If you need the fix for it then please reply back with WordPress login of the website.

    One more update from Avada Support:

    Yes, that ID is being added to the nav walker in our theme. Glad to hear you were able to do it to resolve it.

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @larrydaniele

    Thanks for letting us know!

    Best Regards

    Thread Starter bobotton

    (@bobotton)

    Hi, guys!

    Thanks for information.
    I tried to change the parameter to $id but it did not work for me. Avada 6.2.3
    Still have to disable the Ultimate Member plugin to get things going.
    Any ideas what else is possible as a solution?

    Hi, I’m using the theme “customify” and dont have a megamenu plugin or in the theme, and UM not working. Rolled back to previous version and it works, so for now I will keep using the older version.

    I’m using Enfold 4.7.4. It already has the 5 arguments listed above in wp-admin/includes/class-walker-nav-menu-edit.php.

    do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args, $id );

    I did try changing $id to $current_object_id with no effect. I can roll back to the previous version of UM, but this is a client development site that I’m almost ready to migrate to their live server. I’d prefer not to give them outdated plugins at the start.

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @bwyderko

    If you have PHP fatal error at your Appearance > Menus screen, could you provide the error log? Maybe there is another issue or conflict with another plugin on your website?

    Let me know,
    Thanks!

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @gooddane

    Do you have the PHP fatal error when the latest 2.1.6 UM version is active? Could you share the error log?

    Let me know,
    Thanks!

Viewing 15 replies - 1 through 15 (of 36 total)
  • The topic ‘Fatal error when going to Menu’ is closed to new replies.