Problem/Motivation
I was trying to use the provided hook_openid_connect_redirect_logout
from openid_connect/openid_connect.api.php
in my own custom module but it never get called.
After debugging i found out that Drupal ModuleHandler is looking for openid_connect_redirect_logout_alter
implementations. After renaming the hook from
my_module_openid_connect_redirect_logout
to
my_module_openid_connect_redirect_logout_alter
and changed the $response
param to &$response
the hook in my module was called and i was able to alter the redirect.
Steps to reproduce
add hook to your own module with
my_module_openid_connect_redirect_logout
Proposed resolution
Add _alter
suffix to hook definition and change parameters to passed by reference
Remaining tasks
User interface changes
API changes
hook renaming hook_openid_connect_redirect_logout
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#6 | rename_redirect_logout_hook-3220927-7.patch | 1.76 KB | makkus183 |
#3 | rename_redirect_logout_hook-3220927-2.patch | 799 bytes | makkus183 |
Issue fork openid_connect-3220927
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
makkus183 CreditAttribution: makkus183 as a volunteer commentedAdded Patch additional to MR
Comment #4
makkus183 CreditAttribution: makkus183 as a volunteer commentedComment #5
jcnventura CreditAttribution: jcnventura commentedThe parameters needs to be passed as an array, with the key 'response' and 'client', since the alter hooks only allow one parameter to be altered.
Comment #6
makkus183 CreditAttribution: makkus183 as a volunteer commentedAdded updated Patch
Comment #7
makkus183 CreditAttribution: makkus183 as a volunteer commentedComment #9
jcnventura CreditAttribution: jcnventura commentedI moved back the client parameter to the context parameter, as there's no reason at all why that should be possible to be altered.
Comment #10
makkus183 CreditAttribution: makkus183 as a volunteer commented@jcnventura thanks a lot! Regarding #9, thought the same, no reason to alter the client parameter, its a classic context value.