4

I am updating a Drupal/Tripal site on a test system. When I try to add content after migrating core using /#overlay=node/add or /node/add I get:

You have not created any content types yet. Go to the content type creation page to add a new content type.

However, under content types it lists all my content types (page, article, blog, etc). I notice that this looks very similar to No content types showing under 'Add content'

but the accepted answer doesn't help me, because it is not about the state after a d7 update, and I don't know how to apply the steps in a d7 install.

The Navigation contains: Add content Blog entry Book page Forum topic Page Poll RNAi Story

Sub-type links like node/add/page work, still node/add lists no content types.

2 Answers 2

5

I finally managed to fix this by accident while trying to fix a different issue.

Following this post: https://drupal.stackexchange.com/a/82222/25238 Similar to https://www.drupal.org/node/997444

I first tried drush eval 'menu_rebuild();' drush cc menu which didn't have an effect, then I found the hint in a comment by nilsun to the above post, that sometimes a complete reset might be necessary. This seems to be caused by a corrupt menu system.

$drush sqlc
Password for user user:
psql (8.4.20)
Type "help" for help.
## if you want to try to keep your own menus you could
## first try:

DELETE FROM menu_links WHERE module = 'system'; 
# edit: typo, it's module, not menu
## Tested, did keep my custom menus 

## D_ELETE FROM menu_links # Don't this will delete your custom menus too!
DELETE 748
d7=# DELETE FROM menu_router;
DELETE 909
d7=# \q
$ drush updb
No database updates required                                                          [success]
'all' cache was cleared.                                                              [success]
Finished performing updates.                                                          [ok]
$ drush cc menu
'menu' cache was cleared.                                                             [success]
$ drush eval 'menu_rebuild();'
$ drush cc menu
'menu' cache was cleared.                                                             [success]

Maybe one or two steps can be omitted, but that brought back the content types under "Add content", Edit Warning: while some of my self defined menu entries disappeared, but this should be easy to fix editing them manually.

1

If I understand your question correctly, the menu items for your content types are at the same level as the 'Add content' menu item in your menu structure. They should be nested underneath it, like so:

Add content
    Blog entry
    Book page
    Forum topic
    Page 
    Poll
    RNAi
    Story

On a standard Drupal installation, the page where you can rearrange the menu items is /admin/structure/menu/manage/navigation.

7
  • That is correct, I can see and access this hierarchy in the navigation menu, I can also create content using the links, howver noticed the entries are not there, when going to node/add, it still says I have no content types defined. It is maybe a minor glitch but still...
    – Michael
    Feb 6, 2016 at 11:12
  • Have you cleared all your caches and rebuilt your menus? Are there any relevant messages in the error log?
    – Frank H.
    Feb 6, 2016 at 11:16
  • Thank you Frank, I have run drush cc all - drush rr - drush updb, there are no pending db updates. The apache log has no output when reloading node/add. Maybe there is a command to re-build the menu structure?
    – Michael
    Feb 6, 2016 at 11:24
  • A quick way to rebuild the menu structure: install the Devel module, then go to /devel/menu/reset.
    – Frank H.
    Feb 6, 2016 at 11:33
  • The menu router has been rebuilt. unfortunately this has no effect on node/add
    – Michael
    Feb 6, 2016 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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