Updated: Comment #N
Problem/Motivation
The config translations module (and contrib modules) needs a way to provide more metadata about config data types. There is no alter hook to enhance existing the existing data types.
Proposed resolution
Add a hook to the TypedConfigManager
Remaining tasks
-
User interface changes
-
API changes
-
Related Issues
#2100221: Refactor form element into a class
Original report by @webflo
-
Comment | File | Size | Author |
---|---|---|---|
#4 | add-hook_config_typed_info_alter-2100223-4.patch | 8.08 KB | webflo |
#4 | add-hook_config_typed_info_alter-2100223-1-4.interdiff.txt | 8.07 KB | webflo |
#1 | add-hook_config_typed_info_alter-2100223-1.patch | 3.31 KB | webflo |
Comments
Comment #1
webflo CreditAttribution: webflo commentedComment #2
vijaycs85Good work @webflo. Few minor code review stuffs below. Overall, looks OK to me.
Can we add the comment for this property please?
isn't it hook_config_typed_data_info_alter() ? Also wondering, would this protected method add any value? can't we do the assignment in construction itself?
Comment #4
webflo CreditAttribution: webflo commentedFixed tests and added the changes from comment #2
I renamed the hook to hook_config_type_info similar to hook_data_type_info_alter.
Comment #5
webflo CreditAttribution: webflo commentedGo testbot!
Comment #6
tstoecklerThanks, looks good.
Comment #8
vijaycs85#4: add-hook_config_typed_info_alter-2100223-4.patch queued for re-testing.
Comment #9
Gábor HojtsyBack to RTBC since core was failing with a random fail.
Comment #9.0
webflo CreditAttribution: webflo commentedUpdate
Comment #9.1
webflo CreditAttribution: webflo commentedFixed typo
Comment #10
webflo CreditAttribution: webflo commentedWe resolve this issue in config_translation itself and extend the existing TypedConfigManager to enhance the config type definition.
Comment #11
alexpottAfter discussing this @webflo in Prague I don't think that we should be providing a method to alter config typed data metadata as I don't think we should allow modules to be altering such fundamental metadata just to enhance it. Apparently the config translation ui is already extending the locale type data manager so we could decorate the data here instead. That way we won't have yet another alter that can completely pollute / change the meaning of stuff from under our feet.
Comment #12
Gábor HojtsySure.
Comment #13
tstoecklerI would like to get some more reasoning for this. Specifically, I don't understand how this is not viable, if hook_data_type_info_alter() is. Thanks!
Comment #14
Gábor HojtsySeems to me like the last two sentences from @alexpott were reason enough? :)
Comment #15
tstoecklerWell, that could still use some clarification for noobs like me :-)
I was in the middle of posting a more detailed answer, but I ended quoting the entire last two sentences in #11. So in short: I don't understand at all, what is meant.
Thanks, guys!
Comment #15.0
tstoecklerAdded _no_
Comment #16
mariancalinro CreditAttribution: mariancalinro commentedI'll close this as won't fix, this seems to be the consensus.