1

When create custom content type through UI or programmatically in Drupal 7, there is no link is listed in the Content > Add content.

I was creating the content types without any trouble, but now it is created(succes message is showing) when I check them in the node_type table but not lising in the admin/structure/types.

But no content type is listing(not any links showing) in the Content > Add content, or Structure > Content type administration menu.

Here is the code that allows users to access node pages:

/*
 * Allow users to view the contents
 */
function mymodule_node_access_records($node){
    $grants = array();
    $grants[] = array(
        'realm' => 'example_realm',
        'gid' => 123,
        'grant_view' => 1,


  'grant_update' => 0,
    'grant_delete' => 0,
    'priority' => 0,
);
return $grants;
}


/**
 * Implements hook_node_grants().
 */
function mymodule_node_grants($account, $op){
    $grants = array();
    if ($op == 'view') {
        $grants['example_realm'] = array(
            123,
        );
    }
    return $grants;
}

Then I rebuild permissions using Content Access module.

  • Iv'e only had this issue right after I create one and a page refresh fixes it. Could it be perms perhaps? – sareed Jan 6 '15 at 15:07
  • have you emptied the cache ? – rtome Jan 6 '15 at 15:12
  • I am hanging with this for 5hrs(min). It would not be that easy to count the cache operations. @rtome: Thank you for your comment anyway. – Ataboy Josef Jan 6 '15 at 15:23
  • are you using any cache other than default core cache? Say Authcache or Memcache. – hkoosha Jan 6 '15 at 16:11
  • also manually check this path, is it a 404? 403? 500? yourdomain.com/node/add/MACHINE_NAME where MACHINE_NAME is the machine name (doh!) of the node type you created. – hkoosha Jan 6 '15 at 16:12
2
  1. Check the permission for node creation of that type in admin/people/permissions
  2. Clear all caches and retry and it should be OK
  • May be you are getting to the point. But how is it possible to -"check the permission for node creation of that type", when I am going to create a new type? – Ataboy Josef Jan 6 '15 at 15:28
  • @usermesam0023 check the permission of the one you already created but has disappeared. It's listed in the permissions list as 'create new node of type XYZ'. – hkoosha Jan 6 '15 at 16:09
  • Also, try to access directly this link node/add/your-new-type – Nabil SADKI Jan 6 '15 at 16:28
  • @nabil: I have posted this question after I tried all these possibilities. When I go this path: I get the same 'Add Content' form. – Ataboy Josef Jan 6 '15 at 16:43
  • Now I am running the site with the single 'Administrator'(allowed all permissions) and other users(anonymous). I have allowed these anonymous users to access all my node contents. Now I am going to add this code to my question. – Ataboy Josef Jan 6 '15 at 16:48

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.