D10 event and request stack compatibilities

Created on 14 December 2023, about 1 year ago
Updated 15 December 2023, about 1 year ago

Problem/Motivation

Some class and parameter orders were changed in Drupal 10 in Event dispatch service.

Steps to reproduce

Install a drupal 10
Download and enable the following modules.
composer require 'drupal/webform'
composer require 'drupal/multivalue_form_element'
composer require 'drupal/webform_remote_fields:^1.0@alpha'
Also, enable the module webform_remote_fields_examples
Go to /admin/structure/webform and access any webform remote field example
You probably will see the page broken, go to watchdog and check the error.

Proposed resolution

Fix class parameter on Drupal\webform_remote_fields\Service\Handler removing Drupal\Core\Http\RequestStack; on line 9 and add the correct class name on D10 use Symfony\Component\HttpFoundation\RequestStack;
Also, the order of the parameters on Drupal event dispatch was changed. Update the file Drupal\webform_remote_fields\RemoteFieldBaseTrait on line 146 change the order of the event name and the $event.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil joaopauloc.dev

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024