Skip to content
Snippets Groups Projects
Commit f771318c authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #254553 by aclight: fixed E_NOTICE.

parent a429a6f0
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment