diff --git a/core/lib/Drupal/Core/Path/AliasManager.php b/core/lib/Drupal/Core/Path/AliasManager.php index d1e2797..b2d2d7b 100644 --- a/core/lib/Drupal/Core/Path/AliasManager.php +++ b/core/lib/Drupal/Core/Path/AliasManager.php @@ -327,14 +327,8 @@ protected function pathAliasWhitelistRebuild($source = NULL) { * TRUE if alias exists, false otherwise. */ public function checkAliasExists($pid, $alias, $langcode) { - $query = $this->connection->select('url_alias', 'u') - ->fields('u', array('pid')) - ->condition(db_and() - ->condition('pid', $pid, '<>') - ->condition('alias', $alias) - ->condition('langcode', $langcode)) - ->range(0,1); - return (bool) $query->execute()->fetchField(); + $query = 'SELECT pid FROM {url_alias} WHERE pid != :pid AND alias = :alias AND langcode = :langcode LIMIT 1'; + return (bool) $this->connection->query($query, array(':pid' => $pid, ':alias' => $alias, ':langcode' => $langcode))->fetchField(); } } diff --git a/core/modules/path/lib/Drupal/path/Form/EditForm.php b/core/modules/path/lib/Drupal/path/Form/EditForm.php index 782adc2..45b0604 100644 --- a/core/modules/path/lib/Drupal/path/Form/EditForm.php +++ b/core/modules/path/lib/Drupal/path/Form/EditForm.php @@ -75,7 +75,17 @@ public function getFormID() { } /** - * {@inheritdoc} + * Form constructor. + * + * @param array $form + * An associative array containing the structure of the form. + * @param array $form_state + * An associative array containing the current state of the form. + * @param int $pid + * Optional path id. Can be omitted when adding a new path alias. + * + * @return array + * The form structure. */ public function buildForm(array $form, array &$form_state, $pid = NULL) { $path_alias = $this->path->load(array('pid' => $pid)); diff --git a/core/modules/path/lib/Drupal/path/Form/PathAdminFilterForm.php b/core/modules/path/lib/Drupal/path/Form/PathAdminFilterForm.php index 05575cf..793cf93 100644 --- a/core/modules/path/lib/Drupal/path/Form/PathAdminFilterForm.php +++ b/core/modules/path/lib/Drupal/path/Form/PathAdminFilterForm.php @@ -22,7 +22,17 @@ public function getFormID() { } /** - * {@inheritdoc} + * Form constructor. + * + * @param array $form + * An associative array containing the structure of the form. + * @param array $form_state + * An associative array containing the current state of the form. + * @param string $alias + * A string containing a keyword for searching aliases. + * + * @return array + * The form structure. */ public function buildForm(array $form, array &$form_state, $alias = NULL) { $form['#attributes'] = array(