I got the newest copy from cvs. I installed the new Drupal. I turned on poll or blog or forum module I get the following errors:

* Notice: Trying to get property of non-object in node_list_permissions() (line 3105 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3110 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3111 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3114 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3115 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3118 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3119 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3122 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3123 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3126 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).
* Notice: Trying to get property of non-object in node_list_permissions() (line 3127 of /home/pp/munka/drupal/drupal-cvs/modules/node/node.module).

When i turned on the book module the errors weren't presented.
If I turn off and uninstall the modules and turn on again the bug is sometimes present, sometimes it is not. (I don't understand.) Sometimes I get the following error message(blog, forum, pool and book also):

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3-administer forums' for key 1: INSERT INTO {role_permission} (rid, permission) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => 3 [:db_insert_placeholder_1] => administer forums ) in user_modules_installed() (line 942 of /home/pp/munka/drupal/drupal-cvs/modules/user/user.admin.inc).

pp

Comments

pp’s picture

Title: Error whe turned on form, blog, poll and book module. Node type related module install error. » Node type related module install error. We did not empty the cache somewhere.
Component: node system » base system
Priority: Normal » Critical

I found the bug's source.

The node_list_permissions() function calls node_type_get_type().

$info = node_type_get_type($type);

The info is FALSE. Why?
The node_type_get_type() calls _node_type_build() function. And the $types doesn't contain the poll(or type that the module creates which I turned on):

function _node_types_build() {
  $_node_types = &drupal_static(__FUNCTION__);
  if (is_object($_node_types)) {
    return $_node_types;
  }

The drupal_static() returns back the "wrong object", or we did not empty the cache somewhere.

pp

catch’s picture

Status: Active » Closed (duplicate)