Describe your bug or feature request.

UserAuthInterface will be depricated as of Drupal 11.1 and dropped in Drupal 12 as detailed here:
https://www.drupal.org/project/drupal/issues/3427298

Two classes in the CheckoutPane Plugins of the Checkout module that's in Drupal Commerce use the soon to be depricated UserAuthInterface code and need to be updated to reference the replacement for it, UserAuthenticationInterface.

This needs to be done in a future Commerce 3.x release that targets Drupal 10.3 and above. Drupal 10.3 is when the replacement methods for UserAthenticationInterface were added to Core. This change won't be compatible with Drupal 10.2 or below.

Issue fork commerce-3464144

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

hyperlinked created an issue. See original summary.

hyperlinked’s picture

FYI, if you're seeing an error message that looks something like the following, you may be dealing with a module that has conflicts between the old UserAuthInterface and the new UserAuthenticationInterface:

TypeError: Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\Login::__construct(): Argument #8 ($user_auth) must be of type Drupal\user\UserAuthInterface, Drupal\mail_login\AuthDecorator given

If you had a problem with Mail Login and your search led you here, you need to downgrade to Mail Login 3.x.

hyperlinked’s picture

Status: Active » Needs review

Ooops, got ahead of myself here. Didn't mean to make a merge request just yet. This needs a review.

jsacksick’s picture

I'm wondering if we shouldn't use the union type and allow both interfaces?

UserAuthInterface|UserAuthenticationInterface this way we can support both? But maybe not necessary since Commerce 3 is only D10.3+

hyperlinked’s picture

I'll defer judgement on that since this is my first time encountering this exact scenario with compatibility issues for a drop-in replacement in Core.

I'd presume it'd be the nice thing to do support both until it's actually dropped in Drupal 12. There may be other modules that continue to reference the old methods and those may break Commerce Checkout if only the new methods are supported. Case in point is Mail Login 4.x and that's the module that brought me here.

I'm not familiar with using a union type to address this scenario to provide options. How would that work?

jsacksick’s picture

See the latest commit.

jsacksick’s picture

Ok sorry, I did this too quickly... Based on the interface, we have to call a different method... Perhaps dropping support of the old interface is the cleanest solution here... But I wonder why the tests are failing then? The test failure would indicate that we're calling a method that doesn't exist or something.

jsacksick’s picture

Status: Needs review » Fixed
vipin.j’s picture

For members who already upgraded Drupal Core to ^10.3 and wanted to update Mail Login to ^4.0.

here is the Commerce Core 8.x-2.39 compatible patch for this issue queue.

Status: Fixed » Closed (fixed)

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

jsacksick’s picture

I think the right fix is to mark Commerce 2.x incompatible with Mail Login 4 as Commerce isn't going to be compatible with D11 and retain compatibility with D9 and D10 < 10.3

zaporylie’s picture

@vipin.j mail_login 4.0.3 supports both old and the new interface so you feel free to upgrade.