Problem/Motivation
Currently this module is Incompatible with Drupal 10
Proposed resolution
Use drupal-rector to create a patch to make it compatible
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | commerce_price_rule-d10compatibility-3404466-6.patch | 3.91 KB | estebanvalerio.h |
| #2 | commerce_price_rule-d10compatibility-3404466-2.patch | 2.16 KB | estebanvalerio.h |
Issue fork commerce_price_rule-3404466
Show commands
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
estebanvalerio.h commentedI created a patch using drupal-rector and grabbing the files it modified, after flushing cache and using Upgrade Status, it recognizes the module as a compatible D10 one.
Comment #5
sarwan_verma commentedComment #6
estebanvalerio.h commentedWhile testing the project where I'm using this module I found an error:
I noticed in this module, some entity queries are run and needed that line, so I create a new patch for it.
Comment #8
alexpottI've merged the fixes in #6 with MR and removed Drupal 8 compatibility as Drupal 8 is long unsupported.
Comment #14
krystalcode commentedMerged into the main development branch. I will close and make a release after this has been tested on a project for some time to make sure we don't have any regressions.
Notes:
- I changed
accessCheck()toaccessCheck(TRUE); I prefer to be explicit with access control, it makes it easier to read if you don't remember what is the default.- Removed a duplicate call to access check, kept the one before the subscriber so that subscribers can change it if they have a legitimate reason.
- I reverted the change in the declaration of
public static function getSubscribedEvents()to match that of the interface - seeSymfony\Component\EventDispatcher\EventSubscriberInterface.- Good with removing Drupal 8 support, event dispatching is not compatible anymore.
Thanks!
Comment #15
alexpott@krystalcode return typehints can be more explicit than the interface. Reverting that just means you'll have to do it for Drupal 11 compatibility.
Comment #16
krystalcode commented@alexpott why would that be the case? Drupal 11 relies on Symfony 7 (https://git.drupalcode.org/project/drupal/-/blob/11.x/core/composer.json...) which also has the same method declaration (https://github.com/symfony/event-dispatcher/blob/7.1/EventSubscriberInte...).
Comment #17
krystalcode commentedUpdated credits.
Comment #18
pfrenssenThis has been committed a long time ago, and there have been no reports of any problems, so I guess it is OK to mark this as fixed. Thanks all!