Problem/Motivation
There is still lots of information to duplicate in the *.config_translation.yml file that people can avoid or even entirely skip for their config entities. Figure out how we can automate most (or all) of that. This is dependent on #2083615: Use links annotation for config entity URI like for content entities and #2085907: Ensure all configuration entities have an Edit/Configure tab by default, so we get default edit tabs and route/path information from entity info.
Proposed resolution
Generate the entity mapper data by querying entity information and ignore the menu tabbing stuff entirely, since core would already do it.
Remaining tasks
Do it.
User interface changes
None.
API changes
*.config_translation.yml would change. Possible that something would change for config entity definition(?).
Related Issues
#2085907: Ensure all configuration entities have an Edit/Configure tab by default and #2083615: Use links annotation for config entity URI like for content entities.
Comment | File | Size | Author |
---|---|---|---|
#47 | 2085925-config-trans-dx-47.patch | 20.36 KB | tstoeckler |
#47 | 2085925-config-trans-dx-interdiff-45-47.txt | 859 bytes | tstoeckler |
#45 | 2085925-config-trans-dx-45.patch | 19.84 KB | tstoeckler |
#45 | 2085925-config-trans-dx-interdiff-43-45.patch | 5.56 KB | tstoeckler |
#43 | 2085925-config-trans-dx-43.patch | 16.46 KB | tstoeckler |
Comments
Comment #1
Gábor HojtsyThis would be a starter patch.
Comment #2
YesCT CreditAttribution: YesCT commentedGlad to see a start here. I was thinking of trying to get something here to show that #2085907: Ensure all configuration entities have an Edit/Configure tab by default would work now that #1834002: Configuration delete operations are all over the place is in.
Comment #3
Gábor HojtsyAll the dependencies are in, delete tabs, edit tabs and URI patterns, so this may be a step forward. @YeCT can you help figure out how to make this work with the entity manager service instead of global functions? :)
I think we may be able to generate the whole list of entities in a function ourselves and entirely ignore needing to define them in the config_translation.yml :) That would be ideal. Eg. go through all config entity types that have the links { 'edit-link' = ... } annotation and automatically register those with the config translation UI. Our alter hooks would still let people to opt out of it later on. That would mean if you have a config entity implemented with the best practices and you have config schema, you **automatically** would get a config translation UI for your stuff, which is IMHO pretty nice :)
Comment #5
Gábor HojtsyThe link key name is edit-form not edit-link :D
Comment #7
Gábor HojtsyMore complete patch that includes #2093007: drupalPost => drupalPostForm() in tests and other core fails for now. That should be committed first to ensure a passing 8.x-1.x branch.
Comment #9
tstoecklerHere's a straight re-roll for startes as the drupalPostForm() patch was committed. This will not pass, but then I can provide an interdiff on top of this.
Comment #10
Gábor Hojtsy#2093007: drupalPost => drupalPostForm() in tests and other core fails landed now, so most of this can be removed. Since the last patch includes that too :D
Comment #11
Gábor HojtsyComment #13
Gábor Hojtsy#9: 2085925-config-trans-dx-9.patch queued for re-testing.
Comment #14
tstoecklerI hope this passes...
Comment #16
tstoecklerHere we go. The previous patch failed because I passed the entity manager into the constructor at the wrong spot.
Also I added a typehint for $entity_manager in ConfigEntityMapper::__construct() after creating the interdiff(s) and couldn't be bothered to roll new ones. I promise that's the only thing I changed outside of the interdiff(s).
Because I had to change the indentation of a whole chunk of code I also provided an interdiff with the "no-whistespace" option of Git.
This should be close to done, I hope.
Comment #18
Gábor Hojtsy. missing :)
. missing :)
We can actually do t('@label @entity') :) Maybe not very useful, but I can imagine languages where the order need to be swapped.
Already defaults to FALSE, so I would avoid this magic value :) If the local task is also default, etc. remove those as well IMHO.
Comment #19
tstoecklerFixed #18.
Also: Really, Drupal?!? language_manager, but entity.manager? ...
Comment #21
tstoecklerPretty please, little bot?!
Comment #22
tstoeckler/me no like empty patch
(interdiff should be correct, though)
Comment #24
Gábor Hojtsy#22: 2085925-config-trans-dx-22.patch queued for re-testing.
Comment #26
tstoecklerStraight re-roll. Not testing yet, as it will fail in the same way as before.
Comment #27
Gábor HojtsyComment #28
dawehnerOOOOH, this is nice!
Oh @label is not replaced on here?
Comment #29
Gábor Hojtsy@label is replaced later on.
Comment #30
tstoecklerHere we go. *crossingfingers*
Comment #31
tstoecklerSelf-review of the interdiff:
This should actually been part of the re-roll above, but I missed it there.
Yeah, this part is pretty important... *slapsforehead*
Comment #33
tstoecklerOMFG, the constructor change took an infinite amount to figure out. I need more sleep...
Comment #35
tstoeckler#33: 2085925-config-trans-dx-32.patch queued for re-testing.
Comment #37
tstoecklerHere we go. This fixes one issue and also introduces some debug code for the bot in case this still fails.
Comment #39
tstoecklerI rerolled this for the latest commits.
Comment #41
tstoecklerIf this passes, I owe @vijaycs85 a very large amount of tea/beer/...
Comment #43
tstoecklerThanks @GáborHojtsy for helping with the actual fail.
Comment #45
tstoecklerHere we go. SimpleTest decided to work again on my laptop, so I hope I won't have to spam this issue as much. At least one test case passes with this, let's see...
Comment #47
tstoecklerSo this passes completely on my system.
Comment #48
Gábor HojtsyYay, committed this one except the debug stuff :D http://drupalcode.org/project/config_translation.git/commit/ffd5a2ef0e67...
Comment #49
tstoecklerAwesome! See you in #2095837: Automatically discover mappers from config forms
Comment #51
Gábor HojtsyRetroactive tagging.
Comment #52
Gábor Hojtsy