Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Suggested issue credit
Issue #2692205 by Dinesh18, ultimike, Spurlos, idebr, datvance, junkuncz: Update hook_pathauto_pattern_alter() documentation
Comment | File | Size | Author |
---|---|---|---|
#12 | pathauto-pattern_alter_documentation-2692205-12.patch | 2.2 KB | idebr |
| |||
#12 | interdiff-8-12.txt | 1.89 KB | idebr |
Comments
Comment #2
LpSolit CreditAttribution: LpSolit as a volunteer commentedComment #3
BerdirDo we even invoke the hook at the moment? There's another issue about hooks not being invoked..
Comment #4
FeyP CreditAttribution: FeyP at werk21 commentedThanks 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 astring
, 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.Comment #5
Spurlos CreditAttribution: Spurlos at FFW commentedI have updated the patch to mention
PathautoPatternInterface
usage.Comment #6
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #7
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedThe Pathauto pattern entity which need its patter to be modified using.
spelling mistake written patter instead of pattern
Comment #8
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedHere is the updated patch and interdiff.txt
Comment #9
gettysburger CreditAttribution: gettysburger commentedComment #3 says "Do we even invoke the hook at the moment? There's another issue about hooks not being invoked.."
Is there a link to this issue? Tanks.
Comment #10
madhavvyas CreditAttribution: madhavvyas as a volunteer commented#8 patch looks good to me.
Comment #11
Luke.LeberOn patch #8, if I'm not mistaken the type specifier in the @param annotation is generally the fully qualified class name with namespace.
Comment #12
idebr CreditAttribution: idebr at ezCompany commentedUpdated to the fully qualified namespace to match Drupal coding standards.
*.api.php files use fully qualified namespace arguments, see for example http://cgit.drupalcode.org/drupal/tree/core/modules/media/media.api.php
Comment #14
BerdirComment #16
BerdirComment #18
BerdirThanks, committed.
PS: issue credit these days is mostly about the issue metadata not the commit message. Just list the users to be added additionally, then I can add them .