Drupal 10 compatibility fixes

Created on 28 March 2023, over 1 year ago
Updated 1 May 2023, over 1 year ago

Problem/Motivation

  • Parameter $event of method Drupal\statistics_counter\EventSubscriber\StatisticsCounterSubscriber::updateStatistics() has typehint with deprecated class Symfony\Component\EventDispatcher\Event: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
  • Value of core_version_requirement: ^8.8 || ^9 is not compatible with the next major version of Drupal core

Steps to reproduce

  • Use "Symfony\Contracts\EventDispatcher\Event" instead
  • Add drupal 10 as core requirement
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇲Armenia as_vard Yerevan

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

Comments & Activities

  • Issue created by @as_vard
  • 🇦🇲Armenia as_vard Yerevan

    Here is the patch

  • 🇷🇴Romania idflorin

    Drupal 10 + latest 8 dev + this patch and
    I get this error

    TypeError: Drupal\statistics_counter\EventSubscriber\StatisticsCounterSubscriber::updateStatistics(): Argument #1 ($event) must be of type Drupal\Component\EventDispatcher\Event, Symfony\Component\HttpKernel\Event\TerminateEvent given in Drupal\statistics_counter\EventSubscriber\StatisticsCounterSubscriber::updateStatistics() (line 30 of /www/wwwroot/evmirrors.com/web/modules/statistics_counter/src/EventSubscriber/StatisticsCounterSubscriber.php)
    #0 [internal function]: Drupal\statistics_counter\EventSubscriber\StatisticsCounterSubscriber::updateStatistics()
    #1 /www/wwwroot/evmirrors.com/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
    #2 /www/wwwroot/evmirrors.com/vendor/symfony/http-kernel/HttpKernel.php(97): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #3 /www/wwwroot/evmirrors.com/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(63): Symfony\Component\HttpKernel\HttpKernel->terminate()
    #4 /www/wwwroot/evmirrors.com/web/core/lib/Drupal/Core/DrupalKernel.php(670): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate()
    #5 /www/wwwroot/evmirrors.com/web/index.php(22): Drupal\Core\DrupalKernel->terminate()
    #6 {main}
    .
  • 🇷🇴Romania idflorin

    Drupal 10 + latest 8 dev + this patch drupal-10-compatibility-fixes_3350929_4.patch
    Working fine.
    I also dabbled in Drupal 9, and it's working fine.

  • Status changed to Needs review over 1 year ago
  • 🇳🇴Norway gisle Norway

    We need the community to review this.

  • Issue was unassigned.
  • Assigned to gisle
  • 🇳🇴Norway gisle Norway

    Zip file in comment#6 has MSDOS line endings, not compatible with the conventions used in the GitLab repo.

    Patch in comment #5 correct, but is malformed and fails to apply.

    I've rerolled the patch in comment #5 so that it applies cleanly.

    • gisle authored 89c4d691 on 8.x-1.x
      Issue #3350929 by gisle: Fixed Drupal 10 compatibility
      
  • Status changed to Fixed over 1 year ago
  • 🇳🇴Norway gisle Norway

    Version 8.x-1.0 compatible with Drupal 10 has been released.

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

Production build 0.71.5 2024