diff --git a/core/lib/Drupal/Core/Path/Path.php b/core/lib/Drupal/Core/Path/Path.php index 731daf0..92ad8c6 100644 --- a/core/lib/Drupal/Core/Path/Path.php +++ b/core/lib/Drupal/Core/Path/Path.php @@ -92,7 +92,7 @@ public function save($source, $alias, $langcode = Language::LANGCODE_NOT_SPECIFI $operation = 'update'; } if ($pid) { - $this->moduleHandler->invokeAll('path_' . $operation, $fields); + $this->moduleHandler->invokeAll('path_' . $operation, array($fields)); return $fields; } return FALSE; @@ -136,7 +136,7 @@ public function delete($conditions) { $query->condition($field, $value); } $deleted = $query->execute(); - $this->moduleHandler->invokeAll('path_delete', $path); + $this->moduleHandler->invokeAll('path_delete', array($path)); return $deleted; } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php index 18f13ba..95c9a30 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php @@ -105,6 +105,8 @@ function testLookupPath() { 'langcode' => 'en', ); $pathObject->save($path['source'], $path['alias'], $path['langcode']); + // Hook that clears cache is not executed with unit tests. + $aliasManager->cacheClear(); $this->assertEqual($aliasManager->getPathAlias($path['source']), $path['alias'], 'English alias overrides language-neutral alias.'); $this->assertEqual($aliasManager->getSystemPath($path['alias']), $path['source'], 'English source overrides language-neutral source.'); @@ -135,17 +137,23 @@ function testLookupPath() { 'langcode' => 'en', ); $pathObject->save($path['source'], $path['alias'], $path['langcode']); + // Hook that clears cache is not executed with unit tests. + $aliasManager->cacheClear(); $this->assertEqual($aliasManager->getPathAlias($path['source']), $path['alias'], 'Recently created English alias returned.'); $this->assertEqual($aliasManager->getSystemPath($path['alias']), $path['source'], 'Recently created English source returned.'); // Remove the English aliases, which should cause a fallback to the most // recently created language-neutral alias, 'bar'. $pathObject->delete(array('langcode' => 'en')); + // Hook that clears cache is not executed with unit tests. + $aliasManager->cacheClear(); $this->assertEqual($aliasManager->getPathAlias($path['source']), 'bar', 'Path lookup falls back to recently created language-neutral alias.'); // Test the situation where the alias and language are the same, but // the source differs. The newer alias record should be returned. $pathObject->save('user/2', 'bar'); + // Hook that clears cache is not executed with unit tests. + $aliasManager->cacheClear(); $this->assertEqual($aliasManager->getSystemPath('bar'), 'user/2', 'Newer alias record is returned when comparing two Language::LANGCODE_NOT_SPECIFIED paths with the same alias.'); }