diff modules/path/path.module @ 7:fff6d4c8c043 6.3

Drupal 6.3
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:30:28 +0100
parents 2427550111ae
children 4347c45bb494
line wrap: on
line diff
--- a/modules/path/path.module	Tue Dec 23 14:30:08 2008 +0100
+++ b/modules/path/path.module	Tue Dec 23 14:30:28 2008 +0100
@@ -1,5 +1,5 @@
 <?php
-// $Id: path.module,v 1.138.2.1 2008/04/09 21:11:48 goba Exp $
+// $Id: path.module,v 1.138.2.2 2008/06/21 18:22:53 dries Exp $
 
 /**
  * @file
@@ -137,9 +137,11 @@
     $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;