PHP 8.3 Deprecated function: Calling get_class() without arguments is deprecated

Created on 12 August 2023, 11 months ago
Updated 10 January 2024, 6 months ago

Describe your bug or feature request.

I tried out the module using php:8.3.0beta2, and it seems the module works. Enabling all error messages with $config['system.logging']['error_level'] = 'verbose'; results deprecation messages, so I thought I write here about those where I could reproduce that deprecation notice:

1. /admin/commerce/config/tax-types/add

Deprecated function: Calling get_class() without arguments is deprecated in Drupal\commerce\Plugin\Commerce\InlineForm\PluginConfiguration::attachElementSubmit() (line 44 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).
Drupal\commerce\Plugin\Commerce\InlineForm\PluginConfiguration::attachElementSubmit(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1012)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_tax_type_add_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_tax_type_add_form', Array, Object) (Line: 579)
Drupal\Core\Form\FormBuilder->processForm('commerce_tax_type_add_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

2. /admin/commerce/config/payment-gateways/add

Deprecated function: Calling get_class() without arguments is deprecated in Drupal\commerce\Plugin\Commerce\InlineForm\PluginConfiguration::attachElementSubmit() (line 44 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).
Drupal\commerce\Plugin\Commerce\InlineForm\PluginConfiguration::attachElementSubmit(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1012)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_payment_gateway_add_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_payment_gateway_add_form', Array, Object) (Line: 579)
Drupal\Core\Form\FormBuilder->processForm('commerce_payment_gateway_add_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

3. /admin/commerce/config/number-patterns/order_default/edit

Deprecated function: Calling get_class() without arguments is deprecated in Drupal\commerce\Plugin\Commerce\InlineForm\PluginConfiguration::attachElementSubmit() (line 44 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).
Drupal\commerce\Plugin\Commerce\InlineForm\PluginConfiguration::attachElementSubmit(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1012)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_number_pattern_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_number_pattern_edit_form', Array, Object) (Line: 579)
Drupal\Core\Form\FormBuilder->processForm('commerce_number_pattern_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

4. /promotion/add

Deprecated function: Calling get_class() without arguments is deprecated in Drupal\commerce\Element\Conditions::attachElementSubmit() (line 44 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).
Drupal\commerce\Element\Conditions::attachElementSubmit(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1012)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_promotion_add_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_promotion_add_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_promotion_add_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_promotion_add_form', Array, Object) (Line: 579)
Drupal\Core\Form\FormBuilder->processForm('commerce_promotion_add_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

5. /commerce/product-attributes/manage/size

Deprecated function: Calling get_class() without arguments is deprecated in Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::attachElementSubmit() (line 44 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).
Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::attachElementSubmit(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1012)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_attribute_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_attribute_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_attribute_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_attribute_edit_form', Array, Object) (Line: 579)
Drupal\Core\Form\FormBuilder->processForm('commerce_product_attribute_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

6. when you start checkout from cart page:

Deprecated function: Calling get_class() without arguments is deprecated in Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::attachElementSubmit() (line 44 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).
Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::attachElementSubmit(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1012)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_checkout_flow_multistep_default', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_checkout_flow_multistep_default', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_checkout_flow_multistep_default', Array, Object) (Line: 579)
Drupal\Core\Form\FormBuilder->processForm('commerce_checkout_flow_multistep_default', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 224)
Drupal\Core\Form\FormBuilder->getForm(Object, 'order_information') (Line: 143)
Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

7. after you sent the order, and try to edit it on admin page:
/admin/commerce/orders/1/edit

Deprecated function: Calling get_class() without arguments is deprecated in Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::attachElementSubmit() (line 44 of modules/contrib/commerce/src/Element/CommerceElementTrait.php).
Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::attachElementSubmit(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1012)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_order_default_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_order_default_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_order_default_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_order_default_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_order_default_edit_form', Array, Object) (Line: 579)
Drupal\Core\Form\FormBuilder->processForm('commerce_order_default_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
🐛 Bug report
Status

Fixed

Version

2.0

Component

Commerce

Created by

🇸🇰Slovakia kaszarobert

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024