Establish ECA 2.0 compatibility

Created on 25 February 2023, over 1 year ago
Updated 24 May 2024, about 1 month ago

Problem/Motivation

After not running my eca test instance for the last 2 or 3 weeks today i've started it today and first updated my outdated composer dependencies. after the ddev composer update -w i ran a ddev drush updatedb. there i already ran into an error:

$> ddev drush updatedb
PHP Fatal error:  Declaration of Drupal\eca_context\Token\ContextStackDataProvider::getData(string $key) must be compatible with Drupal\eca\Token\DataProviderInterface::getData(string $key): mixed in /var/www/html/web/modules/contrib/eca_context/src/Token/ContextStackDataProvider.php on line 35

Fatal error: Declaration of Drupal\eca_context\Token\ContextStackDataProvider::getData(string $key) must be compatible with Drupal\eca\Token\DataProviderInterface::getData(string $key): mixed in /var/www/html/web/modules/contrib/eca_context/src/Token/ContextStackDataProvider.php on line 35

when i tried to access the site the same fatal error showed up.

Fatal error: Declaration of Drupal\eca_context\Token\ContextStackDataProvider::getData(string $key) must be compatible with Drupal\eca\Token\DataProviderInterface::getData(string $key): mixed in /var/www/html/web/modules/contrib/eca_context/src/Token/ContextStackDataProvider.php on line 35

running drupal 9.5.x with php 8.1 and eca 1.2.x-dev@dev, bpmn 1.1.x-dev@dev and eca context 1.0. looks like something changed in ecas dataproviderinterface.php that is incompatible with eca_context's contextstackdataprovider.php

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany

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

Comments & Activities

  • Issue created by @rkoller
  • πŸ‡©πŸ‡ͺGermany mxh Offenburg

    The error originates from the linked issue. In that issue I linked to a discussion where I described why that change is a problem.

    Overall, the main problem here is that ECA 1.1 -> 1.2 contains breaking API changes. And since breaking API happens between two minor releases of a stable release, I see this as a bug within ECA, not this integration module. No matter the perspective on this - it means additional effort in taking care of such changes, and no one is paying me to fix them. If that change would've happened on a major release update (like 1.x to 2.x) then I'd be willing to take care about it, also in my free time.

    Now we have the problem, that this does not only mean additional effort by trying to "fix" this in code, but also it kinda forces all integration modules like this one to follow the "version pattern" of ECA, or at least somehow dealing with it. Also for this topic: no matter the perspective - it also means means additional effort.

  • πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany

    ohhhh the changes between eca 1.1 and 1.2 are the cause? when the discussion was about those changes i've assessed it only from a eca point of view and there making php 8.1 the minimum requirement made sense. but i havent fully grasped the implications for modules having eca as a dependency. the issue illustrates the problem well then. would it make sense instead of going 1.1 to 1.2 go directly to 2.0 with eca instead?

  • πŸ‡©πŸ‡ͺGermany mxh Offenburg

    would it make sense instead of going from 1.1 to 1.2 with eca instead go to 2.0 directly?

    When ECA wants to follow core's version semantics, then yes. I've already discussed this with the maintainer as can be seen in the linked discussion of the related issue.

  • First commit to issue fork.
  • @jurgenhaas opened merge request.
  • Status changed to Needs review 11 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Started an MR for a new release, since ECA 2.0.x is now available and can be declared as a dependency. Should that become a 2.0.x release here too?

  • Status changed to Postponed 11 months ago
  • πŸ‡©πŸ‡ͺGermany mxh Offenburg

    This makes sense to be addressed once ECA v2 reaches beta, as beta releases are usually not supposed to make major API changes anymore.

    May I ask what's the concrete benefit of changing the API from this
    public function getData(string $key) { to this public function getData(string $key): mixed { ?

    The DataProviderInterface will maybe change anyway once there will be a definition layer introduced for provided tokens. But for now, I'm struggling to justify a specific release branch only because of the highlighted API change above (unless there's a viable reason for it).

  • πŸ‡©πŸ‡ͺGermany mxh Offenburg
  • πŸ‡©πŸ‡ͺGermany mxh Offenburg

    Might be worth first clarifying πŸ“Œ Consider dropping maintenance support for this module Active before putting any more effort into this issue.

  • Assigned to jurgenhaas
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • Issue was unassigned.
  • Status changed to Closed: outdated about 1 month ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
Production build 0.69.0 2024