Turning errors logging and display to "ALL" allows the following errors to be seen on /admin/content:

Notice: Undefined index: in node_admin_nodes() (line 459 of /www/modules/node/node.admin.inc).
Notice: Undefined index: in node_admin_nodes() (line 476 of /www/modules/node/node.admin.inc).
Notice: Trying to get property of non-object in node_admin_nodes() (line 476 of /www/modules/node/node.admin.inc).

CommentFileSizeAuthor
#1 752486_1_admin_content_produces_php_warnings.patch1.14 KBAnonymous (not verified)

Comments

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.14 KB
dumbkid831’s picture

Stu-Druwser’s picture

Don't ask me how; but after applying this patch to my new D7 dev version I get these errors in my reports area and my site runs reaaalllll sloowwww. I get a lot of these, on every menu click.

Type cron
Date Friday, April 16, 2010 - 15:55
User Anonymous (not verified)
Location http://localhost/drupal-7.0/admin/reports?render=overlay
Referrer http://localhost/drupal-7.0/xxxxxxxxxx
Message Cron run exceeded the time limit and was aborted.
Severity warning
Hostname 127.0.0.1

Stu-Druwser’s picture

Never mind, http://drupal.org/node/453286 this was causing it.

JacobSingh’s picture

Status: Needs review » Needs work

This is a subtle logic change. not sure if it matters.

-    $l_options = $node->language != LANGUAGE_NONE ? array('language' => $languages[$node->language]) : array();
+    $l_options = isset($languages[$node->language]) ? array('language' => $languages[$node->language]) : array();

Here you say that if the language is not in $languages then $l_options should be array(). You assume that LANGUAGE_NONE will never be in $languages.

-      $options[$node->nid]['language'] = $node->language == LANGUAGE_NONE ? t('Language neutral') : t($languages[$node->language]->name);
+      $options[$node->nid]['language'] = !isset($languages[$node->language]) || $node->language == LANGUAGE_NONE ? t('Language neutral') : t($languages[$node->language]->name);

In this case, you are checking if it is not in $languages OR it is LANGUAGE_NONE. This assumes that LANGUAGE_NONE can be in $languages.

Which one is it?

I'm more curious why you are getting the notices, as in what is $node->language set to if not set to an existing language or LANGUAGE_NONE. perhaps it is not good to supres them? What if you import some nodes and the language they are set to doesn't exist in your system?

Anonymous’s picture

Status: Needs work » Active

I suppose allowing LANGUAGE_NONE would make more sense, if it appears in the array. At present though, I haven't really noticed this in quite a while. It might still occur, but I haven't seen it appear in the logs for a while. I'm not actually sure that it is still needed. Agree?

gábor hojtsy’s picture

Status: Active » Closed (fixed)

I would agree with Jacob that it is not a good idea to suppress these errors, since they indicate other errors in the system. If the $node is not an object as indicated above, then this is invoked with some bad arguments. If it uses a language code not defined that is another issue again. Since you don't experience this anymore, I think we can just close this out.