X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fpathauto%2Fpathauto.api.php;fp=web%2Fmodules%2Fcontrib%2Fpathauto%2Fpathauto.api.php;h=6595116fd209b01b107fd0c07c2808b957922d40;hp=fc9272f8fd314e16b34114c7dcac82b162be5ae5;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/pathauto/pathauto.api.php b/web/modules/contrib/pathauto/pathauto.api.php index fc9272f8f..6595116fd 100644 --- a/web/modules/contrib/pathauto/pathauto.api.php +++ b/web/modules/contrib/pathauto/pathauto.api.php @@ -93,9 +93,8 @@ function hook_pathauto_is_alias_reserved($alias, $source, $langcode) { * This hook will only be called if a default pattern is configured (on * admin/config/search/path/patterns). * - * @param string $pattern - * The alias pattern for Pathauto to pass to token_replace() to generate the - * URL alias. + * @param \Drupal\pathauto\PathautoPatternInterface $pattern + * The Pathauto pattern to be used. * @param array $context * An associative array of additional options, with the following elements: * - 'module': The module or entity type being aliased. @@ -103,14 +102,14 @@ function hook_pathauto_is_alias_reserved($alias, $source, $langcode) { * aliased. Can be either 'insert', 'update', 'return', or 'bulkupdate'. * - 'source': A string of the source path for the alias (e.g. 'node/1'). * - 'data': An array of keyed objects to pass to token_replace(). - * - 'type': The sub-type or bundle of the object being aliased. + * - 'bundle': The sub-type or bundle of the object being aliased. * - 'language': A string of the language code for the alias (e.g. 'en'). * This can be altered by reference. */ -function hook_pathauto_pattern_alter(&$pattern, array $context) { +function hook_pathauto_pattern_alter(\Drupal\pathauto\PathautoPatternInterface $pattern, array $context) { // Switch out any [node:created:*] tokens with [node:updated:*] on update. if ($context['module'] == 'node' && ($context['op'] == 'update')) { - $pattern = preg_replace('/\[node:created(\:[^]]*)?\]/', '[node:updated$1]', $pattern); + $pattern->setPattern(preg_replace('/\[node:created(\:[^]]*)?\]/', '[node:updated$1]', $pattern->getPattern())); } } @@ -133,7 +132,7 @@ function hook_pathauto_pattern_alter(&$pattern, array $context) { * - 'pattern': A string of the pattern used for aliasing the object. */ function hook_pathauto_alias_alter(&$alias, array &$context) { - // Add a suffix so that all aliases get saved as 'content/my-title.html' + // Add a suffix so that all aliases get saved as 'content/my-title.html'. $alias .= '.html'; // Force all aliases to be saved as language neutral. @@ -143,7 +142,7 @@ function hook_pathauto_alias_alter(&$alias, array &$context) { /** * Alter the list of punctuation characters for Pathauto control. * - * @param $punctuation + * @param array $punctuation * An array of punctuation to be controlled by Pathauto during replacement * keyed by punctuation name. Each punctuation record should be an array * with the following key/value pairs: