Problem/Motivation

Symfony\Component\EventDispatcher\Event is deprecated in drupal:9.1.0 and will be replaced by Symfony\Contracts\EventDispatcher\Event in drupal:10.0.0. A new Drupal\Component\EventDispatcher\Event class is available to bridge the two versions of the class. See https://www.drupal.org/node/3159012

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

heddn created an issue. See original summary.

heddn’s picture

Status: Active » Needs review
StatusFileSize
new382 bytes
heddn’s picture

StatusFileSize
new2.19 KB

#2 didn't remove all the deprecations. This one should though. We need to handle using the deprecated event or the new event.

graber’s picture

Any reason for not using Drupal\Component\EventDispatcher\Event in ViewsBulkOperationsActionManager as done in ViewsBulkOperationsEvent?

heddn’s picture

No good reason.

victoria-marina’s picture

Assigned: Unassigned » victoria-marina

I'll review this.

victoria-marina’s picture

StatusFileSize
new3.24 KB

After the #3, I still found some deprecated Event() warnings.

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------ 
  Line   modules/actions_permissions/src/EventSubscriber/ActionsPermissionsEventSubscriber.php                                                                       
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------ 
  37     Parameter $event of method Drupal\actions_permissions\EventSubscriber\ActionsPermissionsEventSubscriber::alterActions() has typehint with deprecated class  
         Symfony\Component\EventDispatcher\Event:                                                                                                                    
         since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead                                                                                    
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/ViewsBulkOperationsEvent.php                                                                                               
 ------ ------------------------------------------------------------------------------------------------------------------------------- 
  11     Class Drupal\views_bulk_operations\ViewsBulkOperationsEvent extends deprecated class Symfony\Component\EventDispatcher\Event:  
         since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead                                                       
 ------ ------------------------------------------------------------------------------------------------------------------------------- 

So I made a patch to kill all the Symfony\Component\EventDispatcher\Event is deprecated warnings. Kindly review it.

victoria-marina’s picture

Assigned: victoria-marina » Unassigned
graber’s picture

@heddn, actually there is a reason.. Drupal 8 doesn't have that class. Probably I should drop D8 support from now as it's becoming troublesome.

graber’s picture

Assigned: Unassigned » graber
Status: Needs review » Needs work

This is actually bigger as there are many other deprecations in automated tests. I'll handle it.

graber’s picture

Status: Needs work » Needs review
StatusFileSize
new15.81 KB
graber’s picture

Assigned: graber » Unassigned
graber’s picture

Title: Symfony\Component\EventDispatcher\Event is deprecated in drupal:9.1.0 » Handle Drupal 9 deprecations

One unused use statement left, no point re-adding a patch. I'll commit without it.

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Just added a 9.4.x and php 8.1 test run and it came back green too.

  • Graber committed 889f57b on 4.0.x
    Issue #3261870 by heddn, Graber, victoria-marina: Handle Drupal 9...
graber’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

  • Graber committed 95845f6 on 4.0.x
    Issue #3261870: Remove jquery.once dependency.
    
graber’s picture

Version: 4.0.x-dev » 4.1.x-dev

Status: Fixed » Closed (fixed)

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