When I uninstall this module, all of my primary links go away. I was able to reproduce this 3 times.

Comments

Yuki’s picture

Same in here...pls help us..

kevinquillen’s picture

Fortunately I was doing this on a development site with a db backup ready. A very unexpected result- why does it do this?

emptyvoid’s picture

Assigned: Unassigned » emptyvoid

There is an uninstall bug for this module.

I am assuming the links in your primary menu point to nodes yes?
Well currently uninstalling the module clears the node_access table and users loose access to view any content.

Resetting the node_access table to the default value fixes the issue.

Enter a single record into the table that has the following values.

0 0 all 1 0 0

wqmeng’s picture

I have tried the newest 1.8 version, The problem still there, though have reset the node_access table with the default value, while the primary links have been deleted by this module when uninstall it. Could you recheck it? I use the default theme.

bredi’s picture

same here. ouch.

was trying out node access vs content access. still confused by the two btw.

emptyvoid’s picture

Priority: Normal » Critical

Making sure I look into it.. the work around seems to work for me..

When in doubt always make a backup first (yes this is an excuse I will try to get a fix).

perlan’s picture

Title: Uninstall Removes Primary Links » Uninstall Node Access module Removes Primary Links

How can this module be a stable mudule when the effect of uninstalling the module deletes all your primary links?! By uninstalling this module that I don't wish to use anymore I just deleted my hole sites information structure! Many thanks!

Yuki’s picture

No idea I have lost all my data and restored again...without checking properly it should not be listed as a final release.

aaronbauman’s picture

Version: 6.x-1.7 » 6.x-1.8
Anonymous’s picture

Jippi! :)

I think this happening because

$items['node/%node'] on line 116.

Node Access module takes control over node, and when uninstalling Node Access. The core thinks all nodes is Node Access items, and delete those.

Backup!
Uncomment:
/*
$items['node/%node'] = array(
'title callback' => 'node_page_title',
'title arguments' => array(1),
'page callback' => 'node_page_view',
'page arguments' => array(1),
'access callback' => 'node_access_access',
'access arguments' => array('view', 1),
'type' => MENU_CALLBACK,
'file' => 'node.pages.inc',
'file path' => drupal_get_path('module', 'node'),
);
*/

This work for me.

emptyvoid’s picture

Status: Active » Needs work
emptyvoid’s picture

@Touchen I'm a little confused do you mean that you uninstalled the module and uncommented that code block in the hook_menu and everything worked? (scratches head)

casc-or’s picture

Another person here bitten by the uninstall removing all primary links (and a few other things besides it seems - node/add for instance doesn't display any content types to be added, the administration menu is scrambled ...)

Adding the default record into the node_access table does nothing for me - in fact, it's already there.

It's compounded by the fact that my db backup seems to be unrestorable ... not a good day.

Welcome any suggestions on how to rescue this.

I don't follow Touchen's comment above - was this applied after the menus were destroyed to repair them? Where is it applied?

emptyvoid’s picture

So can you log into Drupal and navigation to the admin section?

1) I in the node_access table in the DB check if it is empty if it is add a row (0 0 all 1 0 0)
2) Go to posting settings and rebuild the permissions

blackdog’s picture

Status: Needs work » Active

Indeed #10 works. Do that before you uninstall the module, and all is fine.

Why are you overriding the whole menu item for node/%? It's clearly not the correct way. Content Access module doesn't do it that way, for example.

emptyvoid’s picture

Good catch, perhaps I could explicitly set the access values to the Drupal default before the uninstall completes?

For those reading, if you actually read my module description I recommend using Content Access instead of this module. The module is still available because of legacy requirements for my clients. Also FYI there will not be a D7 release of this module so you have been warned.

http://drupal.org/project/node_access <-- read the description it says it all.

jamesrutherford’s picture

If you are confused by the instructions in #10, here is what worked for me. Make sure Node Access is enabled.

Make a complete backup of your Drupal database. I would advise doing this on a dev server first.

In node_access.module comment out the menu item declaration starting on line 116 ending on 126. Like so:
/*
$items['node/%node'] = array(
'title callback' => 'node_page_title',
'title arguments' => array(1),
'page callback' => 'node_page_view',
'page arguments' => array(1),
'access callback' => 'node_access_access',
'access arguments' => array('view', 1),
'type' => MENU_CALLBACK,
'file' => 'node.pages.inc',
'file path' => drupal_get_path('module', 'node'),
);*/

Go to /admin/content/node-settings and choose rebuild content permissions. Then flush all your caches.

You should now be able to uninstall node access without losing any menu data.

stewart.adam’s picture

This bug can cause serious data loss on production sites if the user isn't aware of this issue and hasn't made a backup before uninstalling the module. It has been known for over two years and the release is still marked as stable.

Maintainer, please mark the release as unsupported!