Fix compatibility with Drupal 11

Created on 9 May 2024, 4 months ago
Updated 29 May 2024, 3 months ago

Problem/Motivation

Saw 2 issues on other screens: a circular dependency injection issue and a changed service declaration. Will look into this and trying to fix this now.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany jurgenhaas Gottmadingen

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

Comments & Activities

  • Issue created by @jurgenhaas
  • Status changed to Fixed 4 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Fixed by updating the service declaration in eca_cache. Also back ported to 1.1.x

  • 🇩🇰Denmark ressa Copenhagen

    Thanks, that fixed the error. I do still get this message on the "Import" page, under /admin/config/workflow/eca/import:

    The website encountered an unexpected error. Try again later.

    TypeError: Cannot assign Symfony\Component\EventDispatcher\EventDispatcher to property Drupal\eca_ui\Form\Import::$eventDispatcher of type Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher in Drupal\eca_ui\Form\Import::create() (line 140 of modules/contrib/eca/modules/ui/src/Form/Import.php).

    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
    Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)
    [...]

  • 🇩🇰Denmark ressa Copenhagen

    Thanks @jurgenhaas, that fixed it, and I can access the Import page. I tried an importing https://ecaguide.org/library/simple/add_role_to_inserted_or_updated_user/ and got this message:

    The website encountered an unexpected error. Try again later.

    ArgumentCountError: Too few arguments to function Drupal\Core\Config\ConfigImporter::__construct(), 10 passed in /var/www/html/web/modules/contrib/eca/modules/ui/src/Form/Import.php on line 348 and exactly 11 expected in Drupal\Core\Config\ConfigImporter->__construct() (line 204 of core/lib/Drupal/Core/Config/ConfigImporter.php).

    Drupal\eca_ui\Form\Import->submitForm()
    call_user_func_array() (Line: 105)
    Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 43)
    Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 589)
    [...]
  • 🇩🇪Germany jurgenhaas Gottmadingen

    @ressa this is somehow expected, since Drupal 11 is a moving target. I've fixed that 3rd one now as well, but I'd prefer individual issues for each such issue moving forward as it will be better traceable.

  • 🇩🇰Denmark ressa Copenhagen

    Yes, sorry, I didn't mean to keep on piling errors on this issue. I'll create any D11 issues I encounter separately in the future. But thanks for fixing it, it is now possible to import an ECA model in Drupal 11.

  • 🇩🇪Germany jurgenhaas Gottmadingen

    That's great, thanks for collaborating on this.

    BTW, I'm almost done with getting the ECA module automatically tested with GitLab CI as well, so that we will get notified about such changes whenever something changes upstream.

  • 🇩🇰Denmark ressa Copenhagen

    Nice! Automatic testing with Gitlab CI will be a great life saver, catching such events in the future. Testing is a great idea, with a lot of value :)

  • 🇩🇪Germany jurgenhaas Gottmadingen

    Well, we've had testing with GitLab in place for a long time, and we also have great test coverage. But so far, we only tested against Drupal 10.3, but now we also test against Drupal 11.

    Also, since the tests against Drupal 10.3 and 11 are now working properly, I've also enabled scheduled tests twice a day, so that we get test failures if Drupal core changes, even if we didn't commit anything regarding ECA.

  • 🇩🇰Denmark ressa Copenhagen

    I see other projects (see for example 📌 Use gitlab-ci Needs work ) having difficulties getting GitLab CI working in the first place, so it's great that ECA already had it running for D10, and that D11 could be added. I really appreciate what you have been building with ECA, it is truly an epic project.

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

Production build 0.71.5 2024