Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT’s picture

Gábor Hojtsy’s picture

Status: Active » Needs review
FileSize
8.21 KB

Here is a patch which is complete to all config entities (at least those handled by config translation) *except* field instances, which need a local task derivative provider. Needs a little bit more time to do :)

Gábor Hojtsy’s picture

Ok I looked at the fields stuff, and that is a whole can of worms. I think YesCT also already has a bug about that, so let's do it there. Cannot find the link right now... So here I think this is now the full scope :) Fixed the newlines, and I think this should be ready to review / commit :D

YesCT’s picture

I was looking at #2 ...

+++ b/core/modules/menu/menu.local_tasks.yml
@@ -0,0 +1,4 @@
+menu.menu_edit:
+  title: 'Edit menu'
+  route_name: menu.menu_edit
+  tab_root_id: menu.menu_edit

+++ b/core/modules/menu/menu.module
@@ -86,11 +86,6 @@ function menu_menu() {
-  $items['admin/structure/menu/manage/%menu/edit'] = array(
-    'title' => 'Edit menu',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
-    'context' => MENU_CONTEXT_PAGE,
-  );

do we lose the idea of MENU_CONTEXT_PAGE
?

YesCT’s picture

Gábor Hojtsy’s picture

The menu context page constant does not really do anything on that item. See https://api.drupal.org/api/drupal/includes%21menu.inc/constant/MENU_CONT... this means the tab shows on the page :) This flag is meaningful in combination with other contextual states (eg MENU_CONTEXT_INLINE), but those are now removed from the menu system. So you get the same thing before/after.

Gábor Hojtsy’s picture

Title: Config Entity Follow-up local task conversion, move out of hook_menu() and to local_tasks.yml » Move static config entity local tasks to local_tasks.yml

Retitled for full scope.

Gábor Hojtsy’s picture

So #2111823: Convert field_ui / Entity local tasks to YAML definitions already covers the dynamic local tasks in field_ui, so we should be good here. This patch is as complete as it can get :) Reviews please!

YesCT’s picture

Assigned: Unassigned » YesCT
Status: Needs review » Needs work
+++ b/core/modules/shortcut/shortcut.local_tasks.yml
@@ -2,3 +2,13 @@ shortcut.overview:
+  weigt: 10

noticed this. I'll fix it and finish reading through.

tstoeckler’s picture

  1. +++ b/core/modules/entity/entity.local_tasks.yml
    @@ -0,0 +1,9 @@
    +entity.view_mode_edit:
    ...
    +entity.form_mode_edit:
    
    +++ b/core/modules/image/image.local_tasks.yml
    @@ -0,0 +1,4 @@
    +image.style_edit:
    
    +++ b/core/modules/system/system.local_tasks.yml
    @@ -61,3 +61,7 @@ system.date_format_list:
    +system.date_format_edit:
    

    Is there a reason these are not removed from the respective hook_menu() implementations?

Gábor Hojtsy’s picture

@tstoeckler: there are some tasks that were not there before, eg. the views one and the entity module ones AFAIS. (Which were I think missing from earlier rounds of patches to ensure edit tabs on config entities are present by default). The image module one I did forget to remove from the module, that needs to be done. Not going to post an update since @YesCT is on changing stuff.

YesCT’s picture

  1. +++ b/core/modules/shortcut/shortcut.local_tasks.yml
    @@ -2,3 +2,13 @@ shortcut.overview:
    +shortcut.set_edit:
    +  title: 'Edit set name'
    +  route_name: shortcut.set_edit
    +  tab_root_id: shortcut.set_customize
    +  weigt: 10
    
    +++ b/core/modules/shortcut/shortcut.module
    @@ -96,16 +96,6 @@ function shortcut_menu() {
    -  $items['admin/config/user-interface/shortcut/manage/%shortcut_set/edit'] = array(
    -    'title' => 'Edit set name',
    -    'route_name' => 'shortcut.set_edit',
    -    'type' => MENU_LOCAL_TASK,
    -    'weight' => 10,
    -  );
    

    this is taking out /edit... but

    shortcut.set_edit:
      path: '/admin/config/user-interface/shortcut/manage/{shortcut_set}/edit'
      defaults:
        _entity_form: 'shortcut_set.edit'
      requirements:
        _entity_access: 'shortcut_set.update'
    
    shortcut.link_add_inline:
      path: '/admin/config/user-interface/shortcut/manage/{shortcut_set}/add-link-inline'
      defaults:
        _controller: 'Drupal\shortcut\Controller\ShortcutSetController::addShortcutLinkInline'
      requirements:
        _entity_access: 'shortcut_set.update'
        _csrf_token: 'shortcut-add-link'
    
    shortcut.set_customize:
      path: '/admin/config/user-interface/shortcut/manage/{shortcut_set}'
      defaults:
        _entity_form: 'shortcut_set.customize'
      requirements:
        _entity_access: 'shortcut_set.update'
    

    has a customize without /edit and a different route for /edit

  2. +++ b/core/modules/system/system.local_tasks.yml
    @@ -61,3 +61,7 @@ system.date_format_list:
    +system.date_format_edit:
    +  title: 'Edit'
    +  route_name: system.date_format_edit
    +  tab_root_id: system.date_format_edit
    

    I think this was just missing. It has no cooresponding hunk removing stuff from system_menu(). ok.

YesCT’s picture

#12 1. is ok. I get it now.

YesCT’s picture

  1. +++ b/core/modules/taxonomy/taxonomy.module
    @@ -268,15 +268,6 @@ function taxonomy_menu() {
    -  $items['admin/structure/taxonomy/manage/%taxonomy_vocabulary/list'] = array(
    

    /list didn't work before this patch anyway ok.

  2. +++ b/core/modules/user/user.module
    @@ -786,10 +786,6 @@ function user_menu() {
    -  $items['admin/people/roles/manage/%user_role/edit'] = array(
    

    similar here, /edit didn't work before anyway and goes to the default manage/%user_role. ok.

SO.

only the weight typo and the image style removal of the local task from it's hook_menu.

I tried a bunch of these manually too and they work fine.

This looks rtbc to me.

YesCT’s picture

Assigned: YesCT » Unassigned
Status: Needs work » Needs review

needs review for testbot and unassigning.

jsbalsera’s picture

After applying the patch the "Edit" tab disappears from, for example, "admin/structure/types/manage/article/fields", but I suppose that this is covered by #8

Same happens in contact, like in "admin/structure/contact/manage/personal/fields", but again I think this is covered by #8

All the other changes (shortcut, roles, etc) behave exactly the same, so for me would be RTBC

tstoeckler’s picture

Re #11: As far as I'm aware, the entity ones are in fact present in entity_menu(), so I guess those would need to be removed as well.

Gábor Hojtsy’s picture

I think its dangerous to commit this without #2111823: Convert field_ui / Entity local tasks to YAML definitions since it will hide all field UI entry points from the UI. So you will not be able to add fields to node types, block types, etc. That is pretty dangerous. This should be committed "at the same time" as #2111823: Convert field_ui / Entity local tasks to YAML definitions, basically right after each other.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
5.67 KB
3.1 KB

It's not dangerous if you leave out the tasks that are already handled by that patch :)

Removed them from the patch so I think we're good to go here.

Gábor Hojtsy’s picture

I agree, looks good :) The other ones need to be with the dynamic field ones so the tabs don't break. We already broke account fieldability before (which will still not be fixed in alpha5 unless we don't get #2111823: Convert field_ui / Entity local tasks to YAML definitions in as well).

amateescu’s picture

FileSize
6.33 KB
676 bytes

@alexpott pointed out that we have a leftover entry in views_ui_menu(), let's remove it as well.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

According to @amateescu in irc #21 was preventing the views tabs from appearing so kicking back to needs work to get a test added.

amateescu’s picture

Status: Needs work » Needs review
FileSize
7.16 KB
842 bytes

Here we go.

amateescu’s picture

It turns out the tabs not appearing was a local problem (had to clear the caches), but the test is still good to have :)

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Yay, looks good again :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

tstoeckler’s picture

Does someone want a follow-up issue for #17 or can I post a quick patch here?

tstoeckler’s picture

Status: Fixed » Closed (fixed)

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