diff --git a/core/lib/Drupal/Core/Path/Path.php b/core/lib/Drupal/Core/Path/Path.php index a7fd55a..ccbeefe 100644 --- a/core/lib/Drupal/Core/Path/Path.php +++ b/core/lib/Drupal/Core/Path/Path.php @@ -55,15 +55,15 @@ public function __construct(Connection $connection, AliasManager $alias_manager) * @param int $pid * Unique path alias identifier. * - * @return - * FALSE if the path could not be saved or an associative array containing - * the following keys: - * - source: The internal system path. - * - alias: The URL alias. - * - pid: Unique path alias identifier. - * - langcode: The language code of the alias. + * @param array $context + * An arbitrary array to be passed to hook_path_insert() / + * hook_path_update() alongisde of the fields and pid. + * + * @return bool|int + * FALSE if the path could not be saved or the new unique path alias + * identifier. */ - public function save($source, $alias, $langcode = LANGUAGE_NOT_SPECIFIED, $pid = NULL) { + public function save($source, $alias, $langcode = LANGUAGE_NOT_SPECIFIED, $pid = NULL, $context = array()) { $fields = array( 'source' => $source, @@ -91,9 +91,9 @@ public function save($source, $alias, $langcode = LANGUAGE_NOT_SPECIFIED, $pid = } if ($pid) { // @todo Switch to using an event for this instead of a hook. - module_invoke_all($hook, $fields); + module_invoke_all($hook, $fields + $context); $this->alias_manager->cacheClear(); - return $fields; + return $pid; } return FALSE; }