From 91c666ce2adf16f09dc599165379507946c4b28e Mon Sep 17 00:00:00 2001
From: Jeremy Epstein <jaza@15277.no-reply.drupal.org>
Date: Tue, 1 Dec 2009 23:50:20 +0000
Subject: [PATCH] Clean up some PHP notices in category.module.

---
 category.module | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/category.module b/category.module
index 0eb4afa..898569b 100644
--- a/category.module
+++ b/category.module
@@ -599,6 +599,7 @@ function category_node_form_submit($form, &$form_state) {
 
   // Load the new parent for distant-parent category selection.
   if (!empty($form_state['values']['op'])) {
+    $node = $form['#node'];
     $containers = category_get_containers($node->type);
     $is_valid_submission = FALSE;
     foreach ($containers as $container) {
@@ -1682,8 +1683,8 @@ function category_node_listing($node) {
     }
   }
   else {
-    $category_display = isset($node->category_display['cid']) ? (object) $node->category_display : category_display_get_container($node->category['cnid']);
-    if ($category_display->show_listing) {
+    $category_display = isset($node->category_display['cid']) ? (object) $node->category_display : (!empty($node->category) ?  category_display_get_container($node->category['cnid']) : NULL);
+    if (!empty($category_display) && $category_display->show_listing) {
       if ($is_container) {
         if ($node->category['depth']) {
           $show_nodes = TRUE;
-- 
GitLab