I have 2 types of users - Admin and Contributor (with most privileges turned off for Contributor).
For the Contributor I use remove_menu_page() WordPress function to hide unnecessary menu items. This works fine when the Contributor logs in and looks around, but as soon as they try to export their data they get this error inside the remove_menu_page() code:
Warning: Invalid argument supplied for foreach() in /home/content/68/4872368/html/wp-admin/includes/plugin.php on line 1286
This error doesn't happen from the administrator's id which does not use remove_menu_page(). I can export no problem under administrator userid.
I am calling the remove_menu_page function during the admin_init action. It looks like maybe this action is being triggered a 2nd time during export and that is why the menu's do not exist that 2nd time to be removed. Or... is this just a permission issue that I need some extra roles set up for the Contributor??