- Issue created by @ptmkenny
- 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
I have reviewed the MR !91 and its working fine after upgrade to the php 8.4 version.
- Status changed to RTBC
6 months ago 10:25am 22 January 2025 - 🇩🇰Denmark ressa Copenhagen
Thanks for working on this, tagging with PHP 8.4, to easier follow along.
is the patch included now ? because ma getting some warnings regarding same issue
Drupal version = 11.1.7
pathauto version = 8.x-1.13
php version = 8.4.7Deprecated function: Drupal\pathauto\AliasStorageHelper::__construct(): Implicitly marking parameter $entity_type_manager as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of /var/www/html/drpee/vendor/composer/ClassLoader.php). include() (Line: 576) {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}() (Line: 427) Composer\Autoload\ClassLoader->loadClass() (Line: 259) Drupal\Component\DependencyInjection\Container->createService() (Line: 177) Drupal\Component\DependencyInjection\Container->get() (Line: 430) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 237) Drupal\Component\DependencyInjection\Container->createService() (Line: 177) Drupal\Component\DependencyInjection\Container->get() (Line: 75) Drupal\pathauto\Form\PathautoSettingsForm::create() (Line: 36) Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48) Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58) Drupal\Core\Controller\FormController->getContentResult() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 593) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709) Drupal\Core\DrupalKernel->handle() (Line: 19)
- First commit to issue fork.
- 🇯🇵Japan ptmkenny
@pbonnefoi Please explain what "the same error as #7" means-- #7 did not apply the MR. Your commit breaks backward compatibility because it changes the acceptable argument type by removing null. I think this is an unnecessary change and out of scope for this issue; please explain why the change is necessary.
- 🇫🇷France pbonnefoi
Well, sorry my comment was redacted having few little times (working actively on updating a project from D10 to D11). And indeed I misread the warning from #7
I had a resembling warning using Drupal 11.2 / PHP 8.4 :
Drupal\pathauto\PathautoGenerator::__construct(): Implicitly marking parameter $alias_type_manager as nullable is deprecated, the explicit nullable type must be used instead.
Looking at the code I found that in
PathautoGenerator
, the service was loaded using\Drupal::service('plugin.manager.alias_type'
) ifNULL
. That does not make sense to me as it is loaded with DI withinpathauto.services.yml
. But maybe I'm missing something in the picture.Though I think the fix should be just having
?AliasTypeManager $alias_type_manager = NULL
at least.Please let me know if I can help somehow.
- 🇯🇵Japan ptmkenny
Setting back to RTBC based on #4 and #7, and the change in #9 was reverted.
@pbonnefoi Yes, the service should generally be auto-loaded, but since the constructor accepts NULL, we have to handle the case of a NULL value, since that is the API argument. To preserve BC, eliminating the NULL argument can only happen in a module major version update.