Unidentified Index

Created on 23 August 2018, almost 7 years ago
Updated 16 July 2025, 2 days ago

Hi,

When creating new nodes that are not using the module's features, the following errors are generated:

Notice: Undefined index: comma-news_item in node_title_validation_node_validate() (line 64 of /host/sageagedev_q7f/docroot/sites/all/modules/node_title_validation/node_title_validation.module).

Notice: Undefined index: unique-news_item in node_title_validation_node_validate() (line 118 of /host/sageagedev_q7f/docroot/sites/all/modules/node_title_validation/node_title_validation.module).

I was able to chase down the errors (this helped: https://www.drupal.org/project/node_title_validation/issues/2954248 β†’ ) and do a check to make sure that the variables are set before executing:

if (!empty($node_title_validation_config['comma-' . $node->type])) {
      $exclude_comma[] = ',';
    }
if (!empty($node_title_validation_config['unique-' . $node->type])) {
		$unique = $node_title_validation_config['unique-' . $node->type] || $node_title_validation_config['unique'];

		$found_node_with_title = _node_title_validation_find_title_exist($node->title, $node->nid);

		if ($unique && $found_node_with_title) {
			form_set_error('title', t("There is already a node exist with title -  @title", array('@title' => $node->title)));
		}
	}

and it seems to work so far. Still, I thought I would share the issue.

Thanks.

πŸ› Bug report
Status

Closed: outdated

Version

1.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024