PHP 8.1 issue: Passing null to parameter #2 ($subject) of type string is deprecated in taxonomy_machine_name_clean_name

Created on 21 November 2022, about 2 years ago
Updated 20 June 2023, over 1 year ago

Problem/Motivation

Stack trace:

Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in taxonomy_machine_name_clean_name() (line 209 of modules/contrib/taxonomy_machine_name/taxonomy_machine_name.module).
taxonomy_machine_name_clean_name(NULL) (Line: 90)
taxonomy_machine_name_form_taxonomy_term_form_alter(Array, Object, 'taxonomy_term_grp_coa_hierarchy_form') (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'taxonomy_term_grp_coa_hierarchy_form') (Line: 835)
Drupal\Core\Form\FormBuilder->prepareForm('taxonomy_term_grp_coa_hierarchy_form', Array, Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object) (Line: 26)
Drupal\taxonomy\Controller\TaxonomyController->addForm(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

The way that taxonomy_machine_name_form_taxonomy_term_form_alter checks for values is not save, I'll post an MR to fix this.

🐛 Bug report
Status

Closed: outdated

Version

1.0

Component

Other

Created by

🇩🇪Germany jurgenhaas Gottmadingen

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024