Title: Cannot Save Menu changes
Last modified: August 30, 2016

---

# Cannot Save Menu changes

 *  [figassis](https://wordpress.org/support/users/figassis/)
 * (@figassis)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-save-menu-changes/)
 * The Save changes button does not work and I get the following stack trace:
 *     ```
       Uncaught TypeError: Unable to convert object of type 'function' to json.
       $.toJSON @ jquery.json.js?ver=1450275256:102
       $.toJSON @ jquery.json.js?ver=1450275256:118
       $.toJSON @ jquery.json.js?ver=1450275256:118
       encodeMenuAsJSON @ menu-editor.js?ver=1450275256:1647
       (anonymous function) @ menu-editor.js?ver=1450275256:4026
       m.event.dispatch @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery…:4
       r.handle @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery…:4
       ```
   
 * [https://wordpress.org/plugins/admin-menu-editor/](https://wordpress.org/plugins/admin-menu-editor/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Janis Elsts](https://wordpress.org/support/users/whiteshadow/)
 * (@whiteshadow)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-save-menu-changes/#post-6857293)
 * I can’t seem to reproduce that error. Are you using the latest version of the
   plugin? Give the [development version](https://downloads.wordpress.org/plugin/admin-menu-editor.zip)
   a try.
 *  Thread Starter [figassis](https://wordpress.org/support/users/figassis/)
 * (@figassis)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-save-menu-changes/#post-6857469)
 * Just tried, issue remains. The error is saying that you cannot convert a function
   to JSON.
 * The stack trace shows that the tree object contains a function when it’s passed
   to the encodeMenuAsJSON function, so the $.toJSON(tree); statement throws an 
   error.
 * If you do a console.log(tree); inside the encodeMenuAsJSON, you’ll see that the
   tree object has a color_presets object containing a function called remove.
 * In the readMenuTreeState function definition, line 1692, if you comment out the
   color presets attribute, the save button works fine.
 * return {
    tree: tree, //color_presets: $.extend(true, {}, colorPresets), granted_capabilities:
   AmeCapabilityManager.getGrantedCapabilities() };
 * This should give a hint on how to solve the issue.
 *  Plugin Author [Janis Elsts](https://wordpress.org/support/users/whiteshadow/)
 * (@whiteshadow)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-save-menu-changes/#post-6857470)
 * > If you do a console.log(tree); inside the encodeMenuAsJSON, you’ll see that
   > the tree object has a color_presets object containing a function called remove.
 * I’ve done that and the `color_presets` object doesn’t have a `remove` function.
   It doesn’t have any functions.
 * Are you sure one of your other plugins isn’t messing with the loaded libraries(
   e.g. by loading an incompatible version of jQuery or Lodash) or adding extra 
   functions to the `Object` prototype? Try temporarily deactivating any plugins
   that add JS to all admin pages and see if the problem goes away.
 *  [serenad12](https://wordpress.org/support/users/serenad12/)
 * (@serenad12)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-save-menu-changes/#post-6857471)
 * i ll use it

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Cannot Save Menu changes’ is closed to new replies.

 * ![](https://ps.w.org/admin-menu-editor/assets/icon-128x128.png?rev=1418604)
 * [Admin Menu Editor](https://wordpress.org/plugins/admin-menu-editor/)
 * [Support Threads](https://wordpress.org/support/plugin/admin-menu-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/admin-menu-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/admin-menu-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/admin-menu-editor/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [serenad12](https://wordpress.org/support/users/serenad12/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-save-menu-changes/#post-6857471)
 * Status: not resolved