Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT’s picture

Status: Active » Needs review
FileSize
1.22 KB

admin/structure/taxonomy

Error message
    Notice: Undefined offset: 3 in _menu_translate() (line 757 of core/includes/menu.inc).
    Symfony\Component\Routing\Exception\ResourceNotFoundException: in Drupal\Core\Routing\RouteProvider->getRouteCollectionForRequest() (line 122 of /Users/ctheys/foo/drupal/core/lib/Drupal/Core/Routing/RouteProvider.php).
YesCT’s picture

this passes because we dont have test for taxonomy listing page to see if the translate link is in the operations drop button

YesCT’s picture

Status: Needs review » Needs work

taxonomy is not a good example in this case. (page is broken for config trans even without this patch)
trying a different one.

YesCT’s picture

Status: Needs work » Needs review
FileSize
688 bytes
3.85 KB

I 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

Status: Needs review » Needs work

The last submitted patch, operations_alter-2004408-7.patch, failed testing.

YesCT’s picture

Status: Needs work » Needs review
FileSize
2.18 KB
2.18 KB

oops. that was totally the wrong files to upload here.

Status: Needs review » Needs work

The last submitted patch, config_translation-alter-2004428-4.patch, failed testing.

YesCT’s picture

Status: Needs work » Needs review
FileSize
2.15 KB
1.59 KB

I put back the formats,
took out the contact message...
it worked!!!

I took out the test word so it just says Translate after testing.

Status: Needs review » Needs work

The last submitted patch, config_translation-alter-2004428-8.patch, failed testing.

YesCT’s picture

Status: Needs work » Needs review

the 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

Schnitzel’s picture

Status: Needs review » Needs work

The last submitted patch, config_translation-alter-2004428-8.patch, failed testing.

YesCT’s picture

Gábor Hojtsy’s picture

YesCT’s picture

Assigned: Unassigned » YesCT

I'll go!

YesCT’s picture

ok. 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

core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlockType.php: *     "list" = "Drupal\custom_block\CustomBlockTypeListController"
core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php: *     "list" = "Drupal\block\BlockListController",
core/modules/config/tests/config_test/lib/Drupal/config_test/Plugin/Core/Entity/ConfigQueryTest.php: *     "list" = "Drupal\Core\Config\Entity\ConfigEntityListController",
core/modules/config/tests/config_test/lib/Drupal/config_test/Plugin/Core/Entity/ConfigTest.php: *     "list" = "Drupal\Core\Config\Entity\ConfigEntityListController",
core/modules/contact/lib/Drupal/contact/Plugin/Core/Entity/Category.php: *     "list" = "Drupal\contact\CategoryListController",
core/modules/picture/lib/Drupal/picture/Plugin/Core/Entity/PictureMapping.php: *     "list" = "Drupal\picture\PictureMappingListController",
core/modules/shortcut/lib/Drupal/shortcut/Plugin/Core/Entity/Shortcut.php: *     "list" = "Drupal\shortcut\ShortcutListController",
core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php: *     "list" = "Drupal\taxonomy\VocabularyListController",
core/modules/user/lib/Drupal/user/Plugin/Core/Entity/Role.php: *     "list" = "Drupal\user\RoleListController",

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 ]

YesCT’s picture

Assigned: YesCT » Unassigned
Status: Needs work » Needs review
FileSize
3.4 KB

This starts over, so no interdiff.

takes out alters for listings that work with the new hook.

Notes for myself:
left in

+    'title' => t('Translate badabumm'),

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.

Gábor Hojtsy’s picture

I 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

YesCT’s picture

I'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.

YesCT’s picture

here are all the ListControllers

$ find core -name *ListController.php -print
core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php
core/lib/Drupal/Core/Entity/Controller/EntityListController.php
core/lib/Drupal/Core/Entity/EntityListController.php
core/modules/action/lib/Drupal/action/ActionListController.php
core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php
core/modules/block/lib/Drupal/block/BlockListController.php
core/modules/contact/lib/Drupal/contact/CategoryListController.php
core/modules/menu/lib/Drupal/menu/MenuListController.php
core/modules/picture/lib/Drupal/picture/PictureMappingListController.php
core/modules/shortcut/lib/Drupal/shortcut/ShortcutListController.php
core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyListController.php
core/modules/user/lib/Drupal/user/RoleListController.php
core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php

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

andypost’s picture

+++ b/config_translation.moduleundefined
@@ -271,6 +271,18 @@ function config_translation_config_translation_group_info() {
+function config_translation_entity_operation_alter(array &$operations, \Drupal\Core\Entity\EntityInterface $entity) {
+  $uri = $entity->uri();
+  $operations['translate'] = array(

Maybe better to make this conditional - only show the link when entity support translation or (translation enabled)

YesCT’s picture

Issue summary: View changes

added entity operations api issue

andypost’s picture

Also patch needs to make sure that parent::getOperations() called from each controller

YesCT’s picture

I 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.

YesCT’s picture

I 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.

Status: Needs review » Needs work

The last submitted patch, config_translation-alter-2004428-22.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Fixed

I 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.

YesCT’s picture

Issue summary: View changes

added issue about the roles.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

added follow-ups

YesCT’s picture

YesCT’s picture

Issue summary: View changes

added follow-up for remaining alter removal (for blocks)