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.
Problem/Motivation
there is some ugly form alter since there is no api
Proposed resolution
make a less ugly operations alter
implement #2004408: Allow modules to alter the result of EntityListController::getOperations
or something that results from #1839516: Introduce entity operation providers
Remaining tasks
make it work
User interface changes
No.
API changes
Yes.
Related
#2019831: people and roles page broken
follow-ups
Comment | File | Size | Author |
---|---|---|---|
#23 | config_translation-alter-2004428-22.patch | 3.44 KB | YesCT |
#23 | interdiff-17-22.txt | 449 bytes | YesCT |
#17 | config_translation-alter-2004428-17.patch | 3.4 KB | YesCT |
#8 | config_translation-alter-2004428-8.patch | 1.59 KB | YesCT |
#8 | interdiff-4-8.txt | 2.15 KB | YesCT |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedadmin/structure/taxonomy
Comment #2
YesCT CreditAttribution: YesCT commentedthis passes because we dont have test for taxonomy listing page to see if the translate link is in the operations drop button
Comment #3
YesCT CreditAttribution: YesCT commentedtaxonomy is not a good example in this case. (page is broken for config trans even without this patch)
trying a different one.
Comment #4
YesCT CreditAttribution: YesCT commentedI put back in the taxonomy one.
I took out formats (admin/config/content/formats/)
also fixed the name of the hook (to be operation not operations). See #2004408-7: Allow modules to alter the result of EntityListController::getOperations
Comment #6
YesCT CreditAttribution: YesCT commentedoops. that was totally the wrong files to upload here.
Comment #8
YesCT CreditAttribution: YesCT commentedI put back the formats,
took out the contact message...
it worked!!!
I took out the test word so it just says Translate after testing.
Comment #10
YesCT CreditAttribution: YesCT commentedthe other things did not work here because they do not use the entity list controller.
next steps: grep for "list" =
in the annotations.
then look for issues for lists that do not use the entity list controller.
Find those issues if there are some for converting and link them
Comment #11
Schnitzel CreditAttribution: Schnitzel commented#8: config_translation-alter-2004428-8.patch queued for re-testing.
Comment #13
YesCT CreditAttribution: YesCT commentedrelated #2011332: Add alter for adding config translation tab
Comment #14
Gábor Hojtsy#2004408: Allow modules to alter the result of EntityListController::getOperations now committed, so GO!
Comment #15
YesCT CreditAttribution: YesCT commentedI'll go!
Comment #16
YesCT CreditAttribution: YesCT commentedok. the patches above are a little messed up, because they are really an interdiff to 1 in some cases.
anyway,
grep -R '"list" = ' * 2>&1 | grep -v -i permission
lists those with the list controller.
(oh! ag is nice. brew install ag I think)
------------
I have more notes to organize and post, but for now, I need help with the below so I'm saving this comment. :)
mabye similar to #2004690: taxonomy page broken ,
the roles (and user) page is broken with:
LogicException: Unable to parse the controller name "user_admin". in Drupal\Core\Controller\ControllerResolver->createController() (line 91 of /Users/ctheys/foo/drupal/core/lib/Drupal/Core/Controller/ControllerResolver.php).
The website has encountered an error. Please try again later.
Do we have an issue for that?
What core issue broke it?
[edit: #2019831: people and roles page broken ]
Comment #17
YesCT CreditAttribution: YesCT commentedThis starts over, so no interdiff.
takes out alters for listings that work with the new hook.
Notes for myself:
left in
because, for now, it's helping me know what is responsible for putting Translate in the operations.
badabumm (has a list controller) http://localhost/drupal/admin/structure/custom-blocks
Translate (has a list controller) http://localhost/drupal/admin/structure/block
badabumm (has a list controller) http://localhost/drupal/admin/structure/contact
badabumm (has a list controller) http://localhost/drupal/admin/config/media/picturemapping
badabumm (has a list controller) http://localhost/drupal/admin/config/user-interface/shortcut/
badabumm (has a list controller) http://localhost/drupal/admin/structure/taxonomy
broken (has a list controller) http://localhost/drupal/admin/people/roles Notice: Undefined offset: 4 in _menu_translate() (line 766 of core/includes/menu.inc).
Translate http://localhost/drupal/admin/config/content/formats
Translate http://localhost/drupal/admin/structure/views
Translate http://localhost/drupal/admin/structure/menu
double checking the list from
function config_translation_config_translation_group_info() {
checking these too.
these are forms, but not listings that would get a Translate operation link.
no translate tab admin/config/development/maintenance
Translate tab admin/config/system/site-information
Translate tab admin/config/people/accounts
config_translation_form_alter()
still has:
if ($form_id == 'filter_admin_overview') {
'href' => 'admin/config/content/formats/' . $id . '/translate',
if ($form_id == 'user_admin_roles') {
'href' => 'admin/people/roles/edit/' . $id . '/translate',
if ($form_id == 'block_admin_display_form') {
'href' => 'admin/structure/block/manage/' . $id . '/translate',
config_translation_page_alter()
still has:
'href' => 'admin/structure/views/view/' . $id . '/translate',
'href' => 'admin/structure/menu/manage/' . $id . '/translate',
I'll be back at this later.
I'm a bit confused because it looked like block has a list controller, and I thought that would work with the new way...
So I need to figure out how the list controller interacts with this.
Comment #18
Gábor HojtsyI don't think we have issues about list controllers to be added to modules that don't use them yet. Individual issues may exist. I'm not sure we need yet another META issue for that :D
Comment #19
YesCT CreditAttribution: YesCT commentedI'm not sure how to get menu to be nicer and use the config_translation_entity_operation_alter().
See #2019647: Use EntityListController for menus for discussion on how there already *is* a menu list controller.
Comment #20
YesCT CreditAttribution: YesCT commentedhere are all the ListControllers
Menu, Views
are in there, and were missing from the grep for "list" annotation from before. So they have controllers, but the hook isn't working on them.
I dont see the format in there at all. We need look to see if there is an issue for it to use a ListController
Comment #21
andypostMaybe better to make this conditional - only show the link when entity support translation or (translation enabled)
Comment #21.0
YesCT CreditAttribution: YesCT commentedadded entity operations api issue
Comment #22
andypostAlso patch needs to make sure that
parent::getOperations()
called from each controllerComment #23
YesCT CreditAttribution: YesCT commentedI dont think there is a tag that config is translatable.
I think it all is.
We use the schema's to decide what parts are translatable.
Content translation on the other hand is different, in core and does check.
---
This does add the options andypost asked for in irc.
Comment #24
YesCT CreditAttribution: YesCT commentedI tried the suggestion from #22
I checked for $operations = parent::getOperations($entity); and it's in both the menu and the view list controller.
So adding that wont help.
Comment #26
Gábor Hojtsy#23: config_translation-alter-2004428-22.patch queued for re-testing.
Comment #27
Gábor HojtsyI committed this one! We should work on followups (in core) to make sure the others can be eliminated. We should also increase test coverage in #2004710: Add tests for block, menu, vocabulary and views listings.
Comment #28
YesCT CreditAttribution: YesCT commentedHere are three follow-ups.
any others needed?
Comment #28.0
YesCT CreditAttribution: YesCT commentedadded issue about the roles.
Comment #29.0
(not verified) CreditAttribution: commentedadded follow-ups
Comment #30
YesCT CreditAttribution: YesCT commentedfor blocks.
#2035407: Finish Less ugly operations altering for Blocks
updated issue summary.
Comment #30.0
YesCT CreditAttribution: YesCT commentedadded follow-up for remaining alter removal (for blocks)