Describe your bug or feature request.

On PHP 8.1 during checkout when an inline form is used, the following deprecation is triggered:
Deprecated function: Calling static trait method Drupal\commerce\Element\CommerceElementTrait::shouldExecuteElementSubmit is deprecated, it should only be called on a class using the trait in Drupal\commerce\Element\CommerceElementTrait::validateElementSubmit() (line 65 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).

Comments

Aerzas created an issue. See original summary.

aerzas’s picture

Status: Active » Needs review
Issue tags: +Needs review
StatusFileSize
new1.39 KB

Here is a proposition.

  • jsacksick committed cc58e16 on 8.x-2.x authored by Aerzas
    Issue #3257723 by Aerzas: PHP 8.1 Calling static trait method is...

  • jsacksick committed d3bdb05 on 3.0.x authored by Aerzas
    Issue #3257723 by Aerzas: PHP 8.1 Calling static trait method is...
jsacksick’s picture

Status: Needs review » Fixed

Looks good, committed!

Status: Fixed » Closed (fixed)

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

dj1999’s picture

I get this message

Deprecated function: Calling static trait method Drupal\commerce\Element\CommerceElementTrait::shouldExecuteElementSubmit is deprecated, it should only be called on a class using the trait in Drupal\commerce\Element\CommerceElementTrait::validateElementSubmit() (line 65 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).

In https://www.php.net/manual/en/migration81.deprecated.php say:

Calling a static element on a trait ¶
Calling a static method, or accessing a static property directly on a trait is deprecated. Static methods and properties should only be accessed on a class using the trait.