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

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

makkus183 created an issue. See original summary.

makkus183’s picture

Added Patch additional to MR

makkus183’s picture

Status: Active » Needs review
jcnventura’s picture

Status: Needs review » Needs work

The 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.

makkus183’s picture

Added updated Patch

makkus183’s picture

Status: Needs work » Needs review

  • jcnventura committed 99e093c on 2.x
    Issue #3220927 by makkus183, jcnventura: hook redirect_logout not...
jcnventura’s picture

Status: Needs review » Fixed

I moved back the client parameter to the context parameter, as there's no reason at all why that should be possible to be altered.

makkus183’s picture

@jcnventura thanks a lot! Regarding #9, thought the same, no reason to alter the client parameter, its a classic context value.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.