When viewing "node/1/group" I get

Notice: Undefined index: node in exclude_node_title_preprocess_page() (line 58 of C:\xampp\htdocs\drupal7beta3\sites\all\modules\exclude_node_title\exclude_node_title.module).

exclude_node_title.module

57      // remove title on a per node type basis
58      if (is_object($vars['node'])) {
59        $node_type = $vars['node']->type;
60      }
CommentFileSizeAuthor
#16 undefined_index_notice.patch566 byteskardave
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gabrielu’s picture

Is this related to? http://drupal.org/project/og

bryancasler’s picture

It could be, we can switch the issue assignment if you feel that's the case.

gabrielu’s picture

Status: Active » Needs review

No problem, I think that OG does not export a $vars['node'] variable. So we have to see if we cannot rely on this anymore. Maybe this would be a quick fix (using arg(1) as an alternative):
replace:

      // remove title on a per node type basis
      if (is_object($vars['node'])) {
        $node_type = $vars['node']->type;
      }

with:

      // remove title on a per node type basis
      if (isset($vars['node'] && is_object($vars['node'])) {
        $node_type = $vars['node']->type;
      }
      elseif ( is_numeric( arg(1) ) ) {
        $node = node_load(arg(1);
        $node_type = $node->type;
      }
handokozhang’s picture

I have similar problem, but not related with Organic Groups. Should I add my issue here?

The warning show up if I save Product type content (UberCart) whereas I didn't apply Exclude Node on it. The warning won't show up if I save other type content. I'm using Exclude Node Title 7.x-1.1 and UberCart 7.x-3.0-beta2.

Here is the warning:
Notice: Undefined index: product in exclude_node_title_preprocess_page() (line 67 of /home/xxxxx.com/sites/all/modules/exclude_node_title/exclude_node_title.module)

I can simply ignore the warning because the content is saved correctly. But it's annoying because the warning appear every time saving or trying to edit an UbertCart Product type content.

gabrielu’s picture

This is related to exclude_node_title.module line 67:

      if (!empty($exclude_node_title_content_type) && $exclude_node_title_content_type[$node_type]) {

what if you update the line to:

      if (!empty($exclude_node_title_content_type) && isset($exclude_node_title_content_type[$node_type]) ) {

Let me know,
Gabriel

bryancasler’s picture

Didn't fix it, same error still popping up.

handokozhang’s picture

#5: It works on my problem. I've made some testing and the warning didn't come out. I think it solves my problem.

Thanks Gabriel.

gabrielu’s picture

Status: Needs review » Closed (fixed)

Solved,
Check the new stable release.

Gabriel

handokozhang’s picture

Just downloaded and tested Exclude node title 7.x-1.2, so far it's ok.
Thanks.

LBen’s picture

Version: 7.x-1.x-dev » 7.x-1.3
Status: Closed (fixed) » Active

Getting a similar error message:

Notice: Undefined index: website_technical_notes in exclude_node_title_node_view() (line 88 of /home/clients/websites/w_bda/public_html/bda/sites/all/modules/exclude_node_title/exclude_node_title.module).

The error disappears if I disable "Exclude node title 7.x-1.3" and reappears if I reenable it.

This is after just creating a new content type (ironically) website_technical_notes.

Gaelito’s picture

Hi Guys,

I've got the same issue when adding classes with ubercart. I'm using ubercart 7.x-3.0-beta2 and Exclude node title 7.x-1.3.

This error message appears only with products or product lists from a class content type.
I get the following error message:
Notice: Undefined index: tshirt in exclude_node_title_node_view() (line 88 of /home/.../domains/.../public_html/sites/all/modules/exclude_node_title/exclude_node_title.module).

76  * Implements hook_node_view()
77  */ 
78 function exclude_node_title_node_view($node, $view_mode) {
79  if (variable_get('exclude_node_title_remove_title', 0) == 1 && user_access('use exclude node title')) {
80    if (in_array($node->nid, variable_get('exclude_node_title_nid_list', array()))) {
81      $node->title = '';
82    }
83    else {
84      static $exclude_node_title_content_type; // perform static caching of variable
85      if (!isset($exclude_node_title_content_type)) {
86        $exclude_node_title_content_type = variable_get('exclude_node_title_content_type_values', array());
87      }
88      if ($exclude_node_title_content_type[$node->type]) {
89        $node->title = '';
90      }
91    }
92  }
93 }

I excluded titles only from panels where this products are not displayed. I don't understand why ubercart and ENT are messing together on the node view...
Has anyone any idea about this issue?

Thx

gabrielu’s picture

Try to re-save the configuration page for ENT and see if the problem persists. Maybe it's a Node type that appeared after ENT was configured, and the array $exclude_node_title_content_type doesn't has this index saved.

Let me know,
Gabriel

jeseich’s picture

#12 fixed my problem. I believe Gabriel's right, if you add a new Node type after ENT is initially configured, you have to then go back and save ENT's configure page again.

rachelexodus’s picture

#12 worked for me too- re-saving the ENT configuration.

Babalu’s picture

i got this error with webform module:
Notice: Undefined index: webform in exclude_node_title_node_view() (Zeile 88 von /mnt/webg/c2/79/52907879/htdocs/sites/all/modules/exclude_node_title/exclude_node_title.module).

kardave’s picture

FileSize
566 bytes

I had error in line 88 too. I simply added isset(), see patch.

spainisdifferent’s picture

Assigned: Unassigned » spainisdifferent

#12 solved my problem too (re-saving the ENT configuration). Thanks jeseich

gabrielu’s picture

Status: Active » Closed (fixed)

Should no longer be the case, we switch a bit the behavior in version 1.4, also with better settings.

  • Commit 0012234 on 7.x-1.x, 8.x-1.x by gabrielu:
    Issue #1098018 Undefined index: node in...