diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 563bfc7..64ab705 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -173,7 +173,7 @@ function path_form_element_validate($element, &$form_state, $complete_form) {
     $query->addExpression('1');
     $query->range(0, 1);
     if ($query->execute()->fetchField()) {
-      form_set_error('alias', t('The alias is already in use.'));
+      form_error($element, t('The alias is already in use.'));
     }
   }
 }
