Losing menu contents when renaming a custom menu
-
I have this strangest problem where renaming a menu will erase all of its contents. This happens on every site on my network, even on newly created sites. This network is an old WP-MU installation that has been migrated to WP 3.0 and kept updated since then.
I’ve noticed the issue several months ago (at least since WP 3.8, but it may be actually older than that) and at first I thought it could be a WP bug. Since I couldn’t find anything about it on the web, I suspect it’s something wrong with my installation, so I’m calling for help! ??
I’ve done some testing and checked the database after each step, and I believe the problem is that the term_id of the menu changes after I rename it (not sure if that’s normal behavior). I still see the lost menu items in the wp_xxx_posts table, but the relations in wp_xxx_term_relationships are gone.
Anyways, I just updated to WP 4.1 and here’s the step-by-step testing procedure I performed:
- Disabled all network plugins and mu-plugins;
- Created a new site on the network;
- Switched to the new site’s dashboard;
- Created a new menu;
- Checked database, table wp_xxx_terms: term_id = 40318 for the newly created menu;
- Added a test page and a custom link to the menu and saved it;
- Checked database, term_id still = 40318;
- Renamed the menu and saved it – when page reloads, the menu is empty;
- Checked database, term_id is now 85432 for the new menu name, term_id is updated accordingly in wp_xxx_term_taxonomy, but relations are deleted from wp_xxx_term_relationships.
It’s also interesting to notice that, in table wp_xxx_terms, the term_id for the default post category is 18, instead of the usual 1. This is for every site created after 2010, which was probably when we migrated from WP-MU to WP 3.0.
Is it possible that some problem in my taxonomies is causing the issue with the menus? If so, what should I look for to try and fix this?
Any help would be greatly appreciated! Thanks in advance!
- The topic ‘Losing menu contents when renaming a custom menu’ is closed to new replies.