Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
TypedConfigManagerInterface is not used everywhere - sometimes TypedConfigManager is which makes it impossible to swap out the service.
Plus the interface and the class documentation are not correct.
Comment | File | Size | Author |
---|---|---|---|
#15 | 2271967-psr4.patch | 20.1 KB | alexpott |
#13 | 2271967-psr4.patch | 20.1 KB | Jose Reyero |
#10 | 2271967.10.patch | 20.64 KB | alexpott |
#10 | 8-10.patch | 4.43 KB | alexpott |
#8 | 2271967-8.patch | 25.44 KB | amitgoyal |
Comments
Comment #1
alexpottThe attached patch changes all typehints on TypedConfigManager to TypedConfigManagerInterface apart from COnfigImporter because there is another patch doing that.
If also changes the TypedConfigManager/TypedConfigManagerInterface to match the function signature of PluginManagerBase/TypedDataManager to make consildation at some point in the future a bit simpler. This has the added benefit of making the data returned from the TypedConfigManager since the parent is now set in the definitions.
Comment #2
Jose Reyero CreditAttribution: Jose Reyero commentedThis looks pretty good to me.
Only one issue. The documentation of TypedConfingManagerInterface::createInstance() method doesn't match because of that $config array. But instead of fixing the documentation I'd rather update the code so it is still more consistent with TypedDataManager.
Also on the implementation itself there's one comment that is wrong, where it reads:
it should say
that is just the same as TypedDataManager.
I think the updated code also clears up the difference between 'data definition' and 'type definition'.
Attached updated patch and inter-diff.
There are other consistency issues, like that DataDefinition objects, and the 'list class' that were changed in TypedDataManager, but unfortunately not in TypedConfigManager, but I think that will better go in a follow up patch, since this one only changes internal parameters, but the other may have a bigger impact
Comment #3
alexpott@reyero - nice changes! One small thing...
This can be removed.
Comment #4
Jose Reyero CreditAttribution: Jose Reyero commented@alexpott,
Right, updated patch with that change
This is the inter-diff.
Comment #6
amitgoyal CreditAttribution: amitgoyal commentedPlease review updated patch as the last patch #4 was not getting applied in current 8.x branch (2d3d33b48f901b1fedd9ad00f176e3bff17056ec). Below was the error,
I have made the given changes in core/lib/Drupal/Core/Config/ConfigManager.php and now it applies successfully.
Comment #7
Jose Reyero CreditAttribution: Jose Reyero commented@amitgoyal,
Not sure I get it, the patch was much bigger than #6.
Anyway, I'll be re-rolling the patch in #4, for any core updates, and also fixing the issues found by the test
Comment #8
amitgoyal CreditAttribution: amitgoyal commented@Jose - Oh! I just provided the changes in file core/lib/Drupal/Core/Config/ConfigManager.php in my last patch at #6.
Attaching here the complete patch (#4 + #6).
Not very sure about the issues found by automated test script. So please guide me or fix them. Thanks!
Comment #9
Jose Reyero CreditAttribution: Jose Reyero commented@amitgoyal,
I think the only issue with the patch is that it expects 'parent' and 'name' to be part of the definition array. But they are not anymore (because of #3), nor they need to be there,
So this is just the test making a wrong assumption, just need to fix the test.
Comment #10
alexpottreyero - are you sure they shouldn't be?
Here's a patch reverting the changes to core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php
Comment #12
Jose Reyero CreditAttribution: Jose Reyero commented@alexpott,
Yes, they shouldn't.
They used to be passed in the same parameters array , but not anymore, see
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21TypedData...
Note the only tests that fail are the ones that assume they are into the array, not the others, that actually test schema functionality.
Comment #13
Jose Reyero CreditAttribution: Jose Reyero commentedRe-rolled the patch in #10 for PSR-4 update.
Comment #15
alexpottre-uploading patch to preserve test failure for #2276213: Random fail in ApcuBackendUnitTest due to fast test bot.
Comment #16
Jose Reyero CreditAttribution: Jose Reyero commentedI think this is ready.
We need this committed to move on with #1928868: Typed config incorrectly implements Typed Data interfaces
Comment #17
Gábor HojtsyI agree this is a much needed cleanup. It looks like API changes but its documenting the API better with the expected methods documented on the interface instead of just being there :D
Comment #19
Gábor Hojtsy15: 2271967-psr4.patch queued for re-testing.
Comment #21
catchCommitted/pushed to 8.x, thanks!
Comment #22
vijaycs85nice improvement and the interface looks much better now.