Problem/Motivation

The API documentation for hook_pathauto_pattern_alter() is incorrect.

Proposed resolution

Update the documentation.

Remaining tasks

Review patch, commit.

User interface changes

None.

API changes

Nope.

Data model changes

Nada.

Comments

ultimike created an issue. See original summary.

LpSolit’s picture

Status: Active » Needs review
Berdir’s picture

Do we even invoke the hook at the moment? There's another issue about hooks not being invoked..

FeyP’s picture

Status: Needs review » Needs work

Thanks for your patch. I'll set it back to needs work. The updated example looks good at a first glance (didn't test it), but while you're at it, the DocBlock of the hook should also be updated. E.g. the $pattern parameter is no longer a string, but a \Drupal\pathauto\PathautoPatternInterface and there might as well be changes in the context variable.

> Do we even invoke the hook at the moment? There's another issue about hooks not being invoked..

It has been a few days, so it might have been fixed in the meantime. From looking at the source code, the hook is indeed invoked in \Drupal\pathauto\PathautoGenerator::createEntityAlias(), although there is a // @todo Is still hook still useful? directly above it.

Spurlos’s picture

I have updated the patch to mention PathautoPatternInterface usage.

gaurav.kapoor’s picture

Status: Needs work » Needs review