Support » Plugin: One Click Demo Import » Incorrect menu hierarchy

  • Hello,

    First, thanks for this great plugin, we use it in almost a lot of our themes. However, recently we came up with an issue where the menu items hierarchy was all jumbled after import.

    The following assets were used to reproduce this issue, but is not limited to:
    1) Twenty Twenty One theme
    2) One Click Demo Importer plugin (latest)

    This is literally all that is active in the WP installation.

    The content.xml files that we used are our themes’, and just to be sure that it is not an issue from our end, we also used the official WordPress Theme Unit test data content file, which also didn’t work.

    Looking forward to your reply

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter androthemes

    (@androthemes)

    On a side note, the default WordPress importer imports everything perfectly fine regardless of the content file.

    And the testing was done on 2 different servers, one shared, one vps and also tested locally, with WP_DEBUG and WP_DEBUG_LOG turned on, but unfortunately not returning any errors

    On a side note side note (Sorry for all the side notes :D), sometimes the menu items will import random things like attachment file names, 2 examples that happened while we were testing was woocommerce-placeholder, and the log file that is generated by the plugin.

    • This reply was modified 2 months, 2 weeks ago by androthemes.
    • This reply was modified 2 months, 2 weeks ago by androthemes.
    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @androthemes,

    so, this issue is present only for these particular cases? All your other theme’s imports work OK?

    What WP/PHP versions are you using?

    Are you using any special plugins for displaying these menus, or are they default WP menus? What are the menu items that get “jumbled” after import? Are they special custom post type items, some other special items or just normal links to pages/posts?

    Take care!

    Thread Starter androthemes

    (@androthemes)

    Hey Gregor,

    Thanks for reaching out.

    WP: Tried both 5.4.x and 5.6, both no dice
    Php: 7.3.4

    0 plugins (only the importer), default wp twenty twenty theme, and the WordPress theme unit test content, which also doesn’t contain any custom post types. Also the “jumbled” menu items are usually level 2 and above, where they lose their parent and just start acting as level 1 menu items.

    1) No special plugins to display the menus
    2) usually level 2+
    3) just normal links, not custom post types

    This is the link if you want to test it out (WP Theme unit):

    https://raw.githubusercontent.com/WPTT/theme-unit-test/master/themeunittestdata.wordpress.xml

    And yes, the theme is perfectly fine, its just some content files dont work. Now just to give you a reference which isn’t ours, the WP Theme unit test is failing in all themes, whether it was ours, or a 3rd party theme, or even a WP Default theme.

    Cheers

    • This reply was modified 2 months, 1 week ago by androthemes.
    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @androthemes,

    thank you for providing these details. I’ve created a GH issue for this problem and we’ll look into it and fix it for one of the next plugin updates.

    Thank you and have a nice day!

    Thread Starter androthemes

    (@androthemes)

    Thank you 🙂

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @androthemes,

    Sorry for the late reply…

    I’ve been debugging the issues described above and I think I know why some of the menu items are not imported correctly.

    If you look at the Theme Test XML file you will see that there are two menu items with the same guid/post_id: 1643. Those are both menu items, but the first in the XML file is the menu item for the “All Pages Flat” menu and the second one is the menu item for the “All Pages” menu.

    The first menu item with the post ID of 1643 is imported OK, but the second one is skipped because the importer looks at the list of already imported post_ids and it sees that this post was already imported, even though it belongs to another menu item.

    I have no idea how this is possible. Two menu items, belonging to different menus have the same post ID. They do point to the same page (post id: 703, but that is noted in the _menu_item_object_id meta data of the menu item, so the post IDs of the menu items should not be the same).

    I tested: exported full WP content on a couple of WP sites with two menus that have at least one same page menu item in them, and I could not get the menu items that point to the same page to have the same post ID…

    This is really strange. Was there a WP export bug in the previous versions of WP?

    Could you please check your import XML file if yours has the same issue?

    First, do you have multiple menus to import?

    Do these menus use at least one menu item that is pointing to the same page/post?

    In your XML file search for the page (menu item) that is used in multiple menus. Get the post id for this page and search the file for that ID. For the XML <item> where this page ID is found, check if it is a menu item: has nav_menu_item post_type. Check the ID of this menu item. Search for that menu item iD and see if there is another XML item with the same ID.

    Or you can send me your import XML file and I can take a look.

    Let me know how it goes.

    Take care!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.