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

inwebsol created an issue. See original summary.

inwebsol’s picture

OK, 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.

inwebsol’s picture

It 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;

inwebsol’s picture

In 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.

ricovandevin’s picture

Assigned: Unassigned » ricovandevin
Status: Active » Postponed (maintainer needs more info)

@inwebsol What version of Drupal are you using?

ricovandevin’s picture

Title: Critical error in MollieEventBase.php V 2.1.0 » Critical error in MollieEventBase.php
Version: 2.1.0 » 2.1.x-dev
inwebsol’s picture

@ricovandevin 8.9.17

ricovandevin’s picture

@inwebsol Symfony\Component\EventDispatcher\Event is 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\Event for now. But change to Symfony\Contracts\EventDispatcher\Event again in our next November release.

  • ricovandevin committed baa8438 on 2.1.x
    Issue #3226207 by ricovandevin: Critical error in MollieEventBase.php
    
ricovandevin’s picture

Status: Postponed (maintainer needs more info) » Fixed
inwebsol’s picture

Thanks 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?

Status: Fixed » Closed (fixed)

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