Skip to content

Instantly share code, notes, and snippets.

@chx
Last active December 22, 2018 06:24
Show Gist options
  • Save chx/eb71941faae245bbf7d0f20747551c21 to your computer and use it in GitHub Desktop.
Save chx/eb71941faae245bbf7d0f20747551c21 to your computer and use it in GitHub Desktop.
https://www.drupal.org/node/2342699 sets $pid to 1 on update, corrupting data in hook_path_update
diff --git a/core/lib/Drupal/Core/Path/AliasStorage.php b/core/lib/Drupal/Core/Path/AliasStorage.php
index b68984871..34a8ca381 100644
--- a/core/lib/Drupal/Core/Path/AliasStorage.php
+++ b/core/lib/Drupal/Core/Path/AliasStorage.php
@@ -106,10 +106,10 @@ public function save($source, $alias, $langcode = LanguageInterface::LANGCODE_NO
$this->catchException($e);
$original = FALSE;
}
- $query = $this->connection->update(static::TABLE)
+ $this->connection->update(static::TABLE)
->fields($fields)
- ->condition('pid', $pid);
- $pid = $query->execute();
+ ->condition('pid', $pid)
+ ->execute();
$fields['pid'] = $pid;
$fields['original'] = $original;
$operation = 'update';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment