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.
#2084463: Convert contextual links to a plugin system similar to local tasks/actions landed, so now we have some stuff to be busy with... Let's see our fails for a start with an empty patch.
Comment | File | Size | Author |
---|---|---|---|
#13 | contextual-links-13.patch | 4.53 KB | Gábor Hojtsy |
#13 | interdiff.txt | 3.59 KB | Gábor Hojtsy |
#11 | contextual-links-11.patch | 953 bytes | Gábor Hojtsy |
#10 | interdiff.txt | 953 bytes | Gábor Hojtsy |
#10 | contextual-links-10.patch | 6.61 KB | Gábor Hojtsy |
Comments
Comment #2
Gábor HojtsyA quick start at this. Of course contextual links lack title replacement patterns (for now), to be added back in #2120235: Regression: routing / tabs / actions / contextual links lack way to attach replacement arguments to UI strings so another core dependent todo added.
Comment #4
Gábor HojtsyFixed several code problems, missing use statements, misnamed class, attaching contextual link to the translation route instead of the base route, etc. Still no success in making it appear :/ At least there are less fails :) Can someone take a look? :) I need to drop this for today...
Comment #6
Gábor HojtsyNo, we do need to use the actual route of the translation page, so rolled that line back :) This will not work yet. I suspect there is something with the group identifier, but the group is not (well) documented at all. If I use 'views_edit_ui' as a group, then I'm starting to get other errors (about routes resolving to paths), so I suspect there may need to be some group matching.
Comment #7
Gábor HojtsyComment #9
Gábor HojtsyI looked at the code behind the lookup / grouping system more and indeed, we cannot just define a group like it is now, we'd need to alter the build arrays as well. Or figure out existing groups. Or both. I think this is a sizable DX step-back, or (hopefully) I'm just missing something :) [#8156943-142] is where I posted what I found.
Comment #10
Gábor HojtsyGoing to go with disabling contextual links testing for now. The current new implementation generates the contextual links but not in the proper group. This will allow us to move forward at least on other issues with a green HEAD (which is not the case now given the removed contextual support from hook_menu).
Comment #11
Gábor HojtsyCommitted #10, so HEAD will keep passing with 8.x core. Still need to fix so the actual contextual links show up again. They don't.
Comment #13
Gábor HojtsyHere is a stop-gap for the ones I know appear in core. Block, menu and views. Added plenty @todos to figure this out once it get better in core. As per @dawehner in #2084463-144: Convert contextual links to a plugin system similar to local tasks/actions, the same problem occurs for Views which is why views contextual links don't work in core now.
Comment #14
Gábor HojtsyYay, passed. Committed!
Comment #15
dawehnerWe could just introduce that the entity related group should always be called $this->entityType. For config translation this would than
just be a derivative plugin that defines one contextual translate link for all available translatable entity types.
Comment #16
Gábor HojtsyYeah that is an option yes :) I think in our case views was the exception for some reason. I think since views only have a UI with views_ui, calling the contextual group views_ui_* does not have a lot of advantage. OTOH Views has multiple groups, so maybe the rule needs to be "the most important / default frontend contextual group" or something like that :)
Comment #17
Gábor Hojtsy@dawehner: opened #2134841: Contextual link group names are not predictable for that suggestion :)