diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-06-21 18:22:38 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-06-21 18:22:38 +0000 |
commit | f771318c515dfb5fa7ed15d0c931ee757414b3a4 (patch) | |
tree | 3a1cf34f0c1799390d3825f5c6b744c75c8f3330 /modules/path | |
parent | a429a6f072bbeea73aee03b41c5396388991d2fc (diff) | |
download | brdo-f771318c515dfb5fa7ed15d0c931ee757414b3a4.tar.gz brdo-f771318c515dfb5fa7ed15d0c931ee757414b3a4.tar.bz2 |
- Patch #254553 by aclight: fixed E_NOTICE.
Diffstat (limited to 'modules/path')
-rw-r--r-- | modules/path/path.module | 8 |
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; |