Problem/Motivation

OIDC shouldnt modify form ID when the intent is to override and replace the functionality, rather than modify for re-use.

When OIDC modifies the form ID, the <form id> attribute is also modified to #openid-connect-user-logout. If users have end user functionality targetting that ID, or you are using Drupal DTT (20k weekly downloads) or other test framework, you'll run into issues with the standard $this->drupalLogout(); in tests, because Drupal core itself in drupalLogout is looking for a particular ID, as evident by:

Behat\Mink\Exception\ElementNotFoundException: Element matching xpath "//form[@id='user-logout-confirm']" not found.

/data/vendor/behat/mink/src/WebAssert.php:465
/data/app/core/tests/Drupal/Tests/UiHelperTrait.php:78
/data/app/core/tests/Drupal/Tests/UiHelperTrait.php:202
/data/app/modules/custom/XYZ/tests/src/Functional/MyTest.php:95

(In some cases uninstalling OIDC for tests is the best solution, sometimes this may not be preferred though)

Proposed resolution

As some other discussions have suggested, it may be preferable to remove \Drupal\openid_connect\Form\UserLogoutConfirmation entirely, so we dont have this problem to begin with.

Remaining tasks

User interface changes

API changes

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:

Comments

dpi created an issue. See original summary.

dpi’s picture

danflanagan8’s picture

I just created something against DTT: #3577345: drupalLogout fails when openid_connect is intalled

If this can be addressed in openid_connect directly though, that would be great.

steinmb’s picture

Version: 3.0.0-alpha7 » 3.x-dev

We also bump into this trying to logout from our Kernel tests.

dpi’s picture

Assigned: dpi » Unassigned
Status: Active » Needs review

pfrilling made their first commit to this issue’s fork.

pfrilling’s picture

Status: Needs review » Reviewed & tested by the community

I rebased and fixed the failing tests. Seems safe enough to merge.

pfrilling’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Chicago2026

Thanks for the patches. This has been merged

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • pfrilling committed 629ce6f6 on 3.x authored by dpi
    fix: #3577169 Dont modify logout form ID when replacing, fix downstream...
dpi’s picture

Thanks @pfrilling

acbramley’s picture

would be awesome to get a quick release of this so sites affected are minimal and hopefully don't have code that needs changing back and forth for form_alters etc :)

Status: Fixed » Closed (fixed)

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