Uninstall completely destroys my menu. This POS!

Comments

redijedi’s picture

Title: Uninstall Destroys Menu » Piece of SHIT

It also completely removes the menu admin menu item. WTF!

vm’s picture

testing modules on a test installation is a best practice.
Being more polite typically gets you better responses from the community rather than being obnoxious.

have you tried clearning menu cache tables?
when you uninstalled did you use the uninstall tab?

if your site is borked you can roll back to the backup you took before you deployed this module.

redijedi’s picture

Title: Piece of SHIT » Uninstall Destroys Menu

Polite? Fine. A production release module has a major bug and I'm wrong for being upset. I've manually deleted all content from all the cache tables. And I did run the uninstall. This isn't a small issue. The menu gets completely fubar'd.

vm’s picture

Title: Piece of SHIT » Uninstall Destroys Menu

its a brand new module, it happens. Environments are different.

and the developer warns of this right on the project page:

Please Note!!
Please be advised that there may be issues with the modules if you are attempting to run them on a platform or application version not used in the development and testing. I will do my best to trouble shoot issues with environments that are not setup exactly like that which was used to development the modules.

Therefore if you didn't do, due diligence and test on a test site before installing on a production site .....

You very well may be the first person testing this new module as there is no usuage statistics for it at this time, as it is that new.

redijedi’s picture

You're right. I changed the title, etc. I've settled down. I was very upset at first, but that was not the correct way to deal with it.

I manually went through every menu item and reset it. That seemed to correct it. Having said that, there does seem to be a bug that moves every menu item out of its nesting and puts you in this position when uninstalling.

emptyvoid’s picture

Assigned: Unassigned » emptyvoid

Hmm, I have tested the uninstall process and this never happened before. I will setup a few testing scenarios and try to reproduce the issue. I may be a matter of clearing a value for each menu item during uninstall.

This will be kept open until I can verify the bug.

code-brighton’s picture

WARNING! Couldn't get this module to work, so I uninstalled, I now can't access any content under my primary menu as an unauthorised user, great! No idea why??

code-brighton’s picture

Hmm after a bit of a trawl through the database and with the help of the devel module I found the "node_access" table was empty.
This need to contain at least one row and can be restored using the devel module.

peterconnolly’s picture

There doesn't seem to be much activity on this issue, but last night the same thing happened to me; I uninstalled this module, and lost access to all menus. Big thanks to code-brighton for spotting the node_access table issue, which (thanks to a backup) got me up and running again.

zhahai’s picture

I encountered the same basic problem described in later posts here.

The node title is somewhat misleading - the problem was loss of access to all nodes (for everybody but the admin). The menu items went away as a side effect of the nodes not being accessible.

Also, in my case, the problem did NOT start upon uninstalling. All nodes became inaccessible (except to admin) as I was trying to configure the menu_access module. AFTER that happened, I disabled menu_access and menu_item_access, and uninstalled each - but still no nodes were accessible. Clearing cache also didn't help.

However code-brighton's observation was on the mark - creating that first record in the node_access table restored the site (I used phpmyadmin and just inserted the 0,0,all,1,0,0 basic record I found in my other sites).

This thread MIGHT reference two bugs (menus per se being destroyed on uninstall; node_access record being deleted during menu_access configuration).

I mention all this to help others in finding where that first entry in node_access got deleted - in my case, it didn't happen during uninstall but during configuration. I'm not even sure why table node_access should have been tampered with, as I had installed only module menu_access, not module node_access.

In any case, thanks code-brighton, that saved me some work.

faizwahid’s picture

Version: 6.x-1.0 » 6.x-1.4

I had a similar problem. The moment I enabled this module somehow some links (including Site building>Modules) in the admin navigation were lost.

Clearing the cache, watchdog tables & running upgrade.php didn't work.

On some deeper analysis I found that the table drup_menu_router did not have the necessary routing information. Copying the table content from a default installation worked and I was able to get back the missing menu items.

I'm still not sure what else is lost, so probably I'm going to take a backup of my data and reinstall drupal.

emptyvoid’s picture

Version: 6.x-1.4 » 6.x-1.7

Issue is the uninstall clears the the node_access table it should revert to the default drupal setting.

Need to investigate if this fubars other access modules that use the node_access tables.

emptyvoid’s picture

Status: Active » Needs review

Ok I have reproduced the error.

1) When the modules install three menus are automatically created, "menu access - primary", "menu access - secondary", "menu access - navigation"

2) The installation notes state that you should switch to using the menus with the prefix of "menu access". Doing so means that the security checks will be properly used within the site and your theme.

3) I reproduced the issue by uninstalling the modules without switching back to the default menus from within the block interface for your theme. If you don't switch back to the default Drupal versions of the menu the whole navigation system gets confused and the menus disappear.

Which makes sense because on uninstall all of the menus with the prefix of "menu access" are deleted from the system.

!!! -- Solved -- !!!
So to prevent the system from going crazy you should first switch your menus back to the default Drupal menus then uninstall the modules.

emptyvoid’s picture

On a similar note I am researching using "hook_menu_alter" instead of the totally separate set of menus my goal is to start a Drupal 6 2.0 branch soon and a 1.0 for Drupal 7. So I am researching this alternative that will dynamically apply security to any menu or menu item within the system.

altavis’s picture

I've disabled Access menu blocks, enabled normal ones, uninstalled and all I've got are links out of the menus. Every single navigation link is now in a root menu.

emptyvoid’s picture

Version: 6.x-1.7 » 6.x-1.8

Ok that is really screwed up could you list the other modules you have installed?

krishnaa’s picture

thnaks code-brighton

your suggestion worked great for me.

GeekyLass’s picture

I'm subscribing to this issue as I plan to un-install menu access and until this particular issue is resolved I'll just leave it.

vm’s picture

sounds like what is needed after disabling this module is for the node access table to be reset which can also be done in drupal core in administer -> post settings

GeekyLass’s picture

Does anyone know if this is resolved in the dev version?

aldim’s picture

I had the same problem. In my case I needed to rebuild permissions for users.

Administer -> Post settings -> Rebuild permissions.

Aldim.

ansari.wajid’s picture

Great aldim, Rebuilding permissions worked for me..

Thanks

emptyvoid’s picture

hmm, perhaps I could add the rebuilding of permissions function call on uninstall?

ludo.r’s picture

I confirm, i just had the same issue.

Uninstalling this module just deleted all items from my primary-links menu!

michael.lee.baker@gmail.com’s picture

I had an issue on uninstall where it removed my Primary menu - AND - when I logged out, the default "Welcome to your new drupal website" was the homepage. I noticed the node_access table was now empty so I had to manually insert a row into table "node_access" with the following defaults:

nid = 0
gid = 0
realm = all
grant_view = 1
grant_update =0
grant_delete =0

UPDATE - I just noticed that this table is wiped out when configuring the modules menu settings. Not necessarily on uninstall.

emptyvoid’s picture

#michaelleebaker please provide more information?

Are you saying that when you go to modify the menu settings for a menu that the table looses all records?

It is just related to one menu or all registered menus?

Please provide more information.

int_ua’s picture

Version: 6.x-1.8 » 6.x-1.9

Yes, I have empty node_access after uninstalling 6.x-1.9 too.
But I'm not sure if it was not empty before uninstalling. But it was not empty before adding menu_access module, that's fact.

int_ua’s picture

Skimming through both _uninstall() functions I cannot find anything related.

int_ua’s picture

Reproduced it.
Try to go to /admin/build/menu/menu_access and just save the settings. For me it does purge node_access.

int_ua’s picture

Status: Needs review » Active

I hope you don't mind if I change the status. Right now I have no time for reading code as we have passed the deadline. Will try later.