diff --git a/modules/path/path.module b/modules/path/path.module index 36a975de0c90098114e04713b5a3d3bec1c73e91..91abb44d2b823b4c428cf45fc602832f9f5cf79b 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -130,9 +130,11 @@ function path_nodeapi(&$node, $op, $arg) { $language = isset($node->language) ? $node->language : ''; switch ($op) { case 'validate': - $node->path = trim($node->path); - if (db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s' AND src != '%s' AND language = '%s'", $node->path, "node/$node->nid", $language))) { - form_set_error('path', t('The path is already in use.')); + if (isset($node->path)) { + $node->path = trim($node->path); + if (db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s' AND src != '%s' AND language = '%s'", $node->path, "node/$node->nid", $language))) { + form_set_error('path', t('The path is already in use.')); + } } break;