Problem/Motivation
After upgrade to v 2.1.0
Steps to reproduce
Use composer u in dev env.
Cannot CR error now reads
Error: Class 'Symfony\Contracts\EventDispatcher\Event' not found in require() (line 12 of [path to instalation]\web\modules\contrib\mollie\src\Events\MollieEventBase.php).
and
Fatal error: Uncaught Error: Class 'Symfony\Contracts\EventDispatcher\Event' not found in [path to instalation]web\modules\contrib\mollie\src\Events\MollieEventBase.php:12
Stack trace:
#0 [path to instalation]\vendor\composer\ClassLoader.php(480): include()
#1 [path to instalation]\vendor\composer\ClassLoader.php(346): Composer\Autoload\includeFile('C:\\drupal\\java-...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\\mollie\\E...')
#3 [path to instalation]\web\modules\contrib\mollie\src\Events\MollieRedirectEvent.php(12): spl_autoload_call('Drupal\\mollie\\E...')
#4 [path to instalation]\vendor\composer\ClassLoader.php(480): include('C:\\drupal\\java-...')
#5 [path to instalation]\vendor\composer\ClassLoader.php(346): Composer\Autoload\includeFile('C:\\drupal\\java-...')
#6 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\\mollie\\E...')
#7 [path to instalation]\web\modules\contrib\mollie\modules\mollie_commerce\src\EventSubscriber in [path to instalation]\web\modules\contrib\mollie\src\Events\MollieEventBase.php on line 12
Proposed resolution
Can't even drush cr. Reverted file MollieEventBase.php to previous one from version 2.0.0 and now able to use drush command.
Doing the above seems to fix the issue but the impact has yet to be tested on a live payment test.
Solution is to investigate the cause and fix the issue in the MollieEventBase.php
Remaining tasks
Check and fix the error in MollieEventBase.php
Comments
Comment #2
inwebsol commentedOK, so after testing a test payment, the page redirects to /admin/mollie/payments instead of checkout/[ID]/complete. The transaction is not completed, the order is still in the cart, but the Mollie transaction is completed successfully.
Comment #3
inwebsol commentedIt would appear that there might be a syntax error on line 5 of src\Events\MollieEventBase.php
use Symfony\Contracts\EventDispatcher\Event;
Should be ?
use Symfony\Component\EventDispatcher\Event;
Comment #4
inwebsol commentedIn addition to the above, I report also that for Drupal commerce at /commerce/orders/[ID]/payments, no payment is registered/displayed (order balance is still pending despite a successful transaction; all fields are empty no remote ID no payment gateway info, nothing). Other PGs such as PayPal or manual payments (invoice) work perfectly. It makes this PG pretty much useless unfortunately.
Comment #5
ricovandevin commented@inwebsol What version of Drupal are you using?
Comment #6
ricovandevin commentedComment #7
inwebsol commented@ricovandevin 8.9.17
Comment #8
ricovandevin commented@inwebsol
Symfony\Component\EventDispatcher\Eventis deprecated as of Symfony 4.3. Drupal 9 uses Symfony 4.4+. Drupal 8 will be end-of-life in 3 months from now.I will change back to
Symfony\Component\EventDispatcher\Eventfor now. But change toSymfony\Contracts\EventDispatcher\Eventagain in our next November release.Comment #10
ricovandevin commentedComment #11
inwebsol commentedThanks for the fix. D9 still has issues to resolve for Commerce. Do you have any idea why it resolves to /admin/mollie/payments instead of checkout/[ID]/complete after a transaction?