• Hi there,

    I recently experienced the following scenarion:

    1. Activate a random plugin
    2. Change the menus/rename the menus specific to the activated plugin with Admin Menu Editor. Press Save.
    3. Deactivate that plugin again.
    4. Go back to Admin Menu Editor and press Save.
    5. Activate the previous plugin again.
    6. Now, all changes and renames to that specific plugin are gone/reset.

    Is this behaviour a feature or a bug? Why Admin Menu Editor is not saving the changes done to a plugin permanently even a plugin was deactivated for some time?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Janis Elsts

    (@whiteshadow)

    That is expected behaviour. When you open the menu editor, the plugin automatically removes any menu items that no longer exist from the menu configuration. If you then save the modified configuration, any settings associated with those items will be lost.

    In principle, Admin Menu Editor could have been designed to leave those stale/missing items in the menu configuration. However, users would then have to manually clean up the menu whenever they stop using a plugin or install an update that removes a menu item, which is inconvenient.

    While the current implementation has some obvious downsides, I think overall it’s better than the alternative.

    Thread Starter auditt

    (@auditt)

    Thank you for the clarification. Could you provide a hook to disable this default behavior? I appreciate that plugin-specific menu items disappear when the plugin is deactivated and reappear upon activation. That’s how it should work and that’s how you should keep it.

    But on top, in some instances, after deactivating a plugin, I go to Menu Editor, make changes to other menus, and forget about the deactivated plugin. After saving, the changes are lost, and I have to start over. I just want to keep the configuration for disabled plugins permanently. Maybe a hook or option from your side could do some magic?

    Thank you.

    Plugin Author Janis Elsts

    (@whiteshadow)

    Unfortunately, the underlying implementation is not completely trivial. For example, the “editor” part of Admin Menu Editor is designed with the assumption that every non-custom menu item has an associated “template” that is the original, unmodified item. This is used for item defaults and such. If the original item no longer exists, that logic doesn’t work.

    If I were to add a hook or option that simply turns off the “remove missing items” behaviour, the menu editor would probably crash and become unusable. To do it right, it would be necessary to review and redesign a bunch of the code. I don’t think I’m up for that right now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sometimes changes get lost’ is closed to new replies.