Closed (fixed)
Project:
Entity API
Version:
8.x-1.x-dev
Component:
Code - misc
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Aug 2024 at 07:37 UTC
Updated:
25 Aug 2024 at 12:34 UTC
Jump to comment: Most recent
When using this module in tests at 10.3+ we get the deprecation message
Method "Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()" might add "array" as a native return type declaration in the future. Do the same in implementation "Drupal\entity\EventSubscriber\EntityDuplicateSubscriber" now to avoid errors or add an explicit @return annotation to suppress this message.
Entity API is a dependency from Commerce module, and hence also needed when testing modules which integrate with Commerce
See Scheduler MR161 which fixes the Scheduler test eventsubscriber. However, the pipelines still have many deprecations due to Entity API
https://git.drupalcode.org/project/scheduler/-/jobs/2301653#L482
Add array return type in the definition of EntityDuplicateSubscriber()
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jonathan1055 commentedLooking at the pipelines for Entity API there are no errors shown for this at Next Major, so maybe the test coverage does not include this event subscriber?
I will create a MR for the oneline change, and then see if I can include it in Scheduler testing, to demonstrate the fix.
Comment #4
jonathan1055 commentedThat worked nicely. I added this MR via the composer file, in this commit
Before
https://git.drupalcode.org/project/scheduler/-/jobs/2301653
Search for "EntityDuplicateSubscriber" and see 24 occcurences of the error
After
https://git.drupalcode.org/project/scheduler/-/jobs/2311391
No text "EntityDuplicateSubscriber" because that error is fixed.
Comment #5
ankitv18 commentedQuite straightforward ~~ Marking this one RTBC to move things ahead.
Comment #6
jonathan1055 commentedThanks. I'm using this MR branch in a temporary swapped-in composer.json for D11 testing. When the change is committed, I should be able to alter the dependency from
"drupal/entity": "dev-3465393-EntityDuplicateSubscriber-array-return as 1.0",to just
"drupal/entity": "dev-1.x as 1.0",Comment #8
berdirMerged.