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.module10
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/path/path.module b/modules/path/path.module
index 7be86e843..38824dba4 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -196,12 +196,10 @@ function path_nodeapi(&$node, $op, $arg) {
else {
$node->path = trim($node->path);
if ($node->path && !valid_url($node->path)) {
- $error['path'] = t('The path is invalid.');
- return $error;
+ form_set_error('path', t('The path is invalid.'));
}
else if (db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s' AND src != '%s'", $node->path, "node/$node->nid"))) {
- $error['path'] = t('The path is already in use.');
- return $error;
+ form_set_error('path', t('The path is already in use.'));
}
}
break;
@@ -304,8 +302,8 @@ function path_save($edit) {
form_set_error('dst', t('the alias "%dst" is already in use.', array('%dst' => $dst)));
}
- if (form_has_errors()) {
- return path_form($edit, $error);
+ if (form_get_errors()) {
+ return path_form($edit);
}
else {
// Normally, you would use path_set_alias() to update the paths table,