summaryrefslogtreecommitdiff
path: root/modules/path/path.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/path/path.module')
-rw-r--r--modules/path/path.module8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/path/path.module b/modules/path/path.module
index 36a975de0..91abb44d2 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;