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.
Updated: Comment #0
Problem/Motivation
From #2021111-20 : Add a ConfigFactoryInterface for ConfigFactory
@alexpott said
Personally I think we should do this in two steps - get the interface in and the config factory using it - and then do the type hinting changes.
Proposed resolution
#2021111: Add a ConfigFactoryInterface for ConfigFactory has added ConfigFactoryInterface use it for typehinting.
Remaining tasks
Create a patch.
User interface changes
None
API changes
It'll break all the patches using ConfigFactory as a param.
Comment | File | Size | Author |
---|---|---|---|
#57 | config_factory_interface-2184231.patch | 1.59 KB | dawehner |
#52 | interdiff.txt | 2.04 KB | Xano |
#52 | drupal_2184231_51.patch | 119.51 KB | Xano |
#34 | interdiff.txt | 1.17 KB | jibran |
#28 | interdiff.txt | 3.19 KB | dawehner |
Comments
Comment #1
jibran:/
Comment #2
dawehner#2186845: ConfigInstaller should expect a ConfigFactoryInterface not a ConfigFactory. was a duplicate, working on converting all places, puh!
Comment #3
dawehnerThere we go.
Comment #5
jibranhmmm
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 268435456 bytes) in /var/lib/drupaltestbot/sites/default/files/checkout/core/lib/Drupal/Core/Database/Connection.php on line 336
Fixed.PHP Fatal error: Call to undefined method Mock_ConfigFactoryInterface_a6b9bd50::getMock() in /var/lib/drupaltestbot/sites/default/files/checkout/core/modules/language/tests/Drupal/language/Tests/LanguageNegotiationUrlTest.php on line 86
Comment #6
jibranSorry for the incomplete revert here is complete revert of unwanted change.
Comment #9
jibranAgain :(
Comment #10
jibran6: config_factory-2184231-6.patch queued for re-testing.
Comment #11
jibranNow the patch is green and before we can start reroll bingo on this patch :D. @alexpott and @dawehner thinks the patch is causing memory limit issue. So how are we going to fix it? Please share some points.
Comment #12
dawehnerI cannot think of something which causes the memory issue in this patch. This is either a tip of the iceberg or a random failure.
Comment #13
dawehnerRerolled.
Comment #15
Github sync CreditAttribution: Github sync commentedjibran opened a new pull request for this issue.
Comment #16
jibranInterdiff at https://github.com/jibran/drupal/commit/a261f132af2a1edcdf5649a599e5cbdd...
Comment #17
Github sync CreditAttribution: Github sync commentedlarowlan posted a new comment on https://github.com/klausi/drupal/pull/17#discussion_r9571902
Path: core/tests/Drupal/Tests/UnitTestCase.php
I like what you've done here and want to test comments back on d.o
Comment #18
damiankloip CreditAttribution: damiankloip commentedThis can just use getMock() directly now. No need to disable the constructor.
Otherwise this looks fine - just straight forward find replacing for the interface.
Comment #19
dawehnerRerolled. Thank you for your review.
Comment #21
jibran19: config_factory_interface-2184231-19.patch queued for re-testing.
Comment #23
jibranPatch failed due to invalid merge conflict resolution in
core/lib/Drupal/Core/Config/ConfigInstaller.php
.Comment #24
dawehnerSetting to RTBC now.
Comment #26
jibranAnother invalid merge conflict resolution in
Comment #28
dawehnerUps.
Comment #29
jhodgdonJust a note: when you have "@return $this" you do not need a description under it, and in fact I think it makes the docs less maintainable and less readable in this case.
Comment #30
Les LimSince this touches roughly a billion files anyway, could we take this opportunity to fix typehinting for a few more classes? Each of these classes will also need their own mega-patches otherwise:
QueryFactoryInterface
ModuleHandlerInterface
EntityManagerInterface
LanguageManagerInterface
Comment #31
jibranWell this is a good idea but if we want to fix it then there is only a single way to do it change everything separately because once the tests starts failing then re-rolling, merging and fixing the tests will be a hell. So IMHO we should create separate issues for all the interfaces.
@jhodgdon please advise do you want us to revert the
@return $this
change and handle it in separate doc issue or just removing the description line below@return $this
will be fine.Comment #32
Les Lim@jibran: But since each of these patches have to touch so many files, isn't it going to be still going to be hell each time we do this? And each time one of these patches is committed, other patches will need re-rolls. I'm hoping we save future work by doing this as few times as possible.
Comment #33
jhodgdonI would suggest removing the description docs below @return $this. IMO @return $this is a lot clearer than what is currently in the docs there.
Comment #34
jibranFixed #33.
@Les Lim
Yes
Yes
You are right but from my experience in core we clean up api step by step. It is more maintainable and get committed more quicker then one giant a** patch. So please create separate issues.
Comment #35
dawehner@Les Lim
In case we would just fix a couple of places I would totally agree but we have a >100k patch which per construction are hard to review, so let's try to move forward.
Comment #36
alexpottThis is wrong
Nope
Reroll gone bad? I have not checked the patch throughly. But I suspected there are more problems.
Comment #37
dawehnerGr, damnit I want that to be in for my contrib project.
Comment #38
jibranDescription missing.
Newline missing.
@param name missing.
Comment #41
jibran@dawehner had a real off day with this patch. :)
Comment #43
jibran41: config_factory_interface-2184231-41.patch queued for re-testing.
Comment #44
jhodgdonThe docs in this patch are still missing descriptions on a few @return tags. They are required except in the case of "@return $this", in which case they should be removed (which this patch doesn't do either in all cases). The ones I saw were right at the top of the patch file, in class Drupal and ConfigFactoryInterface.
I also think this docs change is not great on the constructor for ConfigStorageController:
"The entity info for the entity type" is not really better than "The entity type definition" IMO. "entity info", what is that? I don't think the parameter rename is appropriate either.
Comment #45
XanoDone.
I removed this change as it seemed out of scope. We should probably not delay this issue because of it.
I also merged in the changes from #2191911: Improve @param and @return variable types for \Drupal\Core\Config\ConfigFactoryInterface.
Comment #46
dawehner--dawehner
Comment #47
tim.plunkettThis issue is not "clean up all docblocks in files where we need to switch ConfigFactory typehints to ConfigFactoryInterface". Please remove all of this and let's just get this small, simple, and well-scoped issue in.
Comment #50
jibran45: drupal_2184231_45.patch queued for re-testing.
Comment #52
XanoI removed the code quoted in #47 as that was added after some confusion with #2191911: Improve @param and @return variable types for \Drupal\Core\Config\ConfigFactoryInterface.
Comment #53
tim.plunkettHeh, turns out that was mostly at the top of the file. I had just given up and stopped scrolling thinking it was throughout.
That looks much better, thanks for the quick turnaround!
Comment #54
jibranThanks @Xano for the fixes. Thank you @tim.plunkett for the RTBC.
I think it is qualified as 'avoid commit conflicts tag'.
Comment #55
alexpottCommitted 932e4d9 and pushed to 8.x. Thanks!
Comment #56
dawehnerThank you, especially jibran for fixing the horrible merges.
Comment #57
dawehner:( We/I should have rechecked it :(
Comment #58
dawehner.
Comment #59
ianthomas_ukLooks good.
Comment #60
alexpottCommitted 094c6e8 and pushed to 8.x. Thanks!