{"id":2489,"date":"2015-05-03T10:51:45","date_gmt":"2015-05-03T09:51:45","guid":{"rendered":"http:\/\/kudzia.eu\/b\/?p=2489"},"modified":"2015-05-03T11:46:13","modified_gmt":"2015-05-03T10:46:13","slug":"wordpress-4-1-x-4-2-x-broke-my-menu-editor","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2015\/05\/wordpress-4-1-x-4-2-x-broke-my-menu-editor\/","title":{"rendered":"upgrade from wordpress 4.1.x to 4.2.x broke my menu editor"},"content":{"rendered":"<p>i&#8217;ve done a routine upgrade of wordpress 4.1.x to 4.2 and later 4.2.1. all seemed fine until the day i wanted to manually adjust the menu structure using wp-admin &gt; appearance &gt; menus. each attempt of saving my menu resulted in it being wiped out completely<br \/>\n<!--more--><\/p>\n<p><a href=\"https:\/\/kudzia.eu\/b\/wp-content\/uploads\/2015\/05\/wp-menu0.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kudzia.eu\/b\/wp-content\/uploads\/2015\/05\/wp-menu0.png\" alt=\"wp-menu0\" width=\"1196\" height=\"1004\" class=\"alignnone size-full wp-image-2494\" srcset=\"https:\/\/kudzia.eu\/b\/wp-content\/uploads\/2015\/05\/wp-menu0.png 1196w, https:\/\/kudzia.eu\/b\/wp-content\/uploads\/2015\/05\/wp-menu0-300x252.png 300w, https:\/\/kudzia.eu\/b\/wp-content\/uploads\/2015\/05\/wp-menu0-1024x860.png 1024w\" sizes=\"auto, (max-width: 1196px) 100vw, 1196px\" \/><\/a><\/p>\n<p>i&#8217;ve started digging into the code and found out that commenting in wp-admin\/nav-menus.php:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$_nav_menu_selected_id = wp_update_nav_menu_object( $nav_menu_selected_id, array( 'menu-name' =&gt; $menu_title ) );\r\n<\/pre>\n<p>would prevent the problem<\/p>\n<p>then deeper into the rabbit&#8217;s hole: wp-includes\/nav-menu.php<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$update_response = wp_update_term( $menu_id, 'nav_menu', $args );\r\n<\/pre>\n<p>and wp-includes\/taxonomy.php<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$_term_id = _split_shared_term( $term_id, $tt_id );\r\n<\/pre>\n<p>so &#8211; we&#8217;re onto something. google gave me: https:\/\/developer.wordpress.org\/plugins\/taxonomy\/working-with-split-terms-in-wp-4-2\/ which mentions splitting of the terms shared for different taxonomies. hm&#8230; what do we have in the wp_term_taxonomy table? oh.. two entries with the same term_id: one with taxonomy=nav_menu, another with taxonomy=category. apparently ages ago i&#8217;ve created a category called also <i>top menu<\/i>, it wasn&#8217;t used anywhere but its mere presence was enough to trigger the problem. i went to wp-admin &gt; posts &gt; categories and deleted the an entry <i>top menu<\/i>. after that i was able to save the menu without hassle again!<\/p>\n<p>i&#8217;ve tried to reproduce this problem on a clean installation of 4.1.4 with the same menu name as category name then upgraded to 4.2.1 but I could not. most probably it&#8217;s some database inconsistency that we&#8217;ve been carrying for a longer time from the earlier versions of wp [initially we\u2019ve started on 3.9.x then 4.0.x, 4.1.x and 4.2.x]. so it&#8217;s not something i can easily report to the wordpress devs. hopefully this entry helps someone encountering similar problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>i&#8217;ve done a routine upgrade of wordpress 4.1.x to 4.2 and later 4.2.1. all seemed fine until the day i wanted to manually adjust the menu structure using wp-admin &gt; appearance &gt; menus. each attempt of saving my menu resulted in it being wiped out completely<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,51],"tags":[79],"class_list":["post-2489","post","type-post","status-publish","format-standard","hentry","category-tech","category-unimportant","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/2489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=2489"}],"version-history":[{"count":9,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/2489\/revisions"}],"predecessor-version":[{"id":2503,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/2489\/revisions\/2503"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=2489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=2489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=2489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}