- Issue created by @NikolaAt
- last update
about 1 year ago 29,722 pass - Status changed to Needs work
about 1 year ago 4:27pm 25 January 2024 - šŗšøUnited States smustgrave
Believe we need to investigate the steps that trigger this. Could be masking a larger issue
Will need test coverage as well.
- šŗšøUnited States cmlara
Not in a spot to create a test at the moment however here is a real world sample from a ServiceProvider: This can be made into a test by injecting config.storage.active and calling readMultiple([]);
public function register(ContainerBuilder $container): void { /** @var \Drupal\Core\Config\StorageInterface $config_storage */ $config_storage = $container->get('config.storage.active'); $entity_config_names = $config_storage->listAll('some_module.match_nothing'); $configured_entities = $config_storage->readMultiple($entity_config_names); }
The reason config.storage does not see this is it attempts to generate a cache tag for each requested entry, when it is empty no cache tags are generated and when no cache tags are generated config.storage does not try and call inner storage. This appears to be more accidental around making sure cache tags exist rather than intentionally protecting DatabaseStorage::readMultiple() from an empty read.
StorageInterface::readMultiple() does not specify it must be a non-empty-array making
readMultiple([])
valid per the interface.Clearing need steps to reproduce as that is documented.
- Merge request !8764Resolve #3416525 "Databasestorage readmultiple throws" ā (Closed) created by cmlara
- Status changed to Needs review
8 months ago 4:09am 15 July 2024 - Status changed to RTBC
8 months ago 6:43pm 21 July 2024 - šŗšøUnited States smustgrave
Perfect test-only job has already been ran https://git.drupalcode.org/issue/drupal-3416525/-/jobs/2118936
Thanks also for adding the steps and summary update. Confirmed solution matches what's in the MR.
Code wise the early return looks fine.
Believe this may be good.
- Status changed to Needs work
7 months ago 9:43am 4 August 2024 - š¬š§United Kingdom alexpott šŖšŗš
Can the test be added to \Drupal\KernelTests\Core\Config\Storage\ConfigStorageTestBase::testCRUD() and then all config storage types will be tested for the same behaviour.
- Status changed to Needs review
7 months ago 6:00am 7 August 2024 - šŗšøUnited States cmlara
Trivial change to implement #9
Did switch from an assertEquals() to assertSame() while migrating to be slightly more type strict.
The test only script appears to be broken when changing a base class.
$ $CI_PROJECT_DIR/.gitlab-ci/scripts/test-only.sh ā¹ļø Changes from 2e311a8d3fb7015cf2fa3615e3843caf0d90a4af core/lib/Drupal/Core/Config/DatabaseStorage.php core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php If this list contains more files than what you changed, then you need to rebase your branch. 1ļøā£ Reverting non test changes grep: warning: * at start of expression grep: warning: * at start of expression ā©ļø Reverting core/lib/Drupal/Core/Config/DatabaseStorage.php grep: warning: * at start of expression 2ļøā£ Running test changes for this branch Exiting with EXIT_CODE=0
- šŗšøUnited States smustgrave
Tried rebasing but test-only still wasn't showing much. So started a test-only branch to see if that's any better.
- Status changed to RTBC
7 months ago 9:35pm 7 August 2024 - šŗšøUnited States smustgrave
https://git.drupalcode.org/issue/drupal-3416525/-/jobs/2374011 shows the test coverage.
- š¬š§United Kingdom catch
Committed/pushed to 11.x and cherry-picked back through to 10.3.x, thanks!
- Status changed to Fixed
7 months ago 12:44am 10 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.