- Issue created by @Rajab Natshah
- Merge request !8Issue #3537810: Fix Circular Reference by Removing Autowire and Minimizing Dependencies in modeler_api.service β (Open) created by Rajab Natshah
- π©πͺGermany jurgenhaas Gottmadingen
Thank you @rajab natshah for reporting this and proposing a solution. I'm surprised this is happening in your installation, since I'm using Drupal 11.2 and ECA 3 on many sites, including the development environment. And I haven't seen that issue before. Before we give in on this one, can we somehow find out why this is happening?
- π―π΄Jordan Rajab Natshah Jordan
I have a big stack of modules and CIs.
+ multiple languages
For exmaplescheduler
,paragraphs
,consumer
.Fined out
In Container.php line 147: Circular reference detected for service "Drupal\Core\Logger\LoggerChannelFactoryInterface", path: "scheduler.manager -> logger.channel.scheduler -> Drupal\Core\Logger\Logger ChannelFactoryInterface -> logger.syslog -> Drupal\modeler_api\Hook\EntityHooks -> modeler_api.service -> router.route_provider -> cache_tags.invalidator -> plugin.manager.b lock -> logger.channel.default".
In DefinitionErrorExceptionPass.php line 48: [Symfony\Component\DependencyInjection\Exception\RuntimeException] Cannot autowire service "Drupal\modeler_api\Hook\EntityHooks": argument "$modelerApiService" of method "__construct()" references class "Drupal\modeler_api\Api" but no such service exists. You should maybe alias this class to the existing "modeler_api.service" service.
In DefinitionErrorExceptionPass.php line 48: [Symfony\Component\DependencyInjection\Exception\RuntimeException] Cannot autowire service "Drupal\modeler_api\Hook\EntityHooks": argument "$modelerApiService" of method "__construct()" references class "Drupal\modeler_api\Api" but no such service exists. You should maybe alias this class to the existing "modeler_api.service" service.
Still testing the first draft fix with AI
- π―π΄Jordan Rajab Natshah Jordan
Impressive module, by the way (thanks for working on it).
Could a new2.0.x
branch help?
So we don't manage old and new ways within the same codebase.Drupal ~11.2.0 is doing things a new way, and contrib modules haven't caught up to it yet.
Trying to find a smoother mechanism and method for the update process. - π―π΄Jordan Rajab Natshah Jordan
Attached a static
modeler_api--2025-07-24--3537810--mr-8.patch
file, for this point of MR8.
To be used with Composer Patches and Drupal ~11.2.0 - π©πͺGermany jurgenhaas Gottmadingen
Originally, this module was only meant to work for Drupal 11.2 and later. For several reasons, we opened it up to be available for Drupal 10.4 as well, something I wasn't keen to do, but that's what it is now. Therefore, just now already opening another branch is not a priority. Let's avoid that if not absolutely necessary.
Still, I can't reproduce the issue, neither on 11.2 nor on earlier versions. So, I don't know exactly what we should be doing as it doesn't seem to be a general issue. I think before we can make further decisions, we need some reproducible instructions.
- π©πͺGermany jurgenhaas Gottmadingen
And BTW, uploading patches for composer is really bad practice. The DA makes it clear wherever they can, there is no guarantee that those files will be available. Patches have to be downloaded from the MR locally and applied from there,
- π―π΄Jordan Rajab Natshah Jordan
Noted;
Thanks for following up on this issue. As I said, we have a big stack of modules.
I did not change the status of the issue to needs review yet, but you started reviewing. ( Thank you for being on the spot )
For sure, Next time, I will add the Steps to reproduce when filing issues. I thought that when I sat on the final fix, I would add them.Let's rest this issue. ( We manage a local patching system in all projects, only shared to make it public for search)
We added the Modeler API module to our products. with ECA.It is the standard for my team to Managing Only Local Patches for Projects
Varbase Patches
When working with Drupal, it's common to patch core or contrib modules to fix bugs or review code changes before they're officially released. While applying patches via patch files is straightforward, using GitLab's merge request (MR) feature presents a challenge due to unstable diff URLs.As multiple commits are added to an MR, generating a stable patch file becomes complex. To create a static patch file for an MR at a specific point in time, simply set up a 'patches' folder next to your root composer.json. Download the .diff or .patch into this folder and utilize composer-patches to apply it seamlessly.
Varbase Patches has the list of needed patches for Varbase used packages with Composer Patches.
I attended a number of TUF meetings in the past couple of years and asked Trishank, and Marina about the best options to manage patches, which they listed ( Local Patches, Private/public patching storage - but with stamped key/permittion, or add them in the patches branch )
No PRs/MRs, and you are right about other hosted patches in Drupal.
Better to move all to Local Patches, or private patching storage system.Varbase has the Drush Command to Clean up Any Merge Request Patches
Drupal CMS switched to use Local Patching system!! too
https://git.drupalcode.org/project/drupal_cms/-/tree/2.x/patches?ref_typ...
https://git.drupalcode.org/project/drupal_cms/-/commit/318f64b7126208d15...
https://git.drupalcode.org/project/drupal_cms/-/blob/2.x/dev.composer.js... - π―π΄Jordan Rajab Natshah Jordan
JΓΌrgen, moving to follow with your tip.
To use our patching storage. not to keep uploading/attaching a copy of MRs.
Thanks, I cooked your remark overnight, and you are right on this.Back to the issue
We are using ECA, BPMN.iO with Modeler API in both Drupal 10.5.0 for some old projects, and Drupal ~11.2.0 too - π―π΄Jordan Rajab Natshah Jordan
rajab natshah β changed the visibility of the branch 3537810-fix-circular-reference to hidden.
- Merge request !10Issue #3537810: Fix Circular Reference by Removing Autowire and Minimizing Dependencies in modeler_api.service β (Open) created by Rajab Natshah
- Merge request !12Issue #3537810: Fix Circular Reference by Removing Autowire and Minimizing Dependencies in modeler_api.service β (Open) created by Rajab Natshah
- π―π΄Jordan Rajab Natshah Jordan
Moving to manage our local patch.
Something is wrong with the issue fork in this issue. - π―π΄Jordan Rajab Natshah Jordan
rajab natshah β changed the visibility of the branch 1.0.x to hidden.
- π―π΄Jordan Rajab Natshah Jordan
rajab natshah β changed the visibility of the branch 3537810-01x00x-for-D11x02 to hidden.
- π―π΄Jordan Rajab Natshah Jordan
rajab natshah β changed the visibility of the branch 3537810-1-0-x to hidden.
Okay, looks like it can't be solved.
So, what is the recommendation in this case?
If we look at the situation from the ECA perspective, what advice would you give?
Should we continue with ECA v.2 or revert to v2?
Because this problem started with the models_api requirement of ECA v.3.
Thanks- π©πͺGermany jurgenhaas Gottmadingen
I wish I could reproduce this. I have Drupal 11.2 and around 100 contrib modules enabled. And this problem doesn't happen to me. So, my suspicion is that some (maybe exotic) contrib module is doing something that triggers this, and it only seems to be related to modeler API but may be caused by something else.
To further work on this, we would have to find the route cause of this. For that, you would have to start with a vanilla Drupal 11.2 installation, add Modeler API, ECA, and BPMN.io and enable them all. The problem should not be present. Then you may want to enable more of your modules one by one, and always run
drush cr
after enabling another new module. At some point, the circular exception may show up again. Then we would want to know which new module caused this. At that point we can try if we can reproduce this with that module. - π―π΄Jordan Rajab Natshah Jordan
I will follow up with this.
you may want to enable more of your modules one by one, and always run drush cr after enabling another new module. At some point, the circular exception may show up again.
Thanks, JΓΌrgen, for the hint instruction.