Getting deprecated function: calling static trait method when creating a new model with PHP 8.1
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3292362. --> Reported by: [rkoller](https://www.drupal.org/user/3217695) Related to !195 >>> <p>I've installed a fresh version of Drupal 9.4.1 with ECA RC1 and bpmn_io RC1 (btw RC1 isn't listed in the dropdown list of available versions for this issue yet -&gt; <strong>selected beta12 but the issue is about RC1 and I've tested only with that version</strong>). I've used Claro as the admin theme. I've used nginx/1.22.0, PHP 8.1.6 and MariaDB 10.5.16 with DDEV. I've installed all modules in the ECA section on the extend page except ECA Entity Share Client and Entity Share Server. On <code>admin/config/workflow/eca</code> I've created a new model. I ran into the following issue (tested with Safari 13.1.2 and Firefox 101.0.1 with identical results):</p> <p><img src="https://www.drupal.org/files/issues/2022-06-24/deprecated.png" alt="eca new model window with a deprecation warning window underneath"></p> <p>I am unable to copy and paste the output directly from the error message on the new model page. I am unable to select the text. The two error messages shown look the same. Therefor I've only copied the error once from the recent log messages page: </p> <pre>Location: https://eca.ddev.site/admin/config/workflow/eca/add/bpmn-io<br>Referrer: <br>Message:<br>Deprecated function: Calling static trait method Drupal\eca\Service\ServiceTrait::convertKeyToLabel is deprecated, it should only be called on a class using the trait in Drupal\eca_modeller_bpmn\ModellerBpmnBase-&gt;prepareConfigFields() (line 736 of /var/www/html/web/modules/contrib/eca/modules/modeller_bpmn/src/ModellerBpmnBase.php)<br><br>#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(8192, 'Calling static ...', '/var/www/html/w...', 736)<br>#1 /var/www/html/web/modules/contrib/eca/modules/modeller_bpmn/src/ModellerBpmnBase.php(736): _drupal_error_handler(8192, 'Calling static ...', '/var/www/html/w...', 736)<br>#2 /var/www/html/web/modules/contrib/eca/modules/modeller_bpmn/src/ModellerBpmnBase.php(588): Drupal\eca_modeller_bpmn\ModellerBpmnBase-&gt;prepareConfigFields(Array)<br>#3 /var/www/html/web/modules/contrib/eca/modules/modeller_bpmn/src/ModellerBpmnBase.php(538): Drupal\eca_modeller_bpmn\ModellerBpmnBase-&gt;properties(Object(Drupal\eca_config\Plugin\ECA\Event\ConfigEvent), 'event', 'bpmn:Event', Array)<br>#4 /var/www/html/web/modules/contrib/bpmn_io/src/Plugin/ECA/Modeller/BpmnIo.php(74): Drupal\eca_modeller_bpmn\ModellerBpmnBase-&gt;getTemplates()<br>#5 /var/www/html/web/modules/contrib/bpmn_io/src/Controller/BpmnIo.php(61): Drupal\bpmn_io\Plugin\ECA\Modeller\BpmnIo-&gt;edit()<br>#6 [internal function]: Drupal\bpmn_io\Controller\BpmnIo-&gt;add()<br>#7 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)<br>#8 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}()<br>#9 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))<br>#10 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array)<br>#11 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}()<br>#12 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)<br>#13 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#14 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#15 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#16 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#17 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#18 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#19 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#20 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#21 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request))<br>#22 {main}</pre><p>I've tested the same steps with PHP 8.0 and the deprecation error hasn't shown there. If I switch back to PHP 8.1.6 the error is back. And in regards the display of the error message I've linked two related issue. <a href="https://www.drupal.org/project/bpmn_io/issues/3279961">https://www.drupal.org/project/bpmn_io/issues/3279961</a> seems at least in the context of this issue still be problematic.</p> > Related issue: [Issue #3274354](https://www.drupal.org/node/3274354) > Related issue: [Issue #3279961](https://www.drupal.org/node/3279961)
issue