- last update
10 months ago 6 pass, 4 fail - Issue created by @searosin
The last submitted patch, filelog.patch, failed testing. View results →
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- 🇭🇺Hungary searosin
The new patch fixes some coding standards bugs, and tests have been adapted to the new method.
- last update
10 months ago 28 pass - Status changed to Needs review
10 months ago 3:08pm 25 January 2024 - Status changed to Needs work
10 months ago 3:13pm 28 January 2024 - 🇺🇦Ukraine mr_fenix
I cannot confirm the issue after a basic installation of Drupal with the standard profile, version 10.2.2, and PHP version 8.2.14. Here are the steps I followed:
1. Installed and enabled Filelog module, version 2.1.1.
2. Cleared the cache.
3. Then, I removed the Contact module.
4. Cleared the cache again.
5. Checked admin/reports/dblog log
No errors were found as described in the issue.Therefore, maybe it's better to identify the root of the problem before merging this, as it might turn out that instead of the Filelog module, the Token module or some other module needs to be fixed.
Moreover, it seems the 'cache_tags.invalidator' service should not depend on 'plugin.manager.block', because after running the Drush command:
drush ev ' $database = \Drupal\Core\Database\Database::getConnection(); $service_name = "token"; $partial_cid = "service_container:%"; // It is supposed the cache_container table is used. $query = $database->select("cache_container", "c") ->fields("c", ["data"]) ->condition("cid", $partial_cid, "LIKE"); $result = $query->execute(); if ($record = $result->fetchAssoc()) { $container = unserialize($record["data"]); if (isset($container["services"][$service_name])) { $service_definition = unserialize($container["services"][$service_name]); echo var_export($service_definition, TRUE); } else { echo "Service $service_name not found in the cache_container.\n"; } } else { echo "No matching $partial_cid entry found in cache_container.\n"; }'
result was:
array ( 'class' => 'Drupal\\Core\\Utility\\Token', 'arguments' => (object) array( 'type' => 'collection', 'value' => array ( 0 => (object) array( 'type' => 'service', 'id' => 'module_handler', 'invalidBehavior' => 1, ), 1 => (object) array( 'type' => 'service', 'id' => 'cache.default', 'invalidBehavior' => 1, ), 2 => (object) array( 'type' => 'service', 'id' => 'language_manager', 'invalidBehavior' => 1, ), 3 => (object) array( 'type' => 'service', 'id' => 'cache_tags.invalidator', 'invalidBehavior' => 1, ), 4 => (object) array( 'type' => 'service', 'id' => 'renderer', 'invalidBehavior' => 1, ), ), 'resolve' => true, ), 'arguments_count' => 5, )
So, there is no 'plugin.manager.block' service and it should not be in your installations either.
Can anyone experiencing this issue post result of the command here to confirm it?
- 🇭🇺Hungary searosin
To reproduce the issue, Layout Builder module must also be enabled.
(Corrected) steps to reproduce
- Install Drupal 10.2 with Standard profile
- Enable Layout Builder module
- Enable Filelog module
- Enable any module
- Uninstall any module
In this case the error is as follows:
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "token", path: "token -> cache_tags.invalidator -> plugin.manager.block -> logger.channel.default -> logger.factory -> logger.filelog". in Drupal\Component\DependencyInjection\Container->get() (line 147 of core/lib/Drupal/Component/DependencyInjection/Container.php).
- Status changed to Needs review
10 months ago 1:56pm 29 January 2024 - Status changed to RTBC
10 months ago 10:11pm 29 January 2024 - 🇺🇦Ukraine mr_fenix
I managed to reproduce it stably and the patch works perfectly. Thanks!
Here is the dependent service that is implemented using the interface
https://git.drupalcode.org/project/drupal/-/blob/10.2.2/core/modules/lay...It also seems that the error could be interpreted as a bug in the Drupal core, or could even be interpreted as a flaw in the Drupal dependency injection concept.
- 🇮🇳India ashetkar
I have also faced "Circular reference detected for service" after 10.2 upgrade and patch #4 worked fine. Thanks @searosin.
- Status changed to Needs work
4 months ago 3:52pm 1 August 2024 - Status changed to Needs review
4 months ago 4:50pm 1 August 2024 - First commit to issue fork.
-
astonvictor →
committed 90045df7 on 3.0.x
Issue #3416342 - Update token service
-
astonvictor →
committed 90045df7 on 3.0.x
- Status changed to Fixed
3 months ago 12:22pm 22 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.