0

I uninstalled several contributed modules of my site and suddenly I lost the permission to access admin/content for user 1.

As far as I know this is not related to any contributed module.

When I try to access this page admin/content I get a message "You are not authorized to visit this page.".

How can I trace this? I run cron, clear caches and even run sites/all/modules/registry_rebuild/registry_rebuild.php to rebuild registry.

Is Drupal7 using the Commerce Kickstart distribution (I disabled all commerce modules)

Update1: I just rebuild permission at: admin/reports/status/rebuild but problem persit.

Also there are these error messages:

Notice: Trying to get property of non-object in user_access() (line 808 of /home/temporal-13/www/modules/user/user.module).
Notice: Trying to get property of non-object in user_access() (line 820 of /home/temporal-13/www/modules/user/user.module).
Notice: Trying to get property of non-object in user_access() (line 821 of /home/temporal-13/www/modules/user/user.module).
Notice: Trying to get property of non-object in user_access() (line 827 of /home/temporal-13/www/modules/user/user.module).
Notice: Trying to get property of non-object in user_access() (line 830 of /home/temporal-13/www/modules/user/user.module).
4

Solved: the problem was the module: admin_views I just disabled it and the problem was gone.

1

I have run into this before, and it is when you have corrupt menu router information. Chances are there is a contributed module improperly running hook_menu_alter. Disable additional contributed modules you have added to your site, one by one, to identify the offending module.

Is Drupal7 using the Commerce Kickstart distribution (I disabled all commerce modules)

Well, that can be problematic. You have altered a Drupal Commerce distribution and disabled the Drupal Commerce modules. Commerce Kickstart 2 makes modifications to the menu for the admin toolbar menu.

Re-enable the Drupal Commerce modules, or use a different distribution, or not one at all.

  • Well it took me around 4 hours to disable all modules. And I have around 60 modules enabled. There should be another way to do this. – JPashs Jan 30 '16 at 15:23
1

In a situation like this I would enable the Devel module to provide me with the menu item so that I can ascertain what is controlling the access.

  1. Install and enable Developer
  2. Go to example.dev/devel/menu/item?path=admin/content
  3. From the returned array check the value of 'access callback' to see which function is responsible for granting access.
0

I am not certain, but it looks like you may have lost access to the admin account? If so, try following the directions in the following Drupal Community Doc about recovering the administrator password: https://www.drupal.org/node/44164

I was personally able to do the first way that's listed there, which is using Drupal Console. Of course, to do that you need command line access to your server, like SSH through PuTTY. If you don't have command line access, then the page about resetting with a sql query has a solution for you about halfway down the page that is under the section header, "Reset using a PHP-file". (Or just go directly to the corresponding page: https://www.drupal.org/node/1556488.)

  • I didn't lost admin access but just access to this url admin/content – JPashs Jan 30 '16 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.